aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZakariyya Von Forslun <zakariyyavf@protonmail.com>2022-06-22 08:56:21 +1000
committerIsaac Freund <mail@isaacfreund.com>2022-06-22 11:03:02 +0200
commitbd03484b2876e8113071aed429a84bbbf296840f (patch)
tree0e5246a38005a300d13465ab5b72556ce0212cc9
parent5cce49095aebd89803456bfa57541f6a10618a45 (diff)
downloadriver-bd03484b2876e8113071aed429a84bbbf296840f.tar.gz
river-bd03484b2876e8113071aed429a84bbbf296840f.tar.xz
Xwayland: restrict OR focus changes based on ICCCM input model
Some popup menus are not covered by the `overrideRedirectWantsFocus()` heuristic (e.g. in IntelliJ IDEA), so before focusing an OR window, its input model should also be checked to ensure that it is able to take input focus. This appears to fix the popup menus in IntelliJ IDEA, which would otherwise disappear immediately due to unwanted focus.
-rw-r--r--river/Cursor.zig4
-rw-r--r--river/XwaylandOverrideRedirect.zig4
2 files changed, 6 insertions, 2 deletions
diff --git a/river/Cursor.zig b/river/Cursor.zig
index 4557bad..f66d2be 100644
--- a/river/Cursor.zig
+++ b/river/Cursor.zig
@@ -317,7 +317,9 @@ fn handleButton(listener: *wl.Listener(*wlr.Pointer.event.Button), event: *wlr.P
},
.xwayland_override_redirect => |override_redirect| {
if (!build_options.xwayland) unreachable;
- if (override_redirect.xwayland_surface.overrideRedirectWantsFocus()) {
+ if (override_redirect.xwayland_surface.overrideRedirectWantsFocus() and
+ override_redirect.xwayland_surface.icccmInputModel() != .none)
+ {
self.seat.setFocusRaw(.{ .xwayland_override_redirect = override_redirect });
}
},
diff --git a/river/XwaylandOverrideRedirect.zig b/river/XwaylandOverrideRedirect.zig
index a6916ec..77cd74b 100644
--- a/river/XwaylandOverrideRedirect.zig
+++ b/river/XwaylandOverrideRedirect.zig
@@ -96,7 +96,9 @@ pub fn handleMap(listener: *wl.Listener(*wlr.XwaylandSurface), xwayland_surface:
xwayland_surface.surface.?.events.commit.add(&self.commit);
- if (self.xwayland_surface.overrideRedirectWantsFocus()) {
+ if (self.xwayland_surface.overrideRedirectWantsFocus() and
+ self.xwayland_surface.icccmInputModel() != .none)
+ {
server.input_manager.defaultSeat().setFocusRaw(.{ .xwayland_override_redirect = self });
}
}