ComboBox: List-mode popup must open on CB’s screen
authorDaniel Boles <dboles@src.gnome.org>
Sun, 27 Aug 2017 20:29:52 +0000 (21:29 +0100)
committerDaniel Boles <dboles@src.gnome.org>
Mon, 28 Aug 2017 18:33:54 +0000 (19:33 +0100)
The screen for the list-mode popup_window was only being set in
set_popup_widget(), i.e. when changing modes, so if the ComboBox was
moved to a different screen later, the popup would appear on the
original one, which is wrong.

Worse, this (somehow) broke opening some combos in the Inspector.

Fix this by moving the call to set_screen() to popup_for_device(), so
the popup_window is put on the correct screen each time around.

https://bugzilla.gnome.org/show_bug.cgi?id=468868
https://bugzilla.gnome.org/show_bug.cgi?id=786771

gtk/gtkcombobox.c

index 1bac65977a74432434895689e2a2edb56912bb10..743aa49408565603bba64267e8fe69776e4e8c3e 100644 (file)
@@ -1880,8 +1880,6 @@ gtk_combo_box_set_popup_widget (GtkComboBox *combo_box,
             }
 
           gtk_window_set_resizable (GTK_WINDOW (priv->popup_window), FALSE);
-          gtk_window_set_screen (GTK_WINDOW (priv->popup_window),
-                                 gtk_widget_get_screen (GTK_WIDGET (combo_box)));
 
           priv->scrolled_window = gtk_scrolled_window_new (NULL, NULL);
 
@@ -2359,6 +2357,8 @@ gtk_combo_box_popup_for_device (GtkComboBox *combo_box,
                                   TRUE);
 
   /* popup */
+  gtk_window_set_screen (GTK_WINDOW (priv->popup_window),
+                         gtk_widget_get_screen (GTK_WIDGET (combo_box)));
   gtk_widget_show (priv->popup_window);
 
   if (path)