[Xfce4-commits] <thunar:xfce-4.8> Revert and fix a part of 32c528a8e9a36ab522b73590a03332027316040b.
Jannis Pohlmann
noreply at xfce.org
Fri May 27 00:16:02 CEST 2011
Updating branch refs/heads/xfce-4.8
to b43798915a9ff891df405ae46ac15da1c64c93cd (commit)
from 48d089cd7f23d230d9956a1728c0c665ab8ec6c9 (commit)
commit b43798915a9ff891df405ae46ac15da1c64c93cd
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