diff --git a/libs/argv.c b/libs/argv.c index f71e1c1..071da18 100644 --- a/libs/argv.c +++ b/libs/argv.c @@ -64,6 +64,12 @@ void readargs(int argc, char *argv[]) { } } + if (protocol) { + if (connect_display(&state)) { + protocol = 0; + } + } + // init/read xrdb if (xresources && !protocol) { #if USEXRESOURCES diff --git a/spmenu.c b/spmenu.c index 28f8c9d..e0c1846 100644 --- a/spmenu.c +++ b/spmenu.c @@ -472,12 +472,6 @@ void handle(void) { eventloop_x11(); // function is a loop which checks X11 events and calls other functions accordingly #if USEWAYLAND } else { - if (connect_display(&state)) { - protocol = 0; - handle(); - return; - } - loadhistory(); store_image_vars();