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
Add a few more xcb_flush().
[spectrwm.git]
/
spectrwm.c
diff --git
a/spectrwm.c
b/spectrwm.c
index
0ddc31a
..
313b4ce
100644
(file)
--- a/
spectrwm.c
+++ b/
spectrwm.c
@@
-425,7
+425,7
@@
TAILQ_HEAD(ws_win_list, ws_win);
/* pid goo */
struct pid_e {
TAILQ_ENTRY(pid_e) entry;
/* pid goo */
struct pid_e {
TAILQ_ENTRY(pid_e) entry;
- long pid;
+ pid_t pid;
int ws;
};
TAILQ_HEAD(pid_list, pid_e);
int ws;
};
TAILQ_HEAD(pid_list, pid_e);
@@
-856,7
+856,7
@@
ewmh_autoquirk(struct ws_win *win)
n = xcb_get_property_value_length(r);
type = xcb_get_property_value(r);
n = xcb_get_property_value_length(r);
type = xcb_get_property_value(r);
-
+
for (i = 0; i < n; i++) {
if (type[i] == ewmh[_NET_WM_WINDOW_TYPE_NORMAL].atom)
break;
for (i = 0; i < n; i++) {
if (type[i] == ewmh[_NET_WM_WINDOW_TYPE_NORMAL].atom)
break;
@@
-1032,7
+1032,7
@@
ewmh_get_win_state(struct ws_win *win)
win->ewmh_flags |= SWM_F_MANUAL;
c = xcb_get_property(conn, False, win->id, ewmh[_NET_WM_STATE].atom,
win->ewmh_flags |= SWM_F_MANUAL;
c = xcb_get_property(conn, False, win->id, ewmh[_NET_WM_STATE].atom,
- XCB_ATOM_ATOM, 0, (~0L));
+ XCB_ATOM_ATOM, 0, UINT32_MAX);
r = xcb_get_property_reply(conn, c, NULL);
if (!r)
return;
r = xcb_get_property_reply(conn, c, NULL);
if (!r)
return;
@@
-1166,11
+1166,11
@@
sighdlr(int sig)
}
struct pid_e *
}
struct pid_e *
-find_pid(long pid)
+find_pid(pid_t pid)
{
struct pid_e *p = NULL;
{
struct pid_e *p = NULL;
- DNPRINTF(SWM_D_MISC, "find_pid: %lu\n", pid);
+ DNPRINTF(SWM_D_MISC, "find_pid: %d\n", pid);
if (pid == 0)
return (NULL);
if (pid == 0)
return (NULL);
@@
-3716,6
+3716,7
@@
uniconify(struct swm_region *r, union arg *args)
}
fclose(lfile);
}
fclose(lfile);
+
xcb_flush(conn);
}
xcb_flush(conn);
}
@@
-5908,7
+5909,7
@@
setautorun(char *selector, char *value, int flags)
char *ap, *sp = s;
union arg a;
int argc = 0;
char *ap, *sp = s;
union arg a;
int argc = 0;
- long pid;
+ pid_t pid;
struct pid_e *p;
if (getenv("SWM_STARTED"))
struct pid_e *p;
if (getenv("SWM_STARTED"))
@@
-6249,10
+6250,10
@@
set_child_transient(struct ws_win *win, xcb_window_t *trans)
}
}
}
}
-long
+pid_t
window_get_pid(xcb_window_t win)
{
window_get_pid(xcb_window_t win)
{
- long ret = 0;
+ pid_t ret = 0;
const char *errstr;
xcb_atom_t apid;
xcb_get_property_cookie_t pc;
const char *errstr;
xcb_atom_t apid;
xcb_get_property_cookie_t pc;
@@
-6266,10
+6267,12
@@
window_get_pid(xcb_window_t win)
pr = xcb_get_property_reply(conn, pc, NULL);
if (!pr)
goto tryharder;
pr = xcb_get_property_reply(conn, pc, NULL);
if (!pr)
goto tryharder;
- if (pr->type != XCB_ATOM_CARDINAL)
+ if (pr->type != XCB_ATOM_CARDINAL) {
+ free(pr);
goto tryharder;
goto tryharder;
+ }
- ret = *(long *)xcb_get_property_value(pr);
+ ret = *((pid_t *)xcb_get_property_value(pr));
free(pr);
return (ret);
free(pr);
return (ret);
@@
-6281,10
+6284,12
@@
tryharder:
pr = xcb_get_property_reply(conn, pc, NULL);
if (!pr)
return (0);
pr = xcb_get_property_reply(conn, pc, NULL);
if (!pr)
return (0);
- if (pr->type != XCB_ATOM_STRING)
+ if (pr->type != XCB_ATOM_STRING) {
free(pr);
return (0);
free(pr);
return (0);
- ret = strtonum(xcb_get_property_value(pr), 0, UINT_MAX, &errstr);
+ }
+
+ ret = strtonum(xcb_get_property_value(pr), 0, INT_MAX, &errstr);
free(pr);
return (ret);
free(pr);
return (ret);
@@
-6718,6
+6723,8
@@
buttonpress(xcb_button_press_event_t *e)
buttons[i].button == e->detail &&
CLEANMASK(buttons[i].mask) == CLEANMASK(e->state))
buttons[i].func(win, &buttons[i].args);
buttons[i].button == e->detail &&
CLEANMASK(buttons[i].mask) == CLEANMASK(e->state))
buttons[i].func(win, &buttons[i].args);
+
+ xcb_flush(conn);
}
void
}
void
@@
-6786,6
+6793,8
@@
configurerequest(xcb_configure_request_event_t *e)
} else {
config_win(win, e);
}
} else {
config_win(win, e);
}
+
+ xcb_flush(conn);
}
void
}
void
@@
-6932,6
+6941,8
@@
enternotify(xcb_enter_notify_event_t *e)
}
focus_magic(win);
}
focus_magic(win);
+
+ xcb_flush(conn);
}
/* lets us use one switch statement for arbitrary mode/detail combinations */
}
/* lets us use one switch statement for arbitrary mode/detail combinations */
@@
-7148,6
+7159,8
@@
clientmessage(xcb_client_message_event_t *e)
stack();
}
stack();
}
+
+ xcb_flush(conn);
}
int
}
int
@@
-7642,10
+7655,8
@@
main(int argc, char *argv[])
int xfd, i, num_screens;
struct sigaction sact;
xcb_generic_event_t *evt;
int xfd, i, num_screens;
struct sigaction sact;
xcb_generic_event_t *evt;
-#if 0
struct timeval tv;
fd_set rd;
struct timeval tv;
fd_set rd;
-#endif
time_started = time(NULL);
time_started = time(NULL);
@@
-7814,7
+7825,6
@@
noconfig:
continue;
}
continue;
}
-#if 0
FD_ZERO(&rd);
FD_SET(xfd, &rd);
tv.tv_sec = 1;
FD_ZERO(&rd);
FD_SET(xfd, &rd);
tv.tv_sec = 1;
@@
-7822,7
+7832,6
@@
noconfig:
if (select(xfd + 1, &rd, NULL, NULL, &tv) == -1)
if (errno != EINTR)
DNPRINTF(SWM_D_MISC, "select failed");
if (select(xfd + 1, &rd, NULL, NULL, &tv) == -1)
if (errno != EINTR)
DNPRINTF(SWM_D_MISC, "select failed");
-#endif
if (restart_wm == 1)
restart(NULL, NULL);
if (search_resp == 1)
if (restart_wm == 1)
restart(NULL, NULL);
if (search_resp == 1)