X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=spectrwm.c;h=cdaaebce4d08e02f8fbf4176990409a7ca3aa22a;hb=644123db12a9cf597a4d4990d9d7077ebbe47061;hp=53aaba27ab2b46ab3f43fb6e5807eedec65dec74;hpb=59e91c45a7dd7ca913323f8391d8bce0d9f0769d;p=spectrwm.git diff --git a/spectrwm.c b/spectrwm.c index 53aaba2..cdaaebc 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -136,7 +136,7 @@ static const char *buildstr = SPECTRWM_VERSION; #define xcb_icccm_get_wm_transient_for_reply xcb_get_wm_transient_for_reply #endif -#define SWM_DEBUG +/*#define SWM_DEBUG*/ #ifdef SWM_DEBUG #define DPRINTF(x...) do { if (swm_debug) fprintf(stderr, x); } while (0) #define DNPRINTF(n,x...) do { if (swm_debug & n) fprintf(stderr, x); } while (0) @@ -2044,8 +2044,9 @@ void drain_enter_notify(void) { int i = 0; + XEvent cne; - while (xcb_poll_for_event(conn)) + while (XCheckMaskEvent(display, EnterWindowMask, &cne)) i++; DNPRINTF(SWM_D_EVENT, "drain_enter_notify: drained: %d\n", i); @@ -3304,7 +3305,6 @@ adjust_font(struct ws_win *win) void stack_master(struct workspace *ws, struct swm_geometry *g, int rot, int flip) { - XWindowAttributes wa; struct swm_geometry win_g, r_g = *g; struct ws_win *win, *fs_win = NULL; int i, j, s, stacks; @@ -3313,6 +3313,7 @@ stack_master(struct workspace *ws, struct swm_geometry *g, int rot, int flip) int split, colno, winno, mwin, msize, mscale; int remain, missing, v_slice, reconfigure; int bordered = 1; + xcb_get_window_attributes_reply_t *war; DNPRINTF(SWM_D_STACK, "stack_master: workspace: %d, rot: %s, " "flip: %s\n", ws->idx, YESNO(rot), YESNO(flip)); @@ -3475,9 +3476,14 @@ stack_master(struct workspace *ws, struct swm_geometry *g, int rot, int flip) update_window(win); } - if (XGetWindowAttributes(display, win->id, &wa)) - if (wa.map_state == IsUnmapped) + war = xcb_get_window_attributes_reply(conn, + xcb_get_window_attributes(conn, win->id), + NULL); + if (war) { + if (war->map_state == XCB_MAP_STATE_UNMAPPED) map_window_raised(win->id); + free(war); + } last_h = win_g.h; i++; @@ -7187,8 +7193,8 @@ propertynotify(XEvent *e) XMoveResizeWindow(display, win->id, X(win), Y(win), WIDTH(win), HEIGHT(win)); #endif - case XA_WM_CLASS: - case XA_WM_NAME: + case XCB_ATOM_WM_CLASS: + case XCB_ATOM_WM_NAME: bar_update(); break; default: @@ -7225,7 +7231,7 @@ unmapnotify(XEvent *e) SubstructureNotifyMask, &cne)) ; /* resend unmap because we ated it */ - XUnmapWindow(display, e->xunmap.window); + xcb_unmap_window(conn, e->xunmap.window); } if (focus_mode == SWM_FOCUS_DEFAULT)