i3
workspace.h
Go to the documentation of this file.
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
6  *
7  * workspace.c: Modifying workspaces, accessing them, moving containers to
8  * workspaces.
9  *
10  */
11 #pragma once
12 
13 #include <config.h>
14 
15 #include "data.h"
16 #include "tree.h"
17 #include "randr.h"
18 
19 /* We use NET_WM_DESKTOP_NONE for cases where we cannot determine the EWMH
20  * desktop index for a window. We cannot use a negative value like -1 since we
21  * need to use uint32_t as we actually need the full range of it. This is
22  * technically dangerous, but it's safe to assume that we will never have more
23  * than 4294967279 workspaces open at a time. */
24 #define NET_WM_DESKTOP_NONE 0xFFFFFFF0
25 #define NET_WM_DESKTOP_ALL 0xFFFFFFFF
26 
32 extern char *previous_workspace_name;
33 
39 Con *get_existing_workspace_by_name(const char *name);
40 
47 
53 bool output_triggers_assignment(Output *output, struct Workspace_Assignment *assignment);
54 
64 Con *workspace_get(const char *num, bool *created);
65 
74 
81 Con *create_workspace_on_output(Output *output, Con *content);
82 
89 bool workspace_is_visible(Con *ws);
90 
95 void workspace_show(Con *ws);
96 
101 void workspace_show_by_name(const char *num);
102 
107 Con *workspace_next(void);
108 
113 Con *workspace_prev(void);
114 
120 
126 
131 void workspace_back_and_forth(void);
132 
138 
139 #if 0
140 
149 void workspace_assign_to(Workspace *ws, Output *screen, bool hide_it);
150 
158 void workspace_initialize(Workspace *ws, Output *screen, bool recheck);
159 
165 Workspace *get_first_workspace_for_output(Output *screen);
166 
175 void workspace_unmap_clients(xcb_connection_t *conn, Workspace *u_ws);
176 
181 void workspace_map_clients(xcb_connection_t *conn, Workspace *ws);
182 #endif
183 
190 
197 void ws_force_orientation(Con *ws, orientation_t orientation);
198 
210 
218 
223 void workspace_move_to_output(Con *ws, Output *output);
Con * workspace_attach_to(Con *ws)
Called when a new con (with a window, not an empty or split con) should be attached to the workspace ...
Definition: workspace.c:895
Con * workspace_prev_on_output(void)
Returns the previous workspace on the same output.
Definition: workspace.c:738
void workspace_move_to_output(Con *ws, Output *output)
Move the given workspace to the specified output.
Definition: workspace.c:959
bool workspace_is_visible(Con *ws)
Returns true if the workspace is currently visible.
Definition: workspace.c:299
xcb_connection_t * conn
XCB connection and root screen.
Definition: main.c:44
Con * workspace_next_on_output(void)
Returns the next workspace on the same output.
Definition: workspace.c:683
void workspace_update_urgent_flag(Con *ws)
Goes through all clients on the given workspace and updates the workspace’s urgent flag accordingly...
Definition: workspace.c:838
bool output_triggers_assignment(Output *output, struct Workspace_Assignment *assignment)
Returns true if the first output assigned to a workspace with the given workspace assignment is the s...
Definition: workspace.c:114
Con * get_existing_workspace_by_name(const char *name)
Returns the workspace with the given name or NULL if such a workspace does not exist.
Definition: workspace.c:30
Con * create_workspace_on_output(Output *output, Con *content)
Returns a pointer to a new workspace in the given output.
Definition: workspace.c:235
A &#39;Con&#39; represents everything from the X11 root window down to a single X11 window.
Definition: data.h:613
void workspace_show(Con *ws)
Switches to the given workspace.
Definition: workspace.c:412
orientation_t
Definition: data.h:59
void ws_force_orientation(Con *ws, orientation_t orientation)
&#39;Forces&#39; workspace orientation by moving all cons into a new split-con with the same orientation as t...
Definition: workspace.c:852
Stores which workspace (by name or number) goes to which output.
Definition: data.h:207
Con * workspace_prev(void)
Returns the previous workspace.
Definition: workspace.c:617
Con * get_existing_workspace_by_num(int num)
Returns the workspace with the given number or NULL if such a workspace does not exist.
Definition: workspace.c:44
An Output is a physical output on your graphics driver.
Definition: data.h:375
void extract_workspace_names_from_bindings(void)
Extracts workspace names from keybindings (e.g.
Definition: workspace.c:181
Con * workspace_get(const char *num, bool *created)
Returns a pointer to the workspace with the given number (starting at 0), creating the workspace if n...
Definition: workspace.c:125
Con * workspace_back_and_forth_get(void)
Returns the previously focused workspace con, or NULL if unavailable.
Definition: workspace.c:808
Con * workspace_encapsulate(Con *ws)
Creates a new container and re-parents all of children from the given workspace into it...
Definition: workspace.c:927
Con * workspace_next(void)
Returns the next workspace.
Definition: workspace.c:554
void workspace_show_by_name(const char *num)
Looks up the workspace by name and switches to it.
Definition: workspace.c:544
char * previous_workspace_name
Stores a copy of the name of the last used workspace for the workspace back-and-forth switching...
Definition: workspace.c:19
void workspace_back_and_forth(void)
Focuses the previously focused workspace.
Definition: workspace.c:795