X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=spectrwm.c;h=3367c2a79b1ab11d37884d23eca1cba4a32d93e2;hb=ee9d31bb5d0018e86b8db6a48931bcc8ef050e70;hp=f7ed89b080f038f40770c073a9e2f8f1db3d5b82;hpb=f8a013da2a1675472ed4eb46c1f5b0cb0acde153;p=spectrwm.git diff --git a/spectrwm.c b/spectrwm.c index f7ed89b..3367c2a 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -2724,7 +2724,8 @@ cyclescr(struct swm_region *r, union arg *args) /* move mouse to region */ x = X(rr) + 1; y = Y(rr) + 1 + (bar_enabled ? bar_height : 0); - XWarpPointer(display, None, rr->s[i].root, 0, 0, 0, 0, x, y); + xcb_warp_pointer(conn, XCB_WINDOW_NONE, rr->s[i].root, 0, 0, 0, 0, + x, y); a.id = SWM_ARG_ID_FOCUSCUR; focus(rr, &a); @@ -2733,7 +2734,8 @@ cyclescr(struct swm_region *r, union arg *args) /* move to focus window */ x = X(rr->ws->focus) + 1; y = Y(rr->ws->focus) + 1; - XWarpPointer(display, None, rr->s[i].root, 0, 0, 0, 0, x, y); + xcb_warp_pointer(conn, XCB_WINDOW_NONE, rr->s[i].root, 0, 0, 0, + 0, x, y); } } @@ -3221,7 +3223,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; @@ -3230,6 +3231,8 @@ 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_cookie_t wac; + 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)); @@ -3392,10 +3395,13 @@ 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) + wac = xcb_get_window_attributes(conn, win->id); + war = xcb_get_window_attributes_reply(conn, wac, NULL); + if (war) { + if (war->map_state == XCB_MAP_STATE_UNMAPPED) map_window_raised(win->id); - + free(war); + } last_h = win_g.h; i++; j++; @@ -7709,9 +7715,9 @@ noconfig: } /* move pointer to first screen if multi screen */ if (num_screens > 1 || outputs > 1) - XWarpPointer(display, None, rr->s[0].root, - 0, 0, 0, 0, X(rr), - Y(rr) + (bar_enabled ? bar_height : 0)); + xcb_warp_pointer(conn, XCB_WINDOW_NONE, + rr->s[0].root, 0, 0, 0, 0, X(rr), + Y(rr) + (bar_enabled ? bar_height : 0)); a.id = SWM_ARG_ID_FOCUSCUR; focus(rr, &a);