diff options
Diffstat (limited to 'bin/net_applet')
-rwxr-xr-x | bin/net_applet | 10 |
1 files changed, 3 insertions, 7 deletions
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; |