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

Proposed by Brandon Schaefer
Status: Merged
Approved by: Sam Spilsbury
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 Approve
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.
Revision history for this message
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
Revision history for this message
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
=== modified file 'src/privatescreen.h'
--- src/privatescreen.h 2013-01-29 19:40:05 +0000
+++ src/privatescreen.h 2013-02-27 03:32:22 +0000
@@ -177,6 +177,11 @@
177 reverse_iterator rbegin() const { return windows.rbegin(); }177 reverse_iterator rbegin() const { return windows.rbegin(); }
178 reverse_iterator rend() const { return windows.rend(); }178 reverse_iterator rend() const { return windows.rend(); }
179179
180 iterator serverBegin() const { return serverWindows.begin(); }
181 iterator serverEnd() const { return serverWindows.end(); }
182 reverse_iterator rserverBegin() const { return serverWindows.rbegin(); }
183 reverse_iterator rserverEnd() const { return serverWindows.rend(); }
184
180 void clearFullscreenHints() const;185 void clearFullscreenHints() const;
181 void showOrHideForDesktop(unsigned int desktop) const;186 void showOrHideForDesktop(unsigned int desktop) const;
182 void setWindowActiveness(::compiz::private_screen::History& history) const;187 void setWindowActiveness(::compiz::private_screen::History& history) const;
183188
=== modified file 'src/window.cpp'
--- src/window.cpp 2013-02-26 00:52:32 +0000
+++ src/window.cpp 2013-02-27 03:32:22 +0000
@@ -4235,9 +4235,9 @@
4235 using ::compiz::private_screen::WindowManager;4235 using ::compiz::private_screen::WindowManager;
42364236
4237 CompWindow *focus = NULL;4237 CompWindow *focus = NULL;
4238 WindowManager::reverse_iterator it = windowManager.rbegin ();4238 WindowManager::reverse_iterator it = windowManager.rserverBegin ();
42394239
4240 for (; it != windowManager.rend (); ++it)4240 for (; it != windowManager.rserverEnd (); ++it)
4241 {4241 {
4242 CompWindow *w = *it;4242 CompWindow *w = *it;
42434243

Subscribers

People subscribed via source and target branches