summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas James Alexander Thurman <tthurman@src.gnome.org>2009-02-11 05:26:58 +0000
committerThomas James Alexander Thurman <tthurman@src.gnome.org>2009-02-11 05:26:58 +0000
commitabbd057eb967e6ab462ffe305f41b2b04d417b25 (patch)
tree0aa694cdae991998d4702651dbbb7599ac6750bc
parent6da5b8ccc5eca015617e33c4de19b090beee37eb (diff)
downloadmetacity-abbd057eb967e6ab462ffe305f41b2b04d417b25.tar.gz
Session must be saved before display close, and display
shouldn't close during shutdown if it's already closed. Can't believe we don't have a bug about this already... * src/core/display-private.h: * src/core/display.c: * src/core/main.c: * src/core/session.c: svn path=/trunk/; revision=4133
-rw-r--r--ChangeLog11
-rw-r--r--src/core/display-private.h2
-rw-r--r--src/core/display.c14
-rw-r--r--src/core/main.c7
-rw-r--r--src/core/session.c8
5 files changed, 36 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index a2237b4c..09cf1b29 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-02-11 Thomas Thurman <tthurman@gnome.org>
+
+ Session must be saved before display close, and display
+ shouldn't close during shutdown if it's already closed.
+ Can't believe we don't have a bug about this already...
+
+ * src/core/display-private.h:
+ * src/core/display.c:
+ * src/core/main.c:
+ * src/core/session.c:
+
2009-02-10 Matt Kraai <kraai@ftfbs.org>
Don't define meta_spew_event unless verbose mode is on.
diff --git a/src/core/display-private.h b/src/core/display-private.h
index 9c8ebc68..19287f36 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -329,7 +329,7 @@ MetaScreen* meta_display_screen_for_xwindow (MetaDisplay *display,
void meta_display_grab (MetaDisplay *display);
void meta_display_ungrab (MetaDisplay *display);
-void meta_display_unmanage_screen (MetaDisplay *display,
+void meta_display_unmanage_screen (MetaDisplay **display,
MetaScreen *screen,
guint32 timestamp);
diff --git a/src/core/display.c b/src/core/display.c
index 70b952a3..55c374ae 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -4762,10 +4762,13 @@ process_selection_clear (MetaDisplay *display,
meta_verbose ("Got selection clear for screen %d on display %s\n",
screen->number, display->name);
- meta_display_unmanage_screen (display,
+ meta_display_unmanage_screen (&display,
screen,
event->xselectionclear.time);
+ if (!display)
+ the_display = NULL;
+
/* display and screen may both be invalid memory... */
return;
@@ -4787,10 +4790,12 @@ process_selection_clear (MetaDisplay *display,
}
void
-meta_display_unmanage_screen (MetaDisplay *display,
+meta_display_unmanage_screen (MetaDisplay **displayp,
MetaScreen *screen,
guint32 timestamp)
{
+ MetaDisplay *display = *displayp;
+
meta_verbose ("Unmanaging screen %d on display %s\n",
screen->number, display->name);
@@ -4800,7 +4805,10 @@ meta_display_unmanage_screen (MetaDisplay *display,
display->screens = g_slist_remove (display->screens, screen);
if (display->screens == NULL)
- meta_display_close (display, timestamp);
+ {
+ meta_display_close (display, timestamp);
+ *displayp = NULL;
+ }
}
void
diff --git a/src/core/main.c b/src/core/main.c
index ede0cbb4..6c36f107 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -353,10 +353,13 @@ meta_select_display (gchar *display_name)
static void
meta_finalize (void)
{
- meta_display_close (meta_get_display (),
- CurrentTime); /* I doubt correct timestamps matter here */
+ MetaDisplay *display = meta_get_display();
meta_session_shutdown ();
+
+ if (display)
+ meta_display_close (display,
+ CurrentTime); /* I doubt correct timestamps matter here */
}
static void
diff --git a/src/core/session.c b/src/core/session.c
index fc29e13d..07074919 100644
--- a/src/core/session.c
+++ b/src/core/session.c
@@ -376,6 +376,14 @@ meta_session_shutdown (void)
SmProp *props[1];
char hint = SmRestartIfRunning;
+ if (!meta_get_display ())
+ {
+ meta_verbose ("Cannot close session because there is no display");
+ return;
+ }
+
+ warn_about_lame_clients_and_finish_interact (FALSE);
+
if (session_connection == NULL)
return;