summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2014-01-17 07:36:18 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2014-01-17 07:36:31 +0100
commit4b2d6e63c5b60495fe47e7de6e998cfa060614bc (patch)
tree682863eaf677fcc4829c111cc0c825eb4b46aab6
parent0e4725bd47c6bbe82c236e6a04e8fdf46781f3c3 (diff)
downloadmgaonline-4b2d6e63c5b60495fe47e7de6e998cfa060614bc.tar
mgaonline-4b2d6e63c5b60495fe47e7de6e998cfa060614bc.tar.gz
mgaonline-4b2d6e63c5b60495fe47e7de6e998cfa060614bc.tar.bz2
mgaonline-4b2d6e63c5b60495fe47e7de6e998cfa060614bc.tar.xz
mgaonline-4b2d6e63c5b60495fe47e7de6e998cfa060614bc.zip
workaround X11 hanging (mga#12280)
Since commit 95b9cd06f14a9817090584d72830df870c591acc, we run a gtk main loop after displaying a notification, else actions when clickong notification buttons are ignored by gtk+/libnotify However, if the notification is not manually closed, we never exit this main loop. In that case, gtk+ fails with: (mgaapplet:9060): Gtk-CRITICAL **: gtk_window_set_accept_focus: assertion 'GTK_IS_WINDOW (window)' failed from: data=<optimized out>, destroy=0x0, button=3, activate_time=5407876) at gtkmenu.c:1613 And X11 is stuck. As a workaround, since libnotify offers no way to be notified when notification is automatically closed, just add a timeout for exiting the main loop. At worse, X11 will be stuch only 5 seconds.
-rw-r--r--NEWS3
-rwxr-xr-xmgaapplet4
2 files changed, 6 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index d440b080..c601e2ac 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- workaround X11 hanging if one right click on status icon without
+ having closed the notification (mga#12280)
+
Version 3.5 - 8 January 2014, Thierry Vignaud
- delay setting SIG_CHLD handler
diff --git a/mgaapplet b/mgaapplet
index 8f928d10..44240e6a 100755
--- a/mgaapplet
+++ b/mgaapplet
@@ -690,7 +690,9 @@ sub setState {
}
$bubble->set_urgency($state{$state}{urgency}) if $state{$state}{urgency};
- $bubble->set_timeout(5000);
+ my $timeout = 5000;
+ $bubble->set_timeout($timeout);
+ Glib::Timeout->add($timeout, sub { Gtk3->main_quit; 0 });
eval { $bubble->show; Gtk3->main };
warn ">> ERR:$@" if $@;
}