mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-24 13:46:20 +00:00
fix: handle X11 connection loss gracefully
Use XSetIOErrorExitHandler on X11 to detect connection loss and disable GTK features (tray, clipboard, notifications). Signed-off-by: Michael Vetter <jubalh@iodoru.org> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Co-authored-by: Paul Fertser <fercerpav@gmail.com>
This commit is contained in:
@@ -26,6 +26,9 @@
|
||||
#include "config/preferences.h"
|
||||
#include "ui/ui.h"
|
||||
#include "ui/window_list.h"
|
||||
#ifdef HAVE_GTK
|
||||
#include "ui/tray.h"
|
||||
#endif
|
||||
#include "xmpp/xmpp.h"
|
||||
#include "xmpp/muc.h"
|
||||
|
||||
@@ -54,6 +57,11 @@ _notifier_uninit(void)
|
||||
static void
|
||||
_notify(const char* const message, int timeout, const char* const category)
|
||||
{
|
||||
#ifdef HAVE_GTK
|
||||
if (!tray_gtk_ready()) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
log_debug("Attempting notification: %s", message);
|
||||
if (notify_is_initted()) {
|
||||
log_debug("Reinitialising libnotify");
|
||||
|
||||
Reference in New Issue
Block a user