Merge lp:~brandontschaefer/compiz/lp.1034616-fix into lp:compiz/0.9.9

Proposed by Brandon Schaefer on 2013-02-27
Status: Merged
Approved by: Sam Spilsbury on 2013-02-27
Approved revision: 3624
Merged at revision: 3626
Proposed branch: lp:~brandontschaefer/compiz/lp.1034616-fix
Merge into: lp:compiz/0.9.9
Diff against target: 30 lines (+7/-2)
2 files modified
src/privatescreen.h (+5/-0)
src/window.cpp (+2/-2)
To merge this branch: bzr merge lp:~brandontschaefer/compiz/lp.1034616-fix
Reviewer Review Type Date Requested Status
Sam Spilsbury 2013-02-27 Approve on 2013-02-27
PS Jenkins bot continuous-integration Pending
Review via email: mp+150718@code.launchpad.net

Commit message

Move CompScreenImpl::focusTopMostWindow() over to use the serverWindows list, as its more up-to-date. Now lowering a window will have an up-to-date stacking order.

(LP: #1034616)

Description of the change

=== Problem ===
focusTopMostWindow() was using the windows() lits. This list is updated by the server which means its not always as up-to-date as the serverWindows list. So when we would call lower() everything would be re-stacked but the server hadn't updated the windows() list which meant the lowered window was stilled on top. So it would just focus that window again.

=== Fix ===
Switch over to using the serverWindows list.

=== Test ===
Theres an AP test in unity that caught this problem.

To post a comment you must log in.
Sam Spilsbury (smspillaz) wrote :

As discussed, this is the correct way of doing it. Thanks.

It might be possible to throw a system test into the mix too - now that we have testhelper, we can write AP-like tests for compiz that run atop of xorg-gtest. Have a look into that if you get the chance.

review: Approve
Brandon Schaefer (brandontschaefer) wrote :

O nice, I was looking through the systems tests and couldn't find a nice place for it. Ill look into that tomorrow!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/privatescreen.h'
2--- src/privatescreen.h 2013-01-29 19:40:05 +0000
3+++ src/privatescreen.h 2013-02-27 03:32:22 +0000
4@@ -177,6 +177,11 @@
5 reverse_iterator rbegin() const { return windows.rbegin(); }
6 reverse_iterator rend() const { return windows.rend(); }
7
8+ iterator serverBegin() const { return serverWindows.begin(); }
9+ iterator serverEnd() const { return serverWindows.end(); }
10+ reverse_iterator rserverBegin() const { return serverWindows.rbegin(); }
11+ reverse_iterator rserverEnd() const { return serverWindows.rend(); }
12+
13 void clearFullscreenHints() const;
14 void showOrHideForDesktop(unsigned int desktop) const;
15 void setWindowActiveness(::compiz::private_screen::History& history) const;
16
17=== modified file 'src/window.cpp'
18--- src/window.cpp 2013-02-26 00:52:32 +0000
19+++ src/window.cpp 2013-02-27 03:32:22 +0000
20@@ -4235,9 +4235,9 @@
21 using ::compiz::private_screen::WindowManager;
22
23 CompWindow *focus = NULL;
24- WindowManager::reverse_iterator it = windowManager.rbegin ();
25+ WindowManager::reverse_iterator it = windowManager.rserverBegin ();
26
27- for (; it != windowManager.rend (); ++it)
28+ for (; it != windowManager.rserverEnd (); ++it)
29 {
30 CompWindow *w = *it;
31

Subscribers

People subscribed via source and target branches