Merge lp:~donadigo/wingpanel/fix-right-click into lp:~wingpanel-devs/wingpanel/trunk

Proposed by Adam Bieńkowski
Status: Merged
Approved by: Danielle Foré
Approved revision: no longer in the source branch.
Merged at revision: 120
Proposed branch: lp:~donadigo/wingpanel/fix-right-click
Merge into: lp:~wingpanel-devs/wingpanel/trunk
Diff against target: 30 lines (+7/-3)
1 file modified
src/Services/PopoverManager.vala (+7/-3)
To merge this branch: bzr merge lp:~donadigo/wingpanel/fix-right-click
Reviewer Review Type Date Requested Status
elementary Apps team Pending
WingPanel Devs Pending
Review via email: mp+292008@code.launchpad.net

Commit message

Fixes bug #1526071: "Right click closes slingshot".

Description of the change

Fixes bug #1526071: "Right click closes slingshot".

Two diffrent events were causing indicators to close on the right click: focus_out_event and leave_notify_event.

From now on, we check if the leave event happened outside or inside the indicator and in focus_out_event we check if there's no focused window (usually the menu window).

Indicators will now stay open when you want e.g: right click on application item in Slingshot.

To post a comment you must log in.
120. By Adam Bieńkowski

Fixes bug #1526071: "Right click closes slingshot".

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Services/PopoverManager.vala'
2--- src/Services/PopoverManager.vala 2016-04-09 18:39:32 +0000
3+++ src/Services/PopoverManager.vala 2016-04-15 14:18:42 +0000
4@@ -33,12 +33,12 @@
5 widgets = new HashTable<Gtk.Widget? , Gtk.Popover? > (direct_hash, direct_equal);
6 popovers = new HashTable<Gtk.Popover? , Wingpanel.Widgets.IndicatorEntry? > (direct_hash, direct_equal);
7
8- owner.focus_out_event.connect (() => {
9+ owner.focus_out_event.connect ((e) => {
10 if (mousing) {
11 return Gdk.EVENT_PROPAGATE;
12 }
13
14- if (visible_popover != null) {
15+ if (visible_popover != null && e.window == null) {
16 hide_popover ();
17 }
18
19@@ -170,7 +170,11 @@
20 });
21
22 popover.leave_notify_event.connect ((e) => {
23- if (e.mode != Gdk.CrossingMode.NORMAL) {
24+ Gtk.Allocation allocation;
25+ popover.get_allocation (out allocation);
26+
27+ if (e.mode != Gdk.CrossingMode.NORMAL
28+ && (e.x < allocation.x || e.x > allocation.x + allocation.width) || (e.y < allocation.y || e.y > allocation.y + allocation.height)) {
29 hide_popover ();
30 }
31

Subscribers

People subscribed via source and target branches