]> git.sur5r.net Git - i3/i3/blobdiff - src/floating.c
Merge branch 'next' into master
[i3/i3] / src / floating.c
index a9da2c708d18d4fdbe97f188d0e0b862027547d8..d7a330678d1d2d8227e3037c9a690c3d30bbb861 100644 (file)
@@ -18,6 +18,9 @@ extern xcb_connection_t *conn;
  *
  */
 static Rect total_outputs_dimensions(void) {
+    if (TAILQ_EMPTY(&outputs))
+        return (Rect){0, 0, root_screen->width_in_pixels, root_screen->height_in_pixels};
+
     Output *output;
     /* Use Rect to encapsulate dimensions, ignoring x/y */
     Rect outputs_dimensions = {0, 0, 0, 0};
@@ -366,6 +369,12 @@ void floating_disable(Con *con, bool automatic) {
  *
  */
 void toggle_floating_mode(Con *con, bool automatic) {
+    /* forbid the command to toggle floating on a CT_FLOATING_CON */
+    if (con->type == CT_FLOATING_CON) {
+        ELOG("Cannot toggle floating mode on con = %p because it is of type CT_FLOATING_CON.\n", con);
+        return;
+    }
+
     /* see if the client is already floating */
     if (con_is_floating(con)) {
         LOG("already floating, re-setting to tiling\n");