]> git.sur5r.net Git - i3/i3/blobdiff - src/client.c
Implement selecting the next tiling/floating window (using "focus")
[i3/i3] / src / client.c
index 18126a1a911cd290e83bbfc653e964a024615f29..5d78d38f77958ee03b3ff9e88bfd113f94160ab1 100644 (file)
@@ -187,7 +187,7 @@ void client_toggle_fullscreen(xcb_connection_t *conn, Client *client) {
                 LOG("leaving fullscreen mode\n");
                 client->fullscreen = false;
                 workspace->fullscreen_client = NULL;
-                if (client->floating >= FLOATING_AUTO_ON) {
+                if (client_is_floating(client)) {
                         /* For floating clients it’s enough if we just reconfigure that window (in fact,
                          * re-rendering the layout will not update the client.) */
                         reposition_client(conn, client);
@@ -223,3 +223,13 @@ void client_set_below_floating(xcb_connection_t *conn, Client *client) {
                 xcb_configure_window(conn, client->frame, XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, values);
         }
 }
+
+/*
+ * Returns true if the client is floating. Makes the code more beatiful, as floating
+ * is not simply a boolean, but also saves whether the user selected the current state
+ * or whether it was automatically set.
+ *
+ */
+bool client_is_floating(Client *client) {
+        return (client->floating >= FLOATING_AUTO_ON);
+}