summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2017-07-31 23:20:08 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2017-07-31 23:20:08 +0200
commit64eabe363865cdc3aa3a0779148e1d7f431f773b (patch)
tree6bdbdb301fff796d61931200e8e24bae99cc117c /bin
parent31a2564004ade9c253d74beb07d7bc25e096b143 (diff)
downloaddrakx-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
Diffstat (limited to 'bin')
-rwxr-xr-xbin/net_applet10
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;