Code

use correct method of accessing top-level window for transientization
authorbuliabyak <buliabyak@users.sourceforge.net>
Sat, 14 Feb 2009 00:18:28 +0000 (00:18 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Sat, 14 Feb 2009 00:18:28 +0000 (00:18 +0000)
src/widgets/desktop-widget.cpp

index 0751e57831185c11c16d80c13336d6e1fcf95d01..324e5b0087d1401b55198368d89f4efcedf91582 100644 (file)
@@ -1069,9 +1069,10 @@ SPDesktopWidget::setWindowSize (gint w, gint h)
 void
 SPDesktopWidget::setWindowTransient (void *p, int transient_policy)
 {
-    GtkWindow *w =GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(this)));
-    if (w)
+    Gtk::Window *window = (Gtk::Window*)gtk_object_get_data (GTK_OBJECT(this), "window");
+    if (window)
     {
+        GtkWindow *w = (GtkWindow *) window->gobj();
         gtk_window_set_transient_for (GTK_WINDOW(p), w);
 
         /*
@@ -1082,7 +1083,6 @@ SPDesktopWidget::setWindowTransient (void *p, int transient_policy)
          * (so that its transients also could raise)
          */
         if (transient_policy == 2)
-
             // without this, a transient window not always emerges on top
             gtk_window_present (w);
     }