Notifications stealing focus & grabbing mouse on i3
Since commit 59e6bfa8 notifications are recognized as windows, so i3 thinks I want it focused + mouse moved to it for some reason. It's possible to make it not steal the focus, but it's not possible to not move the mouse it seems. (it's weird it even moves the mouse, it usually doesn't move the mouse to new windows on my setup at all)
It looks like the gdk_window_set_override_redirect(gtk_widget_get_window(widget), TRUE);
line that was removed for security reasons was the thing that made it work properly on i3, which is weird, because other notification daemons that are designed for i3 are also able to show notifications without stealing focus / mouse pointer. (e.g. dunst
works properly)
No interesting things changed in xprop of the notification window, except these fields seem to have been assigned by the window manager now:
+WM_STATE(WM_STATE):
+ window state: Normal
+ icon window: 0x0
+I3_FLOATING_WINDOW(CARDINAL) = 1
But I don't know if these are any helpful for the problem at hand.
Focus / mouse stealing only occurs when both the focus and the mouse are on a different monitor.
Another notification daemon, "Dunst", has both _NET_WM_WINDOW_TYPE_NOTIFICATION
and _NET_WM_WINDOW_TYPE_UTILITY
props set on the _NET_WM_WINDOW_TYPE
atom. Changing the type from notification to utility in xfce4-notifyd doesn't really make sense logically and it also doesn't work. I don't know how to set two hints with GDK, so I don't know what would happen in that case. Maybe it's just caused by some extra properties being sent or gdk actually explicitly moves the mouse or focus around somewhere internally?
Dunst does not have any other special atoms that I can read through xprop
. (only opacity, state = state_above, wm_class and wm_name - all of which are present or even extended on the xfce notification window)