XWayland will return 0x0 (the root window id) when a Wayland window is focused, so if you switch to another Wayland window, the notification will not be displayed. To workaround this, I just replaced nowindowid with 0x0 as a marker for no window being focused.
NOTE: This change doesn't implement window checking for Wayland, so notifications from a focused Wayland window will be displayed.
I also added an exit code check to only use the window id from xprop if it succeeds. This isn't essential to support Wayland + XWayland, but it should act as a safe guard if the X connection fails.
XWayland will return
0x0
(the root window id) when a Wayland window is focused, so if you switch to another Wayland window, the notification will not be displayed. To workaround this, I just replacednowindowid
with0x0
as a marker for no window being focused.NOTE: This change doesn't implement window checking for Wayland, so notifications from a focused Wayland window will be displayed.
I also added an exit code check to only use the window id from xprop if it succeeds. This isn't essential to support Wayland + XWayland, but it should act as a safe guard if the X connection fails.