Merge lp:~cando/unity/fix_dodge_active_window into lp:unity

Proposed by Stefano Candori
Status: Rejected
Rejected by: Neil J. Patel
Proposed branch: lp:~cando/unity/fix_dodge_active_window
Merge into: lp:unity
Diff against target: 37 lines (+24/-3)
1 file modified
src/Launcher.cpp (+24/-3)
To merge this branch: bzr merge lp:~cando/unity/fix_dodge_active_window
Reviewer Review Type Date Requested Status
Omer Akram (community) Disapprove
Neil J. Patel Pending
Review via email: mp+50509@code.launchpad.net

Description of the change

In this branch i've fixed bug #718185.

To post a comment you must log in.
Revision history for this message
Omer Akram (om26er) wrote :

I have build unity with this branch, the launcher does not show when a model dialog is shown *but* when that dialog is closed the launcher comes for a second and then hides.

review: Needs Fixing (functional)
Revision history for this message
Stefano Candori (cando) wrote :

Uh! It doesn't happen here...any step to reproduce???It happens with every
dialog??
By the way, i'm looking into that.

2011/2/20 Omer Akram <email address hidden>

> Review: Needs Fixing functional
> I have build unity with this branch, the launcher does not show when a
> model dialog is shown *but* when that dialog is closed the launcher comes
> for a second and then hides.
> --
>
> https://code.launchpad.net/~cando/unity/fix_dodge_active_window/+merge/50509
> You are the owner of lp:~cando/unity/fix_dodge_active_window.
>

Revision history for this message
Omer Akram (om26er) wrote :

It happens with every window it seems. modal or not. if I have two maximized windows, closing the upper(with the close button) will show the launcher for a second and then hide it while giving the focus to the lower window.

Also the launcher is hiding when on desktop too.

Revision history for this message
Stefano Candori (cando) wrote :

Ok, got it thanks. Btw this is another bug that it's strictly related to
this one. Also the desktop problem is due to another bug (a windows focus
one): if you click on the desktop (and so the desktop window becomes active)
the launcher should be shown.
I'm on these bugs right now.

2011/2/20 Omer Akram <email address hidden>

> It happens with every window it seems. modal or not. if I have two
> maximized windows, closing the upper(with the close button) will show the
> launcher for a second and then hide it while giving the focus to the lower
> window.
>
> Also the launcher is hiding when on desktop too.
> --
>
> https://code.launchpad.net/~cando/unity/fix_dodge_active_window/+merge/50509
> You are the owner of lp:~cando/unity/fix_dodge_active_window.
>

875. By Stefano Candori

Modal or dialog windows should behave as their parents (if any).

Revision history for this message
Stefano Candori (cando) wrote :

Omar, i can reproduce it *almost* never....weird.
Let's wait for what the Unity team says.

Revision history for this message
Neil J. Patel (njpatel) wrote :

Stefano, the panel's window might be getting focus before the maximised window beneath it, and hence the launcher pops out. I think it's worth checking in the launcher, before it pops out, if the active window is one of the internal unity windows, and then ignoring if that is the case.

You can get the list of internal unity windows with: nux::XInputWindow::NativeHandleList () (which is a static function that gives you a std::list<Window>.

Hope that helps!

Revision history for this message
Stefano Candori (cando) wrote :

Neil, thanks very much...i'll look into that asap!

2011/2/23 Neil J. Patel <email address hidden>

> Stefano, the panel's window might be getting focus before the maximised
> window beneath it, and hence the launcher pops out. I think it's worth
> checking in the launcher, before it pops out, if the active window is one of
> the internal unity windows, and then ignoring if that is the case.
>
> You can get the list of internal unity windows with:
> nux::XInputWindow::NativeHandleList () (which is a static function that
> gives you a std::list<Window>.
>
> Hope that helps!
> --
>
> https://code.launchpad.net/~cando/unity/fix_dodge_active_window/+merge/50509
> You are the owner of lp:~cando/unity/fix_dodge_active_window.
>

Revision history for this message
Omer Akram (om26er) wrote :

The bug linked to this branch is fixed with another commit

review: Disapprove

Unmerged revisions

875. By Stefano Candori

Modal or dialog windows should behave as their parents (if any).

874. By Stefano Candori

Fix LP:#718185 .

Don't show the launcher when a modal dialog is opened.
Let's also show the launcher when the active window is the desktop.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Launcher.cpp'
2--- src/Launcher.cpp 2011-02-18 20:54:27 +0000
3+++ src/Launcher.cpp 2011-02-20 17:15:12 +0000
4@@ -1302,9 +1302,30 @@
5 nux::Geometry geo = GetGeometry ();
6 int intersect_types = CompWindowTypeNormalMask | CompWindowTypeDialogMask |
7 CompWindowTypeModalDialogMask | CompWindowTypeUtilMask;
8-
9- if (!window || !(window->type () & intersect_types) || !window->isMapped () || !window->isViewable ())
10- return false;
11+
12+ if (!window || !window->isMapped () || !window->isViewable ())
13+ return false;
14+
15+ if (_hidemode == LAUNCHER_HIDE_DODGE_ACTIVE_WINDOW)
16+ {
17+ //let's show the launcher when the active window is the Desktop
18+ if (window->type () & CompWindowTypeDesktopMask)
19+ return false;
20+
21+ if (!(window->type () & CompWindowTypeNormalMask))
22+ {
23+ if (CompRegion (window->inputRect ()).intersects (CompRect (geo.x, geo.y, geo.width, geo.height)))
24+ return true;
25+ //if our parent doesn't intersect, we do the same.
26+ window = _screen->findWindow (window->transientFor ());
27+ return CheckIntersectWindow (window);
28+ }
29+ }
30+ else
31+ {
32+ if (!(window->type () & intersect_types))
33+ return false;
34+ }
35
36 if (CompRegion (window->inputRect ()).intersects (CompRect (geo.x, geo.y, geo.width, geo.height)))
37 return true;