Revert 43d471b9ab
and apply correct bugfix:
Before, all clients were reconfigured to just raise them, when focus should be set. However, this generated lots of notify events, which in turn lead to an endless loop of setting focus, reconfiguring, setting focus, …
This commit is contained in:
parent
74c973e8c6
commit
d8d4d0182d
|
@ -110,11 +110,6 @@ int handle_enter_notify(void *ignored, xcb_connection_t *conn, xcb_enter_notify_
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* When in stacking, enter notifications on the parent are ignored. Focus will be changed via keyboard only. */
|
|
||||||
if (client->container->mode == MODE_STACK &&
|
|
||||||
client == table_get(byParent, event->event))
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
set_focus(conn, client);
|
set_focus(conn, client);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
14
src/layout.c
14
src/layout.c
|
@ -232,8 +232,9 @@ void render_container(xcb_connection_t *connection, Container *container) {
|
||||||
xcb_configure_window(connection, stack_win->window,
|
xcb_configure_window(connection, stack_win->window,
|
||||||
XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, &(stack_win->width));
|
XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, &(stack_win->width));
|
||||||
|
|
||||||
/* All clients are repositioned */
|
/* Reconfigure the currently focused client, if necessary. It is the only visible one */
|
||||||
CIRCLEQ_FOREACH(client, &(container->clients), clients) {
|
client = container->currently_focused;
|
||||||
|
|
||||||
/* Check if we changed client->x or client->y by updating it.
|
/* 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 */
|
* Note the bitwise OR instead of logical OR to force evaluation of both statements */
|
||||||
if (client->force_reconfigure |
|
if (client->force_reconfigure |
|
||||||
|
@ -249,10 +250,13 @@ void render_container(xcb_connection_t *connection, Container *container) {
|
||||||
|
|
||||||
client->force_reconfigure = false;
|
client->force_reconfigure = false;
|
||||||
|
|
||||||
|
uint32_t values[] = { XCB_STACK_MODE_ABOVE };
|
||||||
|
xcb_configure_window(connection, client->frame, XCB_CONFIG_WINDOW_STACK_MODE, values);
|
||||||
|
|
||||||
|
/* Render the decorations of all clients */
|
||||||
|
CIRCLEQ_FOREACH(client, &(container->clients), clients)
|
||||||
decorate_window(connection, client, stack_win->window, stack_win->gc,
|
decorate_window(connection, client, stack_win->window, stack_win->gc,
|
||||||
current_client * decoration_height);
|
current_client++ * decoration_height);
|
||||||
current_client++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
13
src/util.c
13
src/util.c
|
@ -149,13 +149,9 @@ void set_focus(xcb_connection_t *conn, Client *client) {
|
||||||
decorate_window(conn, client, client->frame, client->titlegc, 0);
|
decorate_window(conn, client, client->frame, client->titlegc, 0);
|
||||||
|
|
||||||
/* If we’re in stacking mode, we render the container to update changes in the title
|
/* If we’re in stacking mode, we render the container to update changes in the title
|
||||||
bars and raise the focused client */
|
bars and to raise the focused client */
|
||||||
if (client->container->mode == MODE_STACK) {
|
if (client->container->mode == MODE_STACK)
|
||||||
render_container(conn, client->container);
|
render_container(conn, client->container);
|
||||||
uint32_t values[] = { XCB_STACK_MODE_ABOVE };
|
|
||||||
xcb_configure_window(conn, client->frame,
|
|
||||||
XCB_CONFIG_WINDOW_STACK_MODE, values);
|
|
||||||
}
|
|
||||||
|
|
||||||
xcb_flush(conn);
|
xcb_flush(conn);
|
||||||
}
|
}
|
||||||
|
@ -193,11 +189,6 @@ void switch_layout_mode(xcb_connection_t *conn, Container *container, int mode)
|
||||||
stack_win->container = container;
|
stack_win->container = container;
|
||||||
|
|
||||||
SLIST_INSERT_HEAD(&stack_wins, stack_win, stack_windows);
|
SLIST_INSERT_HEAD(&stack_wins, stack_win, stack_windows);
|
||||||
/* Raise the focused window */
|
|
||||||
values[0] = XCB_STACK_MODE_ABOVE;
|
|
||||||
xcb_configure_window(conn, container->currently_focused->frame,
|
|
||||||
XCB_CONFIG_WINDOW_STACK_MODE, values);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (container->mode == MODE_STACK) {
|
if (container->mode == MODE_STACK) {
|
||||||
/* When going out of stacking mode, we need to close the window */
|
/* When going out of stacking mode, we need to close the window */
|
||||||
|
|
Loading…
Reference in New Issue