*/
void client_toggle_fullscreen(xcb_connection_t *conn, Client *client);
+/**
+ * Sets the position of the given client in the X stack to the highest (tiling layer is always
+ * on the same position, so this doesn’t matter) below the first floating client, so that
+ * floating windows are always on top.
+ *
+ */
+void client_set_below_floating(xcb_connection_t *conn, Client *client);
+
#endif
#include "util.h"
#include "queue.h"
#include "layout.h"
+#include "client.h"
/*
* Removes the given client from the container, either because it will be inserted into another
/* redecorate_window flushes */
redecorate_window(conn, client);
} else {
+ client_set_below_floating(conn, client);
+
/* Because the coordinates of the window haven’t changed, it would not be
re-configured if we don’t set the following flag */
client->force_reconfigure = true;
xcb_flush(conn);
}
+
+/*
+ * Sets the position of the given client in the X stack to the highest (tiling layer is always
+ * on the same position, so this doesn’t matter) below the first floating client, so that
+ * floating windows are always on top.
+ *
+ */
+void client_set_below_floating(xcb_connection_t *conn, Client *client) {
+ /* Ensure that it is below all floating clients */
+ Client *first_floating = TAILQ_FIRST(&(client->workspace->floating_clients));
+ if (first_floating != TAILQ_END(&(client->workspace->floating_clients))) {
+ LOG("Setting below floating\n");
+ uint32_t values[] = { first_floating->frame, XCB_STACK_MODE_BELOW };
+ xcb_configure_window(conn, client->frame, XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, values);
+ }
+}
LOG("Re-inserted the client into the matrix.\n");
con->currently_focused = client;
- /* Ensure that it is below all floating clients */
- Client *first_floating = TAILQ_FIRST(&(client->workspace->floating_clients));
- if (first_floating != TAILQ_END(&(client->workspace->floating_clients))) {
- LOG("Setting below floating\n");
- uint32_t values[] = { first_floating->frame, XCB_STACK_MODE_BELOW };
- xcb_configure_window(conn, client->frame, XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, values);
- }
+ client_set_below_floating(conn, client);
render_container(conn, con);
xcb_flush(conn);
XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT |
XCB_CONFIG_WINDOW_STACK_MODE;
- /* If there is no fullscreen client, we raise the stack window */
- if (container->workspace->fullscreen_client != NULL) {
+ /* Raise the stack window, but keep it below the first floating client
+ * and below the fullscreen client (if any) */
+ Client *first_floating = TAILQ_FIRST(&(container->workspace->floating_clients));
+ if (first_floating != TAILQ_END(&(container->workspace->floating_clients))) {
+ mask |= XCB_CONFIG_WINDOW_SIBLING;
+ values[4] = first_floating->frame;
+ } else if (container->workspace->fullscreen_client != NULL) {
mask |= XCB_CONFIG_WINDOW_SIBLING;
values[4] = container->workspace->fullscreen_client->frame;
}
SLIST_INSERT_HEAD(&(new->container->workspace->focus_stack), new, focus_clients);
- /* Ensure that it is below all floating clients */
- Client *first_floating = TAILQ_FIRST(&(new->workspace->floating_clients));
- if (first_floating != TAILQ_END(&(new->workspace->floating_clients))) {
- LOG("Setting below floating\n");
- uint32_t values[] = { first_floating->frame, XCB_STACK_MODE_BELOW };
- xcb_configure_window(conn, new->frame, XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, values);
- }
+ client_set_below_floating(conn, new);
}
if (new->floating >= FLOATING_AUTO_ON) {