Win32: transient window lowered when clicked on non-focused application
Steps to reproduce
- Open two transient windows with the same parent and arrange them overlapping, window 2 on top
- Give focus to another application (e.g. Windows Explorer)
- Click transient window 2 (the one on top)
Current behavior
Transient window 2 gets lowered below transient window 1.
Expected outcome
Transient window 2 stays on top, since it receives the focus.
Version information
- Windows 10
- gtk 3.24.13
Example program
#include <gtk/gtk.h>
static void activate (GtkApplication* app, gpointer user_data)
{
char transienttitle[] = "0 Transient Window";
int transient_count = 2;
GtkWidget *parentwindow;
parentwindow = gtk_application_window_new (app);
gtk_window_set_title (GTK_WINDOW (parentwindow), "Parent Window");
gtk_window_set_default_size (GTK_WINDOW (parentwindow), 400, 200);
while (transient_count-- > 0) {
GtkWidget *transientwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
++transienttitle[0];
gtk_window_set_title (GTK_WINDOW (transientwindow), transienttitle);
gtk_window_set_default_size (GTK_WINDOW (transientwindow), 300, 100);
gtk_window_set_transient_for (GTK_WINDOW(transientwindow), GTK_WINDOW(parentwindow));
gtk_widget_show_all (transientwindow);
}
gtk_widget_show_all (parentwindow);
}
int main (int argc, char **argv)
{
GtkApplication *app;
int status;
app = gtk_application_new ("test.transient", G_APPLICATION_FLAGS_NONE);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);
return status;
}
Edited by Thomas Holder