Merge lp:~unity-team/compiz/trunk.sync-all-the-ungrabs into lp:~unity-team/compiz/trunk

Proposed by Sam Spilsbury
Status: Merged
Merged at revision: 2752
Proposed branch: lp:~unity-team/compiz/trunk.sync-all-the-ungrabs
Merge into: lp:~unity-team/compiz/trunk
Diff against target: 80 lines (+8/-1)
4 files modified
plugins/composite/src/window.cpp (+1/-0)
plugins/decor/src/decor.cpp (+2/-0)
src/screen.cpp (+2/-1)
src/window.cpp (+3/-0)
To merge this branch: bzr merge lp:~unity-team/compiz/trunk.sync-all-the-ungrabs
Reviewer Review Type Date Requested Status
David Barth (community) Approve
Review via email: mp+57851@code.launchpad.net

Description of the change

Fixes the random hangs in LP #740126 since the server grab wasn't released until the output buffer is flushed and when unity makes an X call here on its own connection it will soft hang.

To post a comment you must log in.
Revision history for this message
David Barth (dbarth) wrote :

As investigated with RAOF, Jason and smspillaz

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/composite/src/window.cpp'
2--- plugins/composite/src/window.cpp 2011-03-11 16:17:29 +0000
3+++ plugins/composite/src/window.cpp 2011-04-15 11:33:25 +0000
4@@ -142,6 +142,7 @@
5 priv->size = CompSize (attr.border_width * 2 + attr.width,
6 attr.border_width * 2 + attr.height);
7 XUngrabServer (screen->dpy ());
8+ XSync (screen->dpy (), false);
9 }
10 return true;
11 }
12
13=== modified file 'plugins/decor/src/decor.cpp'
14--- plugins/decor/src/decor.cpp 2011-04-08 06:32:23 +0000
15+++ plugins/decor/src/decor.cpp 2011-04-15 11:33:25 +0000
16@@ -1175,6 +1175,7 @@
17 }
18
19 XUngrabServer (screen->dpy ());
20+ XSync (screen->dpy (), false);
21 }
22
23 void
24@@ -1293,6 +1294,7 @@
25 }
26
27 XUngrabServer (screen->dpy ());
28+ XSync (screen->dpy (), false);
29 }
30
31 void
32
33=== modified file 'src/screen.cpp'
34--- src/screen.cpp 2011-04-15 10:11:02 +0000
35+++ src/screen.cpp 2011-04-15 11:33:25 +0000
36@@ -4507,6 +4507,7 @@
37 "already running on screen: %d", DefaultScreen (dpy));
38
39 XUngrabServer (dpy);
40+ XSync (dpy, false);
41 return false;
42 }
43
44@@ -4638,7 +4639,7 @@
45 XDefineCursor (dpy, priv->root, priv->normalCursor);
46
47 XUngrabServer (dpy);
48- XSync (dpy, FALSE);
49+ XSync (dpy, false);
50
51 priv->setAudibleBell (priv->optionGetAudibleBell ());
52
53
54=== modified file 'src/window.cpp'
55--- src/window.cpp 2011-04-15 10:11:02 +0000
56+++ src/window.cpp 2011-04-15 11:33:25 +0000
57@@ -1226,6 +1226,7 @@
58 }
59
60 XUngrabServer (screen->dpy ());
61+ XSync (screen->dpy (), false);
62 }
63 else
64 {
65@@ -5815,6 +5816,7 @@
66 ExposureMask);
67
68 XUngrabServer (dpy);
69+ XSync (dpy, false);
70
71 XMoveResizeWindow (dpy, frame, sg.x (), sg.y (), sg.width (), sg.height ());
72
73@@ -5885,6 +5887,7 @@
74 ExposureMask);
75
76 XUngrabServer (dpy);
77+ XSync (dpy, false);
78
79 XMoveWindow (dpy, id, serverGeometry.x (), serverGeometry.y ());
80 }

Subscribers

People subscribed via source and target branches

to all changes: