I made an application using gtk3 that displays notifications by briefly showing an image in the center of the screen. To do this I created a GTK_WINDOW_POPUP window, as I didn’t want decorations and I didn’t want it to show up in the taskbar or pager, and I wanted it to always be on top of everything. I also used gtk_window_input_shape_combine_region to let clicks “pass through” the window.
This worked fine on ubuntu 18 with x11. When I tried it on debian with wayland however, a number of problems appeared. From my understanding it’s not possible to center a window in wayland. I managed to solve this by maximizing (not fullscreen as it had the side effect of hiding some gnome desktop stuff) the window and drawing with an offset so the image appeared centered. But there were a few more problems I had that I didn’t manage to solve:
- When I used a GTK_WINDOW_POPUP I got warnings in terminal. But if I used GTK_WINDOW_TOPLEVEL then gtk_window_input_shape_combine_region stopped working - my window would eat all click events. So I had to use POPUP and live with the warnings. Also even with POPUP it seemed to work inconsistently.
- The window now showed up in taskbar ( I also tried explicitly calling gtk_window_set_skip_taskbar_hint)
- The window now showed up in pager (I also tried explicitly calling gtk_window_set_skip_pager_hint)
- The window no longer was always on top (I also tried explicitly calling gtk_window_set_keep_above)
- The picture jumps a little bit a split second after appearing.
When I tried the original code in an x11 session in debian everything was fine.
When I tried the original code in a wayland session in debian but with GDK_BACKEND=x11 everything was also fine.
According to /usr/include/gtk-3.0/gtk/gtkversion.h I’m on major:3, minor:24, micro:5
My mutter version is 3.30.2-9~deb10u1