Merge lp:~azzar1/unity/fix-dodge-active-window into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Alex Launi
Approved revision: no longer in the source branch.
Merged at revision: 1189
Proposed branch: lp:~azzar1/unity/fix-dodge-active-window
Merge into: lp:unity
Diff against target: 26 lines (+8/-1)
1 file modified
src/Launcher.cpp (+8/-1)
To merge this branch: bzr merge lp:~azzar1/unity/fix-dodge-active-window
Reviewer Review Type Date Requested Status
Alex Launi (community) Approve
Review via email: mp+61912@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alex Launi (alexlauni) wrote :

I don't like this as a general solution, I think it's very ugly to have stuff like
...
int type_dialogs = CompWindowTypeDialogMask | CompWindowTypeModalDialogMask
                     | CompWindowTypeUtilMask;

if (window && (window->type () & type_dialogs))
...

all over the place, but this is a general compiz slop problem, and is fine for now. I'm going to add a //FIXME to add api to compiz and eventually replace this with some kind of window->IsModalDialog () call. This will get into the SRU but I'd like to see this fixed properly for O.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Launcher.cpp'
--- src/Launcher.cpp 2011-05-17 04:06:05 +0000
+++ src/Launcher.cpp 2011-05-23 06:02:30 +0000
@@ -1893,6 +1893,9 @@
1893 CompWindowList window_list = _screen->windows ();1893 CompWindowList window_list = _screen->windows ();
1894 CompWindowList::iterator it;1894 CompWindowList::iterator it;
1895 CompWindow *window = NULL;1895 CompWindow *window = NULL;
1896 CompWindow *parent = NULL;
1897 int type_dialogs = CompWindowTypeDialogMask | CompWindowTypeModalDialogMask
1898 | CompWindowTypeUtilMask;
18961899
1897 bool any = false;1900 bool any = false;
1898 bool active = false;1901 bool active = false;
@@ -1902,7 +1905,11 @@
1902 return;1905 return;
19031906
1904 window = _screen->findWindow (_screen->activeWindow ());1907 window = _screen->findWindow (_screen->activeWindow ());
1905 if (CheckIntersectWindow (window))1908
1909 if (window && (window->type () & type_dialogs))
1910 parent = _screen->findWindow (window->transientFor ());
1911
1912 if (CheckIntersectWindow (window) || CheckIntersectWindow (parent))
1906 {1913 {
1907 any = true;1914 any = true;
1908 active = true;1915 active = true;