apprt/gtk: get rid of forcing context menu for now

We have escapes (shift) so lets see how that goes and compare to some
other GTK apps first.
This commit is contained in:
Mitchell Hashimoto
2024-07-22 10:21:18 -07:00
parent 6e5bc62726
commit cc3b040571

View File

@ -1357,19 +1357,14 @@ fn gtkMouseDown(
self.grabFocus(); self.grabFocus();
} }
// Allow forcing context menu to open with ctrl in apps that would normally consume the click
if (button == .right and mods.ctrl) {
self.showContextMenu(@floatCast(x), @floatCast(y));
return;
}
const consumed = self.core_surface.mouseButtonCallback(.press, button, mods) catch |err| { const consumed = self.core_surface.mouseButtonCallback(.press, button, mods) catch |err| {
log.err("error in key callback err={}", .{err}); log.err("error in key callback err={}", .{err});
return; return;
}; };
// If a right click isn't consumed, mouseButtonCallback selects the hovered word and returns false. // If a right click isn't consumed, mouseButtonCallback selects the hovered
// We can use this to handle the context menu opening under normal scenarios. // word and returns false. We can use this to handle the context menu
// opening under normal scenarios.
if (!consumed and button == .right) { if (!consumed and button == .right) {
self.showContextMenu(@floatCast(x), @floatCast(y)); self.showContextMenu(@floatCast(x), @floatCast(y));
} }