Bugfix: configure windows before mapping, correctly store window_rect instead of rect
This commit is contained in:
parent
3f3fa08b15
commit
d47a1edf22
38
src/x.c
38
src/x.c
|
@ -435,6 +435,25 @@ static void x_push_node(Con *con) {
|
|||
con, con->window->id, con->ignore_unmap);
|
||||
}
|
||||
|
||||
bool fake_notify = false;
|
||||
/* set new position if rect changed */
|
||||
if (memcmp(&(state->rect), &rect, sizeof(Rect)) != 0) {
|
||||
LOG("setting rect (%d, %d, %d, %d)\n", rect.x, rect.y, rect.width, rect.height);
|
||||
xcb_set_window_rect(conn, con->frame, rect);
|
||||
memcpy(&(state->rect), &rect, sizeof(Rect));
|
||||
fake_notify = true;
|
||||
}
|
||||
|
||||
/* dito, but for child windows */
|
||||
if (con->window != NULL &&
|
||||
memcmp(&(state->window_rect), &(con->window_rect), sizeof(Rect)) != 0) {
|
||||
LOG("setting window rect (%d, %d, %d, %d)\n",
|
||||
con->window_rect.x, con->window_rect.y, con->window_rect.width, con->window_rect.height);
|
||||
xcb_set_window_rect(conn, con->window->id, con->window_rect);
|
||||
memcpy(&(state->window_rect), &(con->window_rect), sizeof(Rect));
|
||||
fake_notify = true;
|
||||
}
|
||||
|
||||
/* map/unmap if map state changed, also ensure that the child window
|
||||
* is changed if we are mapped *and* in initial state (meaning the
|
||||
* container was empty before, but now got a child) */
|
||||
|
@ -483,25 +502,6 @@ static void x_push_node(Con *con) {
|
|||
state->mapped = con->mapped;
|
||||
}
|
||||
|
||||
bool fake_notify = false;
|
||||
/* set new position if rect changed */
|
||||
if (memcmp(&(state->rect), &rect, sizeof(Rect)) != 0) {
|
||||
LOG("setting rect (%d, %d, %d, %d)\n", rect.x, rect.y, rect.width, rect.height);
|
||||
xcb_set_window_rect(conn, con->frame, rect);
|
||||
memcpy(&(state->rect), &rect, sizeof(Rect));
|
||||
fake_notify = true;
|
||||
}
|
||||
|
||||
/* dito, but for child windows */
|
||||
if (con->window != NULL &&
|
||||
memcmp(&(state->window_rect), &(con->window_rect), sizeof(Rect)) != 0) {
|
||||
LOG("setting window rect (%d, %d, %d, %d)\n",
|
||||
con->window_rect.x, con->window_rect.y, con->window_rect.width, con->window_rect.height);
|
||||
xcb_set_window_rect(conn, con->window->id, con->window_rect);
|
||||
memcpy(&(state->rect), &(con->rect), sizeof(Rect));
|
||||
fake_notify = true;
|
||||
}
|
||||
|
||||
if (fake_notify) {
|
||||
LOG("Sending fake configure notify\n");
|
||||
fake_absolute_configure_notify(con);
|
||||
|
|
Loading…
Reference in New Issue