Bugfix: Reconfigure all clients in stacking, correctly ignore events, event when for the root window
This commit is contained in:
parent
0344ca3f36
commit
8b34eb5fc2
|
@ -338,6 +338,7 @@ int handle_map_notify_event(void *prophs, xcb_connection_t *conn, xcb_map_notify
|
|||
window_attributes_t wa = { TAG_VALUE };
|
||||
wa.u.override_redirect = event->override_redirect;
|
||||
printf("MapNotify for 0x%08x, serial is %d.\n", event->window, event->sequence);
|
||||
printf("setting ignore_notify_event = %d\n", event->sequence);
|
||||
ignore_notify_event = event->sequence;
|
||||
manage_window(prophs, conn, event->window, wa);
|
||||
return 1;
|
||||
|
@ -353,14 +354,16 @@ int handle_configure_event(void *prophs, xcb_connection_t *conn, xcb_configure_n
|
|||
|
||||
printf("handle_configure_event\n");
|
||||
printf("event->x = %d, ->y = %d, ->width = %d, ->height = %d\n", event->x, event->y, event->width, event->height);
|
||||
printf("sequence = %d\n", event->sequence);
|
||||
|
||||
ignore_notify_event = event->sequence;
|
||||
|
||||
if (event->event == root) {
|
||||
printf("reconfigure of the root window, need to xinerama\n");
|
||||
xinerama_requery_screens(conn);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ignore_notify_event = event->sequence;
|
||||
|
||||
Client *client = table_get(byChild, event->window);
|
||||
if (client == NULL) {
|
||||
printf("client not managed, ignoring\n");
|
||||
|
@ -395,6 +398,8 @@ int handle_configure_event(void *prophs, xcb_connection_t *conn, xcb_configure_n
|
|||
int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_notify_event_t *event) {
|
||||
xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(conn)).data->root;
|
||||
|
||||
printf("setting ignore_notify_event = %d\n", event->sequence);
|
||||
|
||||
ignore_notify_event = event->sequence;
|
||||
|
||||
Client *client = table_get(byChild, event->window);
|
||||
|
|
31
src/layout.c
31
src/layout.c
|
@ -304,29 +304,30 @@ void render_container(xcb_connection_t *conn, Container *container) {
|
|||
/* Reconfigure the currently focused client, if necessary. It is the only visible one */
|
||||
client = container->currently_focused;
|
||||
|
||||
/* Check if we changed client->x or client->y by updating it.
|
||||
* Note the bitwise OR instead of logical OR to force evaluation of both statements */
|
||||
if (client->force_reconfigure |
|
||||
HAS_CHANGED(old_value_1, client->rect.x, container->x) |
|
||||
HAS_CHANGED(old_value_2, client->rect.y, container->y + (decoration_height * num_clients)))
|
||||
reposition_client(conn, client);
|
||||
|
||||
if (client->force_reconfigure |
|
||||
HAS_CHANGED(old_value_1, client->rect.width, container->width) |
|
||||
HAS_CHANGED(old_value_2, client->rect.height, container->height - (decoration_height * num_clients)))
|
||||
resize_client(conn, client);
|
||||
|
||||
client->force_reconfigure = false;
|
||||
|
||||
if (container->workspace->fullscreen_client == NULL) {
|
||||
uint32_t values[] = { XCB_STACK_MODE_ABOVE };
|
||||
xcb_configure_window(conn, client->frame, XCB_CONFIG_WINDOW_STACK_MODE, values);
|
||||
}
|
||||
|
||||
/* Render the decorations of all clients */
|
||||
CIRCLEQ_FOREACH(client, &(container->clients), clients)
|
||||
CIRCLEQ_FOREACH(client, &(container->clients), clients) {
|
||||
/* Check if we changed client->x or client->y by updating it.
|
||||
* Note the bitwise OR instead of logical OR to force evaluation of both statements */
|
||||
if (client->force_reconfigure |
|
||||
HAS_CHANGED(old_value_1, client->rect.x, container->x) |
|
||||
HAS_CHANGED(old_value_2, client->rect.y, container->y + (decoration_height * num_clients)))
|
||||
reposition_client(conn, client);
|
||||
|
||||
if (client->force_reconfigure |
|
||||
HAS_CHANGED(old_value_1, client->rect.width, container->width) |
|
||||
HAS_CHANGED(old_value_2, client->rect.height, container->height - (decoration_height * num_clients)))
|
||||
resize_client(conn, client);
|
||||
|
||||
client->force_reconfigure = false;
|
||||
|
||||
decorate_window(conn, client, stack_win->window, stack_win->gc,
|
||||
current_client++ * decoration_height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue