Gentoo Archives: gentoo-commits

From: "Gilles Dartiguelongue (eva)" <eva@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-wm/metacity/files: metacity-2.28.0-restartstylehint-when-replace.patch
Date: Thu, 29 Oct 2009 22:41:46
Message-Id: E1N3dge-0005uY-Ev@stork.gentoo.org
1 eva 09/10/29 22:41:44
2
3 Added: metacity-2.28.0-restartstylehint-when-replace.patch
4 Log:
5 New version for GNOME 2.28. Clean up old revisions.
6 (Portage version: 2.2_rc46/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 x11-wm/metacity/files/metacity-2.28.0-restartstylehint-when-replace.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-wm/metacity/files/metacity-2.28.0-restartstylehint-when-replace.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-wm/metacity/files/metacity-2.28.0-restartstylehint-when-replace.patch?rev=1.1&content-type=text/plain
13
14 Index: metacity-2.28.0-restartstylehint-when-replace.patch
15 ===================================================================
16 From a3de65d5d1861f755ced7cad291fbbd4f1b8ef51 Mon Sep 17 00:00:00 2001
17 From: Owen W. Taylor <otaylor@××××××××.net>
18 Date: Sat, 22 Aug 2009 15:00:57 -0400
19 Subject: [PATCH] Should set RestartStyleHint to RestartIfRunning when replaced
20
21 This reverts most of commit abbd057eb967e6ab462ffe305f41b2b04d417b25;
22
23 - It's fine to call meta_session_shutdown() after the display
24 is closed, since it's talking over the ICE connection
25 - We should not call warn_about_lame_clients_and_finish_interact()
26 unless we are interacting with the window manager in a session
27 save.
28
29 However, the part of abbd057 that fixed accessing freed memory was
30 fixing a real problem; this patches does the same thing in a simpler
31 way by fixing an obvious type in meta_display_close() where it was
32 NULL'ing out the local variable 'display' rather than the global
33 variable 'the_display' and adding keeping the check in meta_finalize()
34 that was added in abbd057.
35
36 The order of calling meta_session_shutdown() and
37 calling meta_display_close() is reverted back to the old order to
38 make it clear that it's OK if the display way already closed previously.
39
40 http://bugzilla.gnome.org/show_bug.cgi?id=588119
41 ---
42 src/core/display-private.h | 2 +-
43 src/core/display.c | 16 ++++------------
44 src/core/main.c | 5 ++---
45 src/core/session.c | 8 --------
46 4 files changed, 7 insertions(+), 24 deletions(-)
47
48 diff --git a/src/core/display-private.h b/src/core/display-private.h
49 index 19287f3..9c8ebc6 100644
50 --- a/src/core/display-private.h
51 +++ b/src/core/display-private.h
52 @@ -329,7 +329,7 @@ MetaScreen* meta_display_screen_for_xwindow (MetaDisplay *display,
53 void meta_display_grab (MetaDisplay *display);
54 void meta_display_ungrab (MetaDisplay *display);
55
56 -void meta_display_unmanage_screen (MetaDisplay **display,
57 +void meta_display_unmanage_screen (MetaDisplay *display,
58 MetaScreen *screen,
59 guint32 timestamp);
60
61 diff --git a/src/core/display.c b/src/core/display.c
62 index 55c374a..8e35a35 100644
63 --- a/src/core/display.c
64 +++ b/src/core/display.c
65 @@ -926,7 +926,7 @@ meta_display_close (MetaDisplay *display,
66 meta_compositor_destroy (display->compositor);
67
68 g_free (display);
69 - display = NULL;
70 + the_display = NULL;
71
72 meta_quit (META_EXIT_SUCCESS);
73 }
74 @@ -4762,13 +4762,10 @@ process_selection_clear (MetaDisplay *display,
75 meta_verbose ("Got selection clear for screen %d on display %s\n",
76 screen->number, display->name);
77
78 - meta_display_unmanage_screen (&display,
79 + meta_display_unmanage_screen (display,
80 screen,
81 event->xselectionclear.time);
82
83 - if (!display)
84 - the_display = NULL;
85 -
86 /* display and screen may both be invalid memory... */
87
88 return;
89 @@ -4790,12 +4787,10 @@ process_selection_clear (MetaDisplay *display,
90 }
91
92 void
93 -meta_display_unmanage_screen (MetaDisplay **displayp,
94 +meta_display_unmanage_screen (MetaDisplay *display,
95 MetaScreen *screen,
96 guint32 timestamp)
97 {
98 - MetaDisplay *display = *displayp;
99 -
100 meta_verbose ("Unmanaging screen %d on display %s\n",
101 screen->number, display->name);
102
103 @@ -4805,10 +4800,7 @@ meta_display_unmanage_screen (MetaDisplay **displayp,
104 display->screens = g_slist_remove (display->screens, screen);
105
106 if (display->screens == NULL)
107 - {
108 - meta_display_close (display, timestamp);
109 - *displayp = NULL;
110 - }
111 + meta_display_close (display, timestamp);
112 }
113
114 void
115 diff --git a/src/core/main.c b/src/core/main.c
116 index a36a396..44d317e 100644
117 --- a/src/core/main.c
118 +++ b/src/core/main.c
119 @@ -361,12 +361,11 @@ static void
120 meta_finalize (void)
121 {
122 MetaDisplay *display = meta_get_display();
123 -
124 - meta_session_shutdown ();
125 -
126 if (display)
127 meta_display_close (display,
128 CurrentTime); /* I doubt correct timestamps matter here */
129 +
130 + meta_session_shutdown ();
131 }
132
133 static void
134 diff --git a/src/core/session.c b/src/core/session.c
135 index 7e3b389..0d69350 100644
136 --- a/src/core/session.c
137 +++ b/src/core/session.c
138 @@ -376,14 +376,6 @@ meta_session_shutdown (void)
139 SmProp *props[1];
140 char hint = SmRestartIfRunning;
141
142 - if (!meta_get_display ())
143 - {
144 - meta_verbose ("Cannot close session because there is no display");
145 - return;
146 - }
147 -
148 - warn_about_lame_clients_and_finish_interact (FALSE);
149 -
150 if (session_connection == NULL)
151 return;
152
153 --
154 1.6.4