*
*/
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};
*
*/
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");
Con *content = output_get_content(output->con);
Con *ws = TAILQ_FIRST(&(content->focus_head));
DLOG("Moving con %p / %s to workspace %p / %s\n", con, con->name, ws, ws->name);
- con_move_to_workspace(con, ws, false, true);
+ con_move_to_workspace(con, ws, false, true, false);
con_focus(con_descend_focused(con));
return true;
}