Merge lp:~dcolascione/compiz/compiz into lp:compiz/0.9.11

Proposed by Daniel Colascione
Status: Work in progress
Proposed branch: lp:~dcolascione/compiz/compiz
Merge into: lp:compiz/0.9.11
Diff against target: 64 lines (+24/-1)
3 files modified
plugins/staticswitcher/src/staticswitcher.cpp (+17/-1)
plugins/staticswitcher/src/staticswitcher.h (+2/-0)
plugins/staticswitcher/staticswitcher.xml.in (+5/-0)
To merge this branch: bzr merge lp:~dcolascione/compiz/compiz
Reviewer Review Type Date Requested Status
Christopher Townsend (community) Needs Information
MC Return Approve
Review via email: mp+219112@code.launchpad.net

Description of the change

This change allows users to configure staticswitcher to put minimized windows at the end of the list, behind other windows.

To post a comment you must log in.
Revision history for this message
MC Return (mc-return) wrote :

Hi Daniel.

Thanks for this branch - works perfectly.

Just two suggestions:

Could you please make compareWindowsMinimizedAfter () a member function of BaseSwitchScreen in compiztoolbox, instead of making it available for StaticSwitchScreen only ?

Then the other Compiz switchers could utilize it as well without any additional code duplication...

Other than that it looks good, except for some minor whitespace and indentation inconsistencies, which are not so important to fix though, as a consistent style throughout the Compiz codebase is not available anyway...
But theoretically there should be a whitespace between functionname and bracket and 8 whitespaces should be represented by tabs - maybe you want to adjust that in your update also...

Greetinx && thanx 4 your contribution to Compiz !

P.S.: Please also set a commit message above, otherwise this won't merge...

review: Approve
Revision history for this message
Christopher Townsend (townsend) wrote :

Along with what MC Return said, please link this to a specific bug.

Thanks!

review: Needs Information
Revision history for this message
Daniel Colascione (dcolascione) wrote :

Thanks for the review. How exactly do I get it into tree after making
the mentioned changes?

On 05/11/2014 03:39 AM, MC Return wrote:
> Review: Approve
>
> Hi Daniel.
>
> Thanks for this branch - works perfectly.
>
> Just two suggestions:
>
> Could you please make compareWindowsMinimizedAfter () a member function of BaseSwitchScreen in compiztoolbox, instead of making it available for StaticSwitchScreen only ?

The reason I put it in StaticSwitchScreen was so that I could run a
custom staticswitcher.so against the default compiz, but putting it in
the base class should be fine for upstream.

>
> Then the other Compiz switchers could utilize it as well without any additional code duplication...
>
> Other than that it looks good, except for some minor whitespace and indentation inconsistencies, which are not so important to fix though, as a consistent style throughout the Compiz codebase is not available anyway...
> But theoretically there should be a whitespace between functionname and bracket and 8 whitespaces should be represented by tabs - maybe you want to adjust that in your update also...

Sure. Might want to add a .dir-locals.el so that Emacs uses these
settings by default.

>
> Greetinx && thanx 4 your contribution to Compiz !
>
> P.S.: Please also set a commit message above, otherwise this won't merge...
>

Revision history for this message
Christopher Townsend (townsend) wrote :

Hi Daniel,

A couple of things in order to get this merged into trunk.

1) Need a commit message for this merge proposal. I can do that, so not a big deal.
2) Need a bug linked to this merge proposal. If you can point to the bug in Launchpad that this is fixing, I can link the bug for it.
3) If you are going to move compareWindowsMinimizedAfter () to the BaseSwitchScreen class and fix the formatting issues, please do that and push the changes to this branch.

I'm moving this merge proposal to Work In Progress pending your feedback. Once this is done, then move it back to "Needs review". We'll then re-review and if all good, we'll approve and then it will be queued up to be merged in.

Thanks for your contribution!

Unmerged revisions

3861. By Daniel Colascione

Add option for keeping minimized windows out of the way

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/staticswitcher/src/staticswitcher.cpp'
2--- plugins/staticswitcher/src/staticswitcher.cpp 2013-06-11 04:45:57 +0000
3+++ plugins/staticswitcher/src/staticswitcher.cpp 2014-05-11 02:58:09 +0000
4@@ -127,6 +127,19 @@
5 updatePopupWindow ();
6 }
7
8+bool
9+StaticSwitchScreen::compareWindowsMinimizedAfter (CompWindow *w1,
10+ CompWindow *w2)
11+{
12+ if (!w1->minimized() && w2->minimized())
13+ return true;
14+
15+ if (w1->minimized() && !w2->minimized())
16+ return false;
17+
18+ return BaseSwitchScreen::compareWindows(w1, w2);
19+}
20+
21 void
22 StaticSwitchScreen::createWindowList ()
23 {
24@@ -144,7 +157,10 @@
25 }
26 }
27
28- windows.sort (BaseSwitchScreen::compareWindows);
29+ if (optionGetMinimizedAfter())
30+ windows.sort (StaticSwitchScreen::compareWindowsMinimizedAfter);
31+ else
32+ windows.sort (BaseSwitchScreen::compareWindows);
33
34 updateWindowList ();
35 }
36
37=== modified file 'plugins/staticswitcher/src/staticswitcher.h'
38--- plugins/staticswitcher/src/staticswitcher.h 2013-05-12 08:24:06 +0000
39+++ plugins/staticswitcher/src/staticswitcher.h 2014-05-11 02:58:09 +0000
40@@ -92,6 +92,8 @@
41 void getMinimizedAndMatch (bool &minimizedOption,
42 CompMatch *&match);
43 bool getMipmap ();
44+ static bool compareWindowsMinimizedAfter (CompWindow *w1,
45+ CompWindow *w2);
46
47 Window lastActiveWindow;
48
49
50=== modified file 'plugins/staticswitcher/staticswitcher.xml.in'
51--- plugins/staticswitcher/staticswitcher.xml.in 2012-10-15 10:31:51 +0000
52+++ plugins/staticswitcher/staticswitcher.xml.in 2014-05-11 02:58:09 +0000
53@@ -137,6 +137,11 @@
54 <_long>Show minimized windows</_long>
55 <default>true</default>
56 </option>
57+ <option name="minimized_after" type="bool">
58+ <_short>Show Minimized After Others</_short>
59+ <_long>Show minimized windows after other windows</_long>
60+ <default>false</default>
61+ </option>
62 <option name="auto_change_vp" type="bool">
63 <_short>Auto Change Viewport</_short>
64 <_long>Change to the viewport of the selected window while switching</_long>

Subscribers

People subscribed via source and target branches