#include "client.h"
#include "log.h"
#include "ewmh.h"
+#include "ipc.h"
/*
* Returns a pointer to the workspace with the given number (starting at 0),
workspace_set_name(ws, NULL);
TAILQ_INSERT_TAIL(workspaces, ws, workspaces);
+
+ ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"init\"}");
}
DLOG("done\n");
errx(1, "asprintf() failed");
FREE(ws->name);
+ FREE(ws->utf8_name);
ws->name = convert_utf8_to_ucs2(label, &(ws->name_len));
if (config.font != NULL)
ws->text_width = predict_text_width(global_conn, config.font, ws->name, ws->name_len);
else ws->text_width = 0;
-
- free(label);
+ ws->utf8_name = label;
}
/*
if ((old_client != NULL) && !old_client->dock)
redecorate_window(conn, old_client);
else xcb_flush(conn);
+
+ /* We need to check if a global fullscreen-client is blocking
+ * the t_ws and if necessary switch that to local fullscreen */
+ Client* client = c_ws->fullscreen_client;
+ if (client != NULL && client->workspace != c_ws) {
+ if (c_ws->fullscreen_client->workspace != c_ws)
+ c_ws->fullscreen_client = NULL;
+ client_enter_fullscreen(conn, client, false);
+ }
}
/* Check if we need to change something or if we’re already there */
xcb_flush(conn);
}
+ ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"focus\"}");
+
return;
}
current_col = c_ws->current_col;
DLOG("new current row = %d, current col = %d\n", current_row, current_col);
+ ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"focus\"}");
+
workspace_map_clients(conn, c_ws);
/* POTENTIAL TO IMPROVE HERE: due to the call to _map_clients first and
* output 1 and you just plugged in output 1).
*
*/
-void workspace_assign_to(Workspace *ws, Output *output) {
+void workspace_assign_to(Workspace *ws, Output *output, bool hide_it) {
Client *client;
bool empty = true;
+ bool visible = workspace_is_visible(ws);
ws->output = output;
render_workspace(global_conn, output, ws);
/* …unless we want to see them at the moment, we should hide that workspace */
- if (workspace_is_visible(ws))
+ if (visible && !hide_it)
return;
workspace_unmap_clients(global_conn, ws);
if (c_ws == ws) {
- DLOG("Need to adjust c_ws...\n");
- c_ws = output->current_workspace;
+ DLOG("Need to adjust output->current_workspace...\n");
+ output->current_workspace = c_ws;
}
}
if (old_output != NULL && ws->output == old_output)
return;
- workspace_assign_to(ws, ws->output);
+ workspace_assign_to(ws, ws->output, false);
}
/*
* the preferred_output setting of every workspace (workspace assignments).
*
*/
-Workspace *get_first_workspace_for_screen(Output *output) {
+Workspace *get_first_workspace_for_output(Output *output) {
Workspace *result = NULL;
Workspace *ws;
/* Map all stack windows, if any */
struct Stack_Window *stack_win;
SLIST_FOREACH(stack_win, &stack_wins, stack_windows)
- if (stack_win->container->workspace == ws)
+ if (stack_win->container->workspace == ws && stack_win->rect.height > 0)
xcb_map_window(conn, stack_win->window);
ignore_enter_notify_forall(conn, ws, false);
height -= client->desired_height;
/* Space for the internal bar */
- height -= (font->height + 6);
+ if (!config.disable_workspace_bar)
+ height -= (font->height + 6);
return height;
}