1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-25 12:10:03 +00:00

x11, imlib2: early-exit in some X functions if X is not available at runtime

This commit is contained in:
bi4k8 2022-11-28 19:23:23 +00:00 committed by Brenden Matthews
parent a30cc64a98
commit 1eb88aeb43
No known key found for this signature in database
GPG Key ID: B49ABB7270D9D4FD
3 changed files with 8 additions and 0 deletions

View File

@ -140,6 +140,9 @@ struct _x11_stuff_s {
} x11_stuff;
static void X11_create_window() {
if (!window.window) {
return;
}
setup_fonts();
load_fonts(utf8_mode.get(*state));
#ifdef BUILD_XFT

View File

@ -70,6 +70,9 @@ void imlib_cache_size_setting::lua_setter(lua::state &l, bool init) {
Base::lua_setter(l, init);
if (display == nullptr || window.visual == nullptr)
return;
if (init && out_to_x.get(l)) {
image_list_start = image_list_end = nullptr;
context = imlib_context_new();

View File

@ -324,6 +324,8 @@ static Window find_desktop_window(Window *p_root, Window *p_desktop) {
int format, i;
unsigned long nitems, bytes;
unsigned int n;
if (!display)
return 0;
Window root = RootWindow(display, screen);
Window win;
Window troot, parent, *children;