From 13349537f60905b102ece21848f65854f8095f13 Mon Sep 17 00:00:00 2001 From: xbezdick <255993@mail.muni.cz> Date: Wed, 18 May 2011 21:00:33 +0200 Subject: [PATCH] [dualscreen] fix crash on ctrl+w and fix control window closing --- shell/ev-dualscreen.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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); } -- 2.43.5