From 4b2d6e63c5b60495fe47e7de6e998cfa060614bc Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 17 Jan 2014 07:36:18 +0100 Subject: 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=, 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. --- mgaapplet | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mgaapplet') 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 $@; } -- cgit v1.2.1