1 From a3de65d5d1861f755ced7cad291fbbd4f1b8ef51 Mon Sep 17 00:00:00 2001
2 From: Owen W. Taylor <otaylor@fishsoup.net>
3 Date: Sat, 22 Aug 2009 15:00:57 -0400
4 Subject: [PATCH] Should set RestartStyleHint to RestartIfRunning when replaced
6 This reverts most of commit abbd057eb967e6ab462ffe305f41b2b04d417b25;
8 - It's fine to call meta_session_shutdown() after the display
9 is closed, since it's talking over the ICE connection
10 - We should not call warn_about_lame_clients_and_finish_interact()
11 unless we are interacting with the window manager in a session
14 However, the part of abbd057 that fixed accessing freed memory was
15 fixing a real problem; this patches does the same thing in a simpler
16 way by fixing an obvious type in meta_display_close() where it was
17 NULL'ing out the local variable 'display' rather than the global
18 variable 'the_display' and adding keeping the check in meta_finalize()
19 that was added in abbd057.
21 The order of calling meta_session_shutdown() and
22 calling meta_display_close() is reverted back to the old order to
23 make it clear that it's OK if the display way already closed previously.
25 http://bugzilla.gnome.org/show_bug.cgi?id=588119
27 src/core/display-private.h | 2 +-
28 src/core/display.c | 16 ++++------------
29 src/core/main.c | 5 ++---
30 src/core/session.c | 8 --------
31 4 files changed, 7 insertions(+), 24 deletions(-)
33 diff --git a/src/core/display-private.h b/src/core/display-private.h
34 index 19287f3..9c8ebc6 100644
35 --- a/src/core/display-private.h
36 +++ b/src/core/display-private.h
37 @@ -329,7 +329,7 @@ MetaScreen* meta_display_screen_for_xwindow (MetaDisplay *display,
38 void meta_display_grab (MetaDisplay *display);
39 void meta_display_ungrab (MetaDisplay *display);
41 -void meta_display_unmanage_screen (MetaDisplay **display,
42 +void meta_display_unmanage_screen (MetaDisplay *display,
46 diff --git a/src/core/display.c b/src/core/display.c
47 index 55c374a..8e35a35 100644
48 --- a/src/core/display.c
49 +++ b/src/core/display.c
50 @@ -926,7 +926,7 @@ meta_display_close (MetaDisplay *display,
51 meta_compositor_destroy (display->compositor);
57 meta_quit (META_EXIT_SUCCESS);
59 @@ -4762,13 +4762,10 @@ process_selection_clear (MetaDisplay *display,
60 meta_verbose ("Got selection clear for screen %d on display %s\n",
61 screen->number, display->name);
63 - meta_display_unmanage_screen (&display,
64 + meta_display_unmanage_screen (display,
66 event->xselectionclear.time);
71 /* display and screen may both be invalid memory... */
74 @@ -4790,12 +4787,10 @@ process_selection_clear (MetaDisplay *display,
78 -meta_display_unmanage_screen (MetaDisplay **displayp,
79 +meta_display_unmanage_screen (MetaDisplay *display,
83 - MetaDisplay *display = *displayp;
85 meta_verbose ("Unmanaging screen %d on display %s\n",
86 screen->number, display->name);
88 @@ -4805,10 +4800,7 @@ meta_display_unmanage_screen (MetaDisplay **displayp,
89 display->screens = g_slist_remove (display->screens, screen);
91 if (display->screens == NULL)
93 - meta_display_close (display, timestamp);
96 + meta_display_close (display, timestamp);
100 diff --git a/src/core/main.c b/src/core/main.c
101 index a36a396..44d317e 100644
102 --- a/src/core/main.c
103 +++ b/src/core/main.c
104 @@ -361,12 +361,11 @@ static void
107 MetaDisplay *display = meta_get_display();
109 - meta_session_shutdown ();
112 meta_display_close (display,
113 CurrentTime); /* I doubt correct timestamps matter here */
115 + meta_session_shutdown ();
119 diff --git a/src/core/session.c b/src/core/session.c
120 index 7e3b389..0d69350 100644
121 --- a/src/core/session.c
122 +++ b/src/core/session.c
123 @@ -376,14 +376,6 @@ meta_session_shutdown (void)
125 char hint = SmRestartIfRunning;
127 - if (!meta_get_display ())
129 - meta_verbose ("Cannot close session because there is no display");
133 - warn_about_lame_clients_and_finish_interact (FALSE);
135 if (session_connection == NULL)