From: xbezdick <255993@mail.muni.cz> Date: Wed, 18 May 2011 19:00:33 +0000 (+0200) Subject: [dualscreen] fix crash on ctrl+w and fix control window closing X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=HEAD;p=evince.git [dualscreen] fix crash on ctrl+w and fix control window closing --- diff --git a/shell/ev-dualscreen.c b/shell/ev-dualscreen.c index 1802963c..2c219f48 100644 --- a/shell/ev-dualscreen.c +++ b/shell/ev-dualscreen.c @@ -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); }