[Xfce4-commits] <thunar:master> Revert and fix a part of 32c528a8e9a36ab522b73590a03332027316040b.

Jannis Pohlmann noreply at xfce.org
Thu May 26 23:52:01 CEST 2011


Updating branch refs/heads/master
         to a1a03e46293b7a9ead88afa48c10036b08fcf815 (commit)
       from 0fef45d69692e1e95ef73a10fb790102268a16f9 (commit)

commit a1a03e46293b7a9ead88afa48c10036b08fcf815
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Thu May 26 23:45:13 2011 +0200

    Revert and fix a part of 32c528a8e9a36ab522b73590a03332027316040b.

 thunar/thunar-column-editor.c |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/thunar/thunar-column-editor.c b/thunar/thunar-column-editor.c
index abe03b3..738c49f 100644
--- a/thunar/thunar-column-editor.c
+++ b/thunar/thunar-column-editor.c
@@ -541,11 +541,27 @@ thunar_show_column_editor (gpointer parent)
 {
   GtkWidget *window = NULL;
   GtkWidget *dialog;
+  GdkScreen *screen = NULL;
 
   _thunar_return_if_fail (parent == NULL || GDK_IS_SCREEN (parent) || GTK_IS_WIDGET (parent));
 
-  if (GTK_IS_WIDGET (parent))
-    window = gtk_widget_get_toplevel (parent);
+  /* determine the screen for the dialog */
+  if (G_UNLIKELY (parent == NULL))
+    {
+      /* just use the default screen, no toplevel window */
+      screen = gdk_screen_get_default ();
+    }
+  else if (GTK_IS_WIDGET (parent))
+    {
+      /* use the screen for the widget and the toplevel window */
+      screen = gtk_widget_get_screen (parent);
+      window = gtk_widget_get_toplevel (parent);
+    }
+  else
+    {
+      /* parent is a screen, no toplevel window */
+      screen = GDK_SCREEN (parent);
+    }
 
   /* display the column editor */
   dialog = thunar_column_editor_new ();
@@ -559,6 +575,10 @@ thunar_show_column_editor (gpointer parent)
       gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
     }
 
+  /* set the screen for the window */
+  if (screen != NULL && GDK_IS_SCREEN (screen))
+    gtk_window_set_screen (GTK_WINDOW (dialog), screen);
+
   /* run the dialog */
   gtk_dialog_run (GTK_DIALOG (dialog));
 



More information about the Xfce4-commits mailing list