Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix dumpwins().
[spectrwm.git]
/
spectrwm.c
diff --git
a/spectrwm.c
b/spectrwm.c
index
fe52b18
..
35da17e
100644
(file)
--- a/
spectrwm.c
+++ b/
spectrwm.c
@@
-628,8
+628,23
@@
void spawn_select(struct swm_region *, union arg *, char *, int *);
unsigned char *get_win_name(xcb_window_t);
xcb_atom_t get_atom_from_string(const char *);
void map_window_raised(xcb_window_t);
unsigned char *get_win_name(xcb_window_t);
xcb_atom_t get_atom_from_string(const char *);
void map_window_raised(xcb_window_t);
+void do_sync(void);
void
void
+do_sync(void)
+{
+ xcb_get_input_focus_cookie_t c;
+ xcb_get_input_focus_reply_t *r;
+
+ /* mimic XSync() */
+ c = xcb_get_input_focus(conn);
+ xcb_flush(conn);
+ r = xcb_get_input_focus_reply(conn, c, NULL);
+ if (r)
+ free(r);
+}
+
+void
map_window_raised(xcb_window_t win)
{
uint32_t val = XCB_STACK_MODE_ABOVE;
map_window_raised(xcb_window_t win)
{
uint32_t val = XCB_STACK_MODE_ABOVE;
@@
-1127,7
+1142,7
@@
dumpwins(struct swm_region *r, union arg *args)
struct ws_win *win;
uint16_t state;
xcb_get_window_attributes_cookie_t c;
struct ws_win *win;
uint16_t state;
xcb_get_window_attributes_cookie_t c;
- xcb_get_window_attributes_reply_t *r;
+ xcb_get_window_attributes_reply_t *wa;
if (r->ws == NULL) {
warnx("dumpwins: invalid workspace");
if (r->ws == NULL) {
warnx("dumpwins: invalid workspace");
@@
-1138,12
+1153,12
@@
dumpwins(struct swm_region *r, union arg *args)
TAILQ_FOREACH(win, &r->ws->winlist, entry) {
state = getstate(win->id);
c = xcb_get_window_attributes(conn, win->id);
TAILQ_FOREACH(win, &r->ws->winlist, entry) {
state = getstate(win->id);
c = xcb_get_window_attributes(conn, win->id);
- r = xcb_get_window_attributes_reply(conn, c, NULL);
- if (r) {
+ wa = xcb_get_window_attributes_reply(conn, c, NULL);
+ if (wa) {
warnx("window: 0x%x, map_state: %d, state: %u, "
warnx("window: 0x%x, map_state: %d, state: %u, "
- "transient: 0x%x", win->id, wa.map_state,
+ "transient: 0x%x", win->id, wa->map_state,
state, win->transient);
state, win->transient);
- free(r);
+ free(wa);
} else
warnx("window: 0x%x, failed xcb_get_window_attributes",
win->id);
} else
warnx("window: 0x%x, failed xcb_get_window_attributes",
win->id);
@@
-1153,14
+1168,14
@@
dumpwins(struct swm_region *r, union arg *args)
TAILQ_FOREACH(win, &r->ws->unmanagedlist, entry) {
state = getstate(win->id);
c = xcb_get_window_attributes(conn, win->id);
TAILQ_FOREACH(win, &r->ws->unmanagedlist, entry) {
state = getstate(win->id);
c = xcb_get_window_attributes(conn, win->id);
- r xcb_get_window_attributes_reply(conn, c, NULL);
- if (r) {
+ wa = xcb_get_window_attributes_reply(conn, c, NULL);
+ if (wa) {
warnx("window: 0x%lx, map_state: %d, state: %u, "
warnx("window: 0x%lx, map_state: %d, state: %u, "
- "transient: 0x%lx", win->id, wa.map_state,
+ "transient: 0x%lx", win->id, wa->map_state,
state, win->transient);
state, win->transient);
- free(r);
+ free(wa);
} else
} else
- warnx("window: 0x%lx, failed XGetWindowAttributes",
+ warnx("window: 0x%x, failed xcb_get_window_attributes",
win->id);
}
win->id);
}
@@
-4386,14
+4401,14
@@
resize(struct ws_win *win, union arg *args)
/* not free, don't sync more than 120 times / second */
if ((ev.xmotion.time - time) > (1000 / 120) ) {
time = ev.xmotion.time;
/* not free, don't sync more than 120 times / second */
if ((ev.xmotion.time - time) > (1000 / 120) ) {
time = ev.xmotion.time;
- XSync(display, False);
+ do_sync();
update_window(win);
}
break;
}
} while (ev.type != ButtonRelease);
if (time) {
update_window(win);
}
break;
}
} while (ev.type != ButtonRelease);
if (time) {
- XSync(display, False);
+ do_sync();
update_window(win);
}
store_float_geom(win,r);
update_window(win);
}
store_float_geom(win,r);
@@
-4512,14
+4527,14
@@
move(struct ws_win *win, union arg *args)
/* not free, don't sync more than 120 times / second */
if ((ev.xmotion.time - time) > (1000 / 120) ) {
time = ev.xmotion.time;
/* not free, don't sync more than 120 times / second */
if ((ev.xmotion.time - time) > (1000 / 120) ) {
time = ev.xmotion.time;
- XSync(display, False);
+ do_sync();
update_window(win);
}
break;
}
} while (ev.type != ButtonRelease);
if (time) {
update_window(win);
}
break;
}
} while (ev.type != ButtonRelease);
if (time) {
- XSync(display, False);
+ do_sync();
update_window(win);
}
store_float_geom(win, r);
update_window(win);
}
store_float_geom(win, r);
@@
-7186,12
+7201,12
@@
active_wm(void)
/* this causes an error if some other window manager is running */
XSelectInput(display, DefaultRootWindow(display),
SubstructureRedirectMask);
/* this causes an error if some other window manager is running */
XSelectInput(display, DefaultRootWindow(display),
SubstructureRedirectMask);
- XSync(display, False);
+ do_sync();
if (other_wm)
return (1);
XSetErrorHandler(xerror);
if (other_wm)
return (1);
XSetErrorHandler(xerror);
- XSync(display, False);
+ do_sync();
return (0);
}
return (0);
}