X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=spectrwm.c;h=07c3d74057413ea64ffffded0df6d4661fa1054f;hb=cee196007501b8ef81b6713d284eef09fa929b6e;hp=7f1c9de3522e76eecb92dbf8158e8f28e17356cd;hpb=f4892b390f406ecef074333d6676b3f86227dc21;p=spectrwm.git diff --git a/spectrwm.c b/spectrwm.c index 7f1c9de..07c3d74 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -89,20 +89,17 @@ #include #include #include -#include -#include -#include -#include -#include +#include #include #include -#include +#include #include #include #include #include #include #include +#include /* local includes */ #include "version.h" @@ -259,13 +256,11 @@ volatile sig_atomic_t running = 1; volatile sig_atomic_t restart_wm = 0; int outputs = 0; /*int last_focus_event = FocusOut;*/ -int (*xerrorxlib)(Display *, XErrorEvent *); int other_wm; int ss_enabled = 0; int xrandr_support; int xrandr_eventbase; unsigned int numlockmask = 0; -Display *display; xcb_connection_t *conn; xcb_key_symbols_t *syms; @@ -2295,8 +2290,7 @@ spawn(int ws_idx, union arg *args, int close_fd) DNPRINTF(SWM_D_MISC, "spawn: %s\n", args->argv[0]); - if (display) - close(xcb_get_file_descriptor(conn)); + close(xcb_get_file_descriptor(conn)); setenv("LD_PRELOAD", SWM_LIB, 1); @@ -7118,20 +7112,6 @@ clientmessage(xcb_client_message_event_t *e) xcb_flush(conn); } -int -xerror_start(Display *d, XErrorEvent *ee) -{ - other_wm = 1; - return (-1); -} - -int -xerror(Display *d, XErrorEvent *ee) -{ - /* warnx("error: %p %p", display, ee); */ - return (-1); -} - void active_wm(void) { @@ -7628,16 +7608,9 @@ main(int argc, char *argv[]) start_argv = argv; warnx("Welcome to spectrwm V%s Build: %s", SPECTRWM_VERSION, buildstr); - if (!setlocale(LC_CTYPE, "") || !setlocale(LC_TIME, "") || - !XSupportsLocale()) + if (!setlocale(LC_CTYPE, "") || !setlocale(LC_TIME, "")) warnx("no locale support"); - if (!X_HAVE_UTF8_STRING) - warnx("no UTF-8 support"); - - if (!(display = XOpenDisplay(0))) - errx(1, "can not open display"); - /* handle some signals */ bzero(&sact, sizeof(sact)); sigemptyset(&sact.sa_mask); @@ -7652,10 +7625,11 @@ main(int argc, char *argv[]) sact.sa_flags = SA_NOCLDSTOP; sigaction(SIGCHLD, &sact, NULL); - conn = XGetXCBConnection(display); + conn = xcb_connect(NULL, NULL); if (xcb_connection_has_error(conn)) errx(1, "can not get XCB connection"); + xcb_prefetch_extension_data(conn, &xcb_randr_id); xfd = xcb_get_file_descriptor(conn); /* look for local and global conf file */