Merge lp:~unity-team/compiz/trunk.icccm-4.1.4 into lp:~unity-team/compiz/trunk

Proposed by Sam Spilsbury
Status: Merged
Merge reported by: David Barth
Merged at revision: not available
Proposed branch: lp:~unity-team/compiz/trunk.icccm-4.1.4
Merge into: lp:~unity-team/compiz/trunk
Diff against target: 74 lines (+23/-13)
2 files modified
CMakeLists.txt (+1/-1)
src/window.cpp (+22/-12)
To merge this branch: bzr merge lp:~unity-team/compiz/trunk.icccm-4.1.4
Reviewer Review Type Date Requested Status
Loïc Molinari (community) Approve
David Barth (community) Approve
Review via email: mp+55971@code.launchpad.net

Description of the change

ICCCM Compliance. We need to handle the case where the window maps to get from Withdrawn state to Iconic state such that it is managed but never actually mapped. This is crack, but applications do it, so we have to support it (key perpetrator, xterm -iconic)

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

Same here: can you provide 2 test cases:
1. to verify that the issue is solved
2. to verify that "normal" cases still work as before

Please copy them to comments in the bug report, as the merge prop history gets lost once the branch is merged.

Thanks

review: Needs Information
Revision history for this message
David Barth (dbarth) wrote :

For reference, Sam wrote a test case: lp:~smspillaz/testing/unmaptest also mentioned on the bug report.

Revision history for this message
David Barth (dbarth) :
review: Approve
Revision history for this message
Loïc Molinari (loic.molinari) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2011-04-01 11:25:21 +0000
3+++ CMakeLists.txt 2011-04-01 16:44:24 +0000
4@@ -112,7 +112,7 @@
5 add_subdirectory (libdecoration)
6 add_subdirectory (gtk)
7 add_subdirectory (kde)
8-add_subdirectory (unity/unity_window_decorator)
9+#add_subdirectory (unity/unity_window_decorator)
10 add_subdirectory (po)
11 add_subdirectory (metadata)
12 add_subdirectory (src)
13
14=== modified file 'src/window.cpp'
15--- src/window.cpp 2011-03-27 04:14:46 +0000
16+++ src/window.cpp 2011-04-01 16:44:24 +0000
17@@ -4594,6 +4594,7 @@
18 PrivateWindow::processMap ()
19 {
20 bool allowFocus;
21+ bool wasManaged = priv->managed;
22 CompStackingUpdateMode stackingMode;
23
24 priv->initialViewport = screen->vp ();
25@@ -4645,7 +4646,10 @@
26
27 window->updateAttributes (stackingMode);
28
29- if (window->minimized ())
30+ /* Window was either minimized by us, or it was mapped again
31+ * since it has gone from withdrawn to iconic state, so
32+ * unminimize it */
33+ if (window->minimized () && (window->pendingMaps () || wasManaged))
34 window->unminimize ();
35
36 screen->leaveShowDesktopMode (window);
37@@ -5282,21 +5286,27 @@
38 }
39 else if (!overrideRedirect ())
40 {
41- if (screen->priv->getWmState (priv->id) == IconicState)
42+ if (screen->priv->getWmState (priv->id) == IconicState ||
43+ (priv->hints && priv->hints->initial_state == IconicState))
44 {
45 // before everything else in maprequest
46 if (!priv->frame)
47 priv->reparent ();
48- priv->managed = true;
49- priv->placed = true;
50-
51- if (priv->state & CompWindowStateHiddenMask)
52- {
53- if (priv->state & CompWindowStateShadedMask)
54- priv->shaded = true;
55- else
56- priv->minimized = true;
57- }
58+
59+ /* Not managed until map processing is done here
60+ * since to go from Withdrawn -> Iconic the client
61+ * needs to map the window again */
62+ priv->managed = false;
63+ priv->placed = !(priv->hints && priv->hints->initial_state == IconicState);
64+
65+
66+ /* FIXME: CompWindowStateShadedMask can't be set
67+ * at this time anyways, so any window that wants
68+ * to start out shaded will have to be minimized instead */
69+ if (priv->state & CompWindowStateShadedMask)
70+ priv->shaded = true;
71+ else
72+ priv->minimized = true;
73 }
74 }
75

Subscribers

People subscribed via source and target branches

to all changes: