mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-28 02:06:21 +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:
13
meson.build
13
meson.build
@@ -188,9 +188,18 @@ if get_option('notifications').enabled()
|
||||
endif
|
||||
|
||||
# GTK (for icons and clipboard)
|
||||
x11_extra_dep = []
|
||||
if get_option('icons-and-clipboard').enabled()
|
||||
gtk_dep = dependency('gtk+-3.0', version: '>= 3.24.0', required: true)
|
||||
conf_data.set('HAVE_GTK', 1)
|
||||
|
||||
x11_dep = dependency('x11', required: false)
|
||||
if x11_dep.found()
|
||||
if cc.has_function('XSetIOErrorExitHandler', dependencies: x11_dep)
|
||||
conf_data.set('HAVE_XEXITHANDLER', 1)
|
||||
x11_extra_dep = [x11_dep]
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# XScreenSaver
|
||||
@@ -330,6 +339,10 @@ if xscrnsaver_dep.length() > 0
|
||||
profanity_deps += xscrnsaver_dep
|
||||
endif
|
||||
|
||||
if x11_extra_dep.length() > 0
|
||||
profanity_deps += x11_extra_dep
|
||||
endif
|
||||
|
||||
if python_dep.found()
|
||||
profanity_deps += python_dep
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user