* and when moving a fullscreen client to another screen.
*
*/
- void client_enter_fullscreen(xcb_connection_t *conn, Client *client);
+ void client_enter_fullscreen(xcb_connection_t *conn, Client *client, bool global);
+
+ /**
+ * Leaves fullscreen mode for the given client. This is called by toggle_fullscreen.
+ *
+ */
+ void client_leave_fullscreen(xcb_connection_t *conn, Client *client);
+/**
+ * Leaves fullscreen mode for the current client. This is called by toggle_fullscreen.
+ *
+ */
+void client_leave_fullscreen(xcb_connection_t *conn, Client *client);
+
/**
* Toggles fullscreen mode for the given client. It updates the data
* structures and reconfigures (= resizes/moves) the client and its frame to
/**
* Stores a rectangle, for example the size of a window, the child window etc.
+ * It needs to be packed so that the compiler will not add any padding bytes.
+ * (it is used in src/ewmh.c for example)
+ *
+ * Note that x and y can contain signed values in some cases (for example when
+ * used for the coordinates of a window, which can be set outside of the
+ * visible area, but not when specifying the position of a workspace for the
+ * _NET_WM_WORKAREA hint). Not declaring x/y as int32_t saves us a lot of
+ * typecasts.
*
+ * Note that x and y can contain signed values in some cases (for example when
+ * used for the coordinates of a window, which can be set outside of the
+ * visible area, but not when specifying the position of a workspace for the
+ * _NET_WM_WORKAREA hint). Not declaring x/y as int32_t saves us a lot of
+ * typecasts.
+ *
*/
struct Rect {
- uint32_t x, y;
- uint32_t width, height;
- };
+ uint32_t x;
+ uint32_t y;
+ uint32_t width;
+ uint32_t height;
+ } __attribute__((packed));
/**
* Defines a position in the table
if (ws->height_factor[row] == 0)
cols_without_hf++;
- LOG("old_unoccupied_y = %d\n", old_unoccupied_y);
+ DLOG("old_unoccupied_y = %d\n", old_unoccupied_y);
+
+ DLOG("Updating first (before = %f)\n", ws->height_factor[first]);
+
- LOG("Updating first (before = %f)\n", ws->height_factor[first]);
/* Convert 0 (for default width_factor) to actual numbers */
if (ws->height_factor[first] == 0)
old_height = (old_unoccupied_y / max(cols_without_hf, 1));
if (!current->urgent)
continue;
- ws->urgent = true;
- return;
+ urgent = true;
+ break;
}
- ws->urgent = false;
+ ws->urgent = urgent;
+
+ if (old_flag != urgent)
+ ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"urgent\"}");
+ }
+
+ /*
+ * Returns the width of the workspace.
+ *
+ */
+ int workspace_width(Workspace *ws) {
+ return ws->rect.width;
+ }
+
+ /*
+ * Returns the effective height of the workspace (without the internal bar and
+ * without dock clients).
+ *
+ */
+ int workspace_height(Workspace *ws) {
+ int height = ws->rect.height;
+ i3Font *font = load_font(global_conn, config.font);
+
+ /* Reserve space for dock clients */
+ Client *client;
+ SLIST_FOREACH(client, &(ws->output->dock_clients), dock_clients)
+ height -= client->desired_height;
+
+ /* Space for the internal bar */
+ if (!config.disable_workspace_bar)
+ height -= (font->height + 6);
+
+ return height;
}
+
+/*
+ * Returns the width of the workspace.
+ *
+ */
+int workspace_width(Workspace *ws) {
+ return ws->rect.width;
+}
+
+/*
+ * Returns the effective height of the workspace (without the internal bar and
+ * without dock clients).
+ *
+ */
+int workspace_height(Workspace *ws) {
+ int height = ws->rect.height;
+ i3Font *font = load_font(global_conn, config.font);
+
+ /* Reserve space for dock clients */
+ Client *client;
+ SLIST_FOREACH(client, &(ws->screen->dock_clients), dock_clients)
+ height -= client->desired_height;
+
+ /* Space for the internal bar */
+ height -= (font->height + 6);
+
+ return height;
+}