]> www.fi.muni.cz Git - evince.git/commitdiff
[dualscreen] fix crash on ctrl+w and fix control window closing dualhead
authorxbezdick <255993@mail.muni.cz>
Wed, 18 May 2011 19:00:33 +0000 (21:00 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 1 Jun 2011 11:09:22 +0000 (13:09 +0200)
shell/ev-dualscreen.c

index 1802963c637d6ff564b6cc670eaf12e24088469c..2c219f480a93edc6458d466fbd9ba2e51625656b 100644 (file)
@@ -299,6 +299,9 @@ ev_dscwindow_set_presentation   (EvDSCWindow    *ev_dscwindow,
 static gboolean
 ev_dscwindow_end (GtkWidget *widget, GdkEvent *event)
 {
+       EvDSCWindow *ev_dscwindow = EV_DSCWINDOW(widget);
+       EvWindow *ev_window = EV_WINDOW(ev_dscwindow->priv->presentation_window);
+       ev_window_stop_presentation (ev_window, TRUE);
        gtk_widget_destroy (widget);
        return TRUE;
 }
@@ -419,16 +422,17 @@ ev_dscwindow_dispose (GObject *obj)
 {
        EvDSCWindow *ev_dscwindow = EV_DSCWINDOW (obj);
        EvDSCWindowPrivate *priv = EV_DSCWINDOW (ev_dscwindow)->priv;
+       EvWindow *ev_window = EV_WINDOW(priv->presentation_window);
+       if(EV_IS_WINDOW (ev_window)) {
+               if (priv->moveback_monitor >= 0) {
+                       GtkWindow *presentation_window = GTK_WINDOW (priv->presentation_window);
+                       GdkRectangle coords;
 
-       if (priv->moveback_monitor >= 0) {
-               GtkWindow *presentation_window = GTK_WINDOW (priv->presentation_window);
-               GdkRectangle coords;
-
-               gdk_screen_get_monitor_geometry (gtk_window_get_screen (presentation_window),
+                       gdk_screen_get_monitor_geometry (gtk_window_get_screen (presentation_window),
                                                 priv->moveback_monitor, &coords);
-               gtk_window_move (presentation_window, coords.x, coords.y);
+                       gtk_window_move (presentation_window, coords.x, coords.y);
+               }
        }
-       ev_window_stop_presentation (EV_WINDOW(priv->presentation_window), TRUE);
        G_OBJECT_CLASS (ev_dscwindow_parent_class)->dispose (obj);
 }