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
This commit is contained in:
Thomas James Alexander Thurman 2009-02-11 05:26:58 +00:00
parent 6da5b8ccc5
commit abbd057eb9
5 changed files with 36 additions and 6 deletions

View File

@ -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.

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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;