x: change EnterNotify event mask only for mapped windows
Saves a few ChangeWindowAttributes requests.
This commit is contained in:
parent
37e0cf8346
commit
8f4b95dccd
6
src/x.c
6
src/x.c
|
@ -729,6 +729,7 @@ void x_push_changes(Con *con) {
|
||||||
//DLOG("Disabling EnterNotify\n");
|
//DLOG("Disabling EnterNotify\n");
|
||||||
uint32_t values[1] = { XCB_NONE };
|
uint32_t values[1] = { XCB_NONE };
|
||||||
CIRCLEQ_FOREACH_REVERSE(state, &state_head, state) {
|
CIRCLEQ_FOREACH_REVERSE(state, &state_head, state) {
|
||||||
|
if (state->mapped)
|
||||||
xcb_change_window_attributes(conn, state->id, XCB_CW_EVENT_MASK, values);
|
xcb_change_window_attributes(conn, state->id, XCB_CW_EVENT_MASK, values);
|
||||||
}
|
}
|
||||||
//DLOG("Done, EnterNotify disabled\n");
|
//DLOG("Done, EnterNotify disabled\n");
|
||||||
|
@ -752,10 +753,9 @@ void x_push_changes(Con *con) {
|
||||||
state->initial = false;
|
state->initial = false;
|
||||||
}
|
}
|
||||||
//DLOG("Re-enabling EnterNotify\n");
|
//DLOG("Re-enabling EnterNotify\n");
|
||||||
CIRCLEQ_FOREACH_REVERSE(state, &state_head, state) {
|
|
||||||
values[0] = FRAME_EVENT_MASK;
|
values[0] = FRAME_EVENT_MASK;
|
||||||
if (!state->mapped)
|
CIRCLEQ_FOREACH_REVERSE(state, &state_head, state) {
|
||||||
values[0] &= ~XCB_EVENT_MASK_ENTER_WINDOW;
|
if (state->mapped)
|
||||||
xcb_change_window_attributes(conn, state->id, XCB_CW_EVENT_MASK, values);
|
xcb_change_window_attributes(conn, state->id, XCB_CW_EVENT_MASK, values);
|
||||||
}
|
}
|
||||||
//DLOG("Done, EnterNotify re-enabled\n");
|
//DLOG("Done, EnterNotify re-enabled\n");
|
||||||
|
|
Loading…
Reference in New Issue