diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2017-07-31 23:20:08 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2017-07-31 23:20:08 +0200 |
commit | 64eabe363865cdc3aa3a0779148e1d7f431f773b (patch) | |
tree | 6bdbdb301fff796d61931200e8e24bae99cc117c | |
parent | 31a2564004ade9c253d74beb07d7bc25e096b143 (diff) | |
download | drakx-net-64eabe363865cdc3aa3a0779148e1d7f431f773b.tar drakx-net-64eabe363865cdc3aa3a0779148e1d7f431f773b.tar.gz drakx-net-64eabe363865cdc3aa3a0779148e1d7f431f773b.tar.bz2 drakx-net-64eabe363865cdc3aa3a0779148e1d7f431f773b.tar.xz drakx-net-64eabe363865cdc3aa3a0779148e1d7f431f773b.zip |
Make sure to unset the context menu before destroying it
-rw-r--r-- | NEWS | 3 | ||||
-rwxr-xr-x | bin/net_applet | 10 |
2 files changed, 6 insertions, 7 deletions
@@ -1,3 +1,6 @@ +- net_applet: + o fix the context menu + 2.32 - drakfirewall o adapt to new samba package name (mga#20584) diff --git a/bin/net_applet b/bin/net_applet index 4732e9c..74569ec 100755 --- a/bin/net_applet +++ b/bin/net_applet @@ -242,11 +242,6 @@ if ($ENV{DESKTOP_SESSION} =~ /plasma$/i) { $icon->set_title('net_applet'); $icon->set_status('STATUS_NOTIFIER_STATUS_ACTIVE'); $icon->register; - # We keep this only as a fallback if the DBusMenu service does not work. - # This way, we are sure that right-clicks will always work. (mga#20410) - $icon->signal_connect(context_menu => sub { - $menu->popup(undef, undef, undef, undef, 0, Gtk3::get_current_event_time()) if $menu; - }); } else { $icon = Gtk3::StatusIcon->new; @@ -313,8 +308,7 @@ $SIG{USR1} = sub { # seems to be some latency with DBus and/or DBusMenu, and when this method # is called too early, it seems to be blocked. So we add a timer here to call # it again to make sure that right-click events will be correctly handled by -# DBusMenu. If the registration fails again, then the 'context_menu' signal -# will be emitted and caught above (mga#20410). +# DBusMenu. Glib::Timeout->add(100, sub { $icon->set_context_menu($menu); 0 }) if $is_plasma; # do not create zombies (#20552) @@ -564,6 +558,8 @@ sub get_wireless_networks_sorted() { sub generate_menu() { delete $_->{menuitems} foreach values %wireless_networks; + # Unset the context menu before destroying it. + $icon->set_context_menu() if $is_plasma; $menu->destroy if $menu; $menu = Gtk3::Menu->new; |