gtk_window_present_with_time() with GDK_CURRENT_TIME is ignored on Wayland
This is a follow up to this eog bug (reported by which can't be reassigned due to the Gitlab migration: https://bugzilla.gnome.org/show_bug.cgi?id=795690
Steps to reproduce
- Use Nautilus to open a picture in Eye of GNOME
- Wait for eog to show up
- Try opening the same picture from a Nautilus window again
Current behavior
The already opened Eye of GNOME window stays in the background / remains unfocussed.
Expected outcome
The existing Eye of GNOME window should be focussed / brought to the front.
Version information
This is on F28 with GTK+ 3.22.30 and Eye of GNOME 3.28.1.
Additional information
Debugging shows that gtk_window_present_with_time()
gets called correctly by EogApplication's open()-callback. The problem seems to be here that GDK_CURRENT_TIME
is used as the timestamp parameter (there's no event timestamp available at that time). This seems to be ignored by the GdkWayland code: gdkwindow-wayland.c
This however means that gdk_window_present()
becomes a no-op, as it's just a nice way of saying gdk_window_present_with_time(x, GDK_CURRENT_TIME)
.
Running on X11 or with GDK_BACKEND=x11 makes it behave correctly. It's also reproducible with Nautilus if you try opening a folder twice (e.g. from the commandline).
As an experiment I tried using time(NULL)
as timestamp parameter instead and it worked, but I am not sure if that counts as a solution.