Merge lp://staging/~davidmhewitt/wingpanel/fix-focus into lp://staging/~wingpanel-devs/wingpanel/trunk

Proposed by David Hewitt
Status: Merged
Approved by: Danielle Foré
Approved revision: 175
Merged at revision: 176
Proposed branch: lp://staging/~davidmhewitt/wingpanel/fix-focus
Merge into: lp://staging/~wingpanel-devs/wingpanel/trunk
Diff against target: 40 lines (+1/-11)
2 files modified
src/Services/PopoverManager.vala (+0/-10)
src/Widgets/IndicatorEntry.vala (+1/-1)
To merge this branch: bzr merge lp://staging/~davidmhewitt/wingpanel/fix-focus
Reviewer Review Type Date Requested Status
Danielle Foré Approve
Review via email: mp+320544@code.staging.launchpad.net

Commit message

IndicatorEntry.vala:
* Prevent middle click events on indicators from being propagated to anywhere but the indicator itself.
PopoverManager.vala:
* Don't call set_expanded when mousing in/out of wingpanel, only necessary when opening/closing the popover

Description of the change

There were two problems here that prevented a dialog opened by middle-clicking an indicator from getting focus.

The first was that the set_expanded method was called when the mouse moved in and out of the bound of wingpanel. As far as I can tell, this should only be called when a popover is opened as it looks like it expands/contracts the area that the popover should fit into. Calling it when the mouse left wingpanel was causing wingpanel to activate the window that was activated when the mouse entered wingpanel.

Because the middle click happened between these two events, the wrong window was being focused.

The second issue was that middle click events were also being propagated elsewhere instead of just to the indicator, I believe this was causing gala to give focus to the indicator itself rather than the dialog, meaning you had to click once in the dialog to focus it and then again to perform your action.

I've tested this quite comprehensively and haven't noticed any difference in the way anything works, so I think it is safe to merge this code. However, it would be good to know the reasoning for why it was developed this way in the first place.

A branch of the session indicator that spawns a dialog on middle-clicking the indicator can be found here for testing: https://github.com/elementary/wingpanel-indicator-session/tree/middle-click-shortcut

To post a comment you must log in.
Revision history for this message
Djax (parnold-x) wrote :

Hi, the expand on enter was necessary because of some timing thing inside gtk. Often when a popover expanded right after the window expand, it opened to the top and the popover could not be seen right. Maybe they changed the timing stuff, dunno I have not monitored the development lately.

Revision history for this message
David Hewitt (davidmhewitt) wrote :

Thanks, do you have any hints as to where I should look to see if this has changed?

Revision history for this message
Djax (parnold-x) wrote :

Not really. If it doesn't appear if you open/close a popover fast many times it should be fine. If I remember right it happend quite often in this case.

Revision history for this message
David Hewitt (davidmhewitt) wrote :

Can open/close popovers really fast with the enter/leave code removed, so I'm definitely not seeing that issue. It would be nice if a few more people could test it in case it's related to hardware speed or something strange like that.

175. By David Hewitt

Merged trunk

Revision history for this message
Danielle Foré (danrabbit) wrote :

Been running the branch the past couple days and haven't experienced any issues yet :)

Revision history for this message
David Hewitt (davidmhewitt) wrote :

Tested in a virtual machine to emulate much slower hardware and works fine too!

Revision history for this message
Danielle Foré (danrabbit) wrote :

Going to merge since nobody has had any issues with this yet. Will get wider testing in Daily

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: