Window is opened at background and gtk_window_present() doesn't work
Steps to reproduce
- Follow instruction at https://developer.gnome.org/gtk3/stable/gtk-getting-started.html (example-0)
Current behavior
A window opened under other windows (background).
Expected outcome
A window opened on top of other windows (foreground) and in focus.
Version information
-
Ubuntu 18.10, libgtk-3-dev 3.24.1-1ubuntu2, installed from the official repo
The window system is X11, checked with
GdkDisplay * display = gdk_display_get_default(); printf("GDK_IS_WAYLAND_DISPLAY = %u\n", GDK_IS_WAYLAND_DISPLAY(display)); printf("GDK_IS_X11_DISPLAY = %u\n", GDK_IS_X11_DISPLAY(display));
-
macOS, gtk installed via brew
Additional information
Warnings
No warnings on the terminal.
Workaround (no)
-
gtk_window_present(GTK_WINDOW(window))
doesn't have effect (maybe the same problem as #624 (closed)). -
gtk_window_set_keep_above(GTK_WINDOW(window), TRUE)
brings the window on top, but without focus.
Edited by Yuriy Syrovetskiy