X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=spectrwm.c;h=ab82ff1bb75ebb8bc20827827d3fdba9062cadb7;hb=f6733e1aa641ae84bb9b76267a7adde30a7f71bc;hp=e54a743c59e953d4c11942512f132962b245ec3a;hpb=a28e0d1b2fcfbc6f93c0888c0f5781d0cb5417bd;p=spectrwm.git diff --git a/spectrwm.c b/spectrwm.c index e54a743..ab82ff1 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" @@ -359,12 +356,6 @@ XFontSetExtents *bar_fs_extents; char *bar_fonts; struct passwd *pwd; -#define SWM_MENU_FN (2) -#define SWM_MENU_NB (4) -#define SWM_MENU_NF (6) -#define SWM_MENU_SB (8) -#define SWM_MENU_SF (10) - /* layout manager data */ struct swm_geometry { int x; @@ -1281,12 +1272,12 @@ plain_stacker(struct workspace *ws) void custom_region(char *val) { - unsigned int sidx, x, y, w, h; - int num_screens; + unsigned int x, y, w, h; + int sidx, num_screens; xcb_screen_t *screen; num_screens = xcb_setup_roots_length(xcb_get_setup(conn)); - if (sscanf(val, "screen[%u]:%ux%u+%u+%u", &sidx, &w, &h, &x, &y) != 5) + if (sscanf(val, "screen[%d]:%ux%u+%u+%u", &sidx, &w, &h, &x, &y) != 5) errx(1, "invalid custom region, " "should be 'screen[]:x++"); if (sidx < 1 || sidx > num_screens) @@ -5484,8 +5475,8 @@ updatenumlockmask(void) void grabkeys(void) { - int num_screens; - unsigned int j, k; + int num_screens, k; + unsigned int j; xcb_keycode_t *code; unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask | LockMask }; @@ -6341,7 +6332,7 @@ manage_window(xcb_window_t id) xcb_window_t trans = XCB_WINDOW_NONE; struct workspace *ws; struct ws_win *win, *ww; - int i, ws_idx, border_me = 0; + int ws_idx, border_me = 0; xcb_atom_t ws_idx_atom = XCB_ATOM_NONE; char ws_idx_str[SWM_PROPLEN], *prop = NULL; size_t proplen; @@ -6349,7 +6340,7 @@ manage_window(xcb_window_t id) const char *errstr; struct pid_e *p; struct quirk *qp; - uint32_t event_mask; + uint32_t event_mask, i; xcb_atom_t prot; xcb_get_property_reply_t *gpr; xcb_icccm_get_wm_protocols_reply_t wpr; @@ -6746,7 +6737,8 @@ void buttonpress(xcb_button_press_event_t *e) { struct ws_win *win; - int i, action; + int i; + unsigned int action; DNPRINTF(SWM_D_EVENT, "buttonpress: window 0x%x, detail: %u\n", e->event, e->detail); @@ -7115,20 +7107,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) { @@ -7625,13 +7603,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"); - /* handle some signals */ bzero(&sact, sizeof(sact)); sigemptyset(&sact.sa_mask); @@ -7650,6 +7624,7 @@ main(int argc, char *argv[]) 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 */