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
=== modified file 'src/Services/PopoverManager.vala'
--- src/Services/PopoverManager.vala 2016-04-09 18:39:32 +0000
+++ src/Services/PopoverManager.vala 2016-04-15 14:18:42 +0000
@@ -33,12 +33,12 @@
33 widgets = new HashTable<Gtk.Widget? , Gtk.Popover? > (direct_hash, direct_equal);33 widgets = new HashTable<Gtk.Widget? , Gtk.Popover? > (direct_hash, direct_equal);
34 popovers = new HashTable<Gtk.Popover? , Wingpanel.Widgets.IndicatorEntry? > (direct_hash, direct_equal);34 popovers = new HashTable<Gtk.Popover? , Wingpanel.Widgets.IndicatorEntry? > (direct_hash, direct_equal);
3535
36 owner.focus_out_event.connect (() => {36 owner.focus_out_event.connect ((e) => {
37 if (mousing) {37 if (mousing) {
38 return Gdk.EVENT_PROPAGATE;38 return Gdk.EVENT_PROPAGATE;
39 }39 }
4040
41 if (visible_popover != null) {41 if (visible_popover != null && e.window == null) {
42 hide_popover ();42 hide_popover ();
43 }43 }
4444
@@ -170,7 +170,11 @@
170 });170 });
171171
172 popover.leave_notify_event.connect ((e) => {172 popover.leave_notify_event.connect ((e) => {
173 if (e.mode != Gdk.CrossingMode.NORMAL) {173 Gtk.Allocation allocation;
174 popover.get_allocation (out allocation);
175
176 if (e.mode != Gdk.CrossingMode.NORMAL
177 && (e.x < allocation.x || e.x > allocation.x + allocation.width) || (e.y < allocation.y || e.y > allocation.y + allocation.height)) {
174 hide_popover ();178 hide_popover ();
175 }179 }
176180

Subscribers

People subscribed via source and target branches