Merge lp:~sil2100/compiz/scale_all into lp:compiz/0.9.8

Proposed by Łukasz Zemczak on 2012-06-22
Status: Merged
Approved by: Daniel van Vugt on 2012-07-02
Approved revision: 3257
Merged at revision: 3271
Proposed branch: lp:~sil2100/compiz/scale_all
Merge into: lp:compiz/0.9.8
Diff against target: 64 lines (+43/-0)
2 files modified
plugins/scale/src/privates.h (+2/-0)
plugins/scale/src/scale.cpp (+41/-0)
To merge this branch: bzr merge lp:~sil2100/compiz/scale_all
Reviewer Review Type Date Requested Status
Daniel van Vugt 2012-06-22 Approve on 2012-07-02
Review via email: mp+111570@code.launchpad.net

Commit message

Add support for initiating window picker in other than nomal mode. For now added only the additional 'All windows' picker, essentially fixing LP: #933776.
The code from the all mode comes from a patch made by Doug McMahon. Thanks!

Description of the change

Original description from the 0.9.7 MRQ:

The scale plugin has many actions defined: initiate for current workspace, for all windows, for groups and for current output device. But the scale plugin only supports one handler for all actions (the type of the action is not considered at all). For now I added a distinction between ScaleTypeAll and ScaleTypeNormal. I took the code proposed by Doug in the bug report as the code for ScaleTypeAll.

To post a comment you must log in.
Didier Roche (didrocks) wrote :

Tests are needed to enter distro

Daniel van Vugt (vanvugt) wrote :

Looks like this fixes bug 955035 too.

Daniel van Vugt (vanvugt) wrote :

OK, it works well and solves bug 933776 (and bug 955035 it seems).

Only a minor style issue in layoutThumbs() that I'll fix.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/scale/src/privates.h'
2--- plugins/scale/src/privates.h 2012-02-01 17:49:07 +0000
3+++ plugins/scale/src/privates.h 2012-06-22 10:18:21 +0000
4@@ -63,6 +63,8 @@
5 void findBestSlots ();
6 bool fillInWindows ();
7 bool layoutThumbs ();
8+ bool layoutThumbsAll ();
9+ bool layoutThumbsSingle ();
10
11 SlotArea::vector getSlotAreas ();
12
13
14=== modified file 'plugins/scale/src/scale.cpp'
15--- plugins/scale/src/scale.cpp 2012-04-01 07:34:59 +0000
16+++ plugins/scale/src/scale.cpp 2012-06-22 10:18:21 +0000
17@@ -684,6 +684,47 @@
18 bool
19 PrivateScaleScreen::layoutThumbs ()
20 {
21+ switch (type) {
22+ case ScaleTypeAll:
23+ return layoutThumbsAll ();
24+ case ScaleTypeNormal:
25+ default:
26+ return layoutThumbsSingle ();
27+ }
28+}
29+
30+bool
31+PrivateScaleScreen::layoutThumbsAll ()
32+{
33+ windows.clear ();
34+
35+ /* add windows scale list, top most window first */
36+ foreach (CompWindow *w, screen->windows ())
37+ {
38+ SCALE_WINDOW (w);
39+
40+ if (sw->priv->slot)
41+ sw->priv->adjust = true;
42+
43+ sw->priv->slot = NULL;
44+
45+ if (!sw->priv->isScaleWin ())
46+ continue;
47+
48+ windows.push_back (sw);
49+ }
50+
51+ if (windows.empty ())
52+ return false;
53+
54+ slots.resize (windows.size ());
55+
56+ return ScaleScreen::get (screen)->layoutSlotsAndAssignWindows ();
57+}
58+
59+bool
60+PrivateScaleScreen::layoutThumbsSingle ()
61+{
62 bool ret = false;
63 std::map <ScaleWindow *, ScaleSlot> slotWindows;
64 CompWindowList allWindows;

Subscribers

People subscribed via source and target branches