add config variable for emtpy workspaces
This commit is contained in:
parent
3dff3d8b13
commit
3056caf6e3
@ -51,6 +51,7 @@ CFGFUN(floating_maximum_size, const long width, const long height);
|
||||
CFGFUN(default_orientation, const char *orientation);
|
||||
CFGFUN(workspace_layout, const char *layout);
|
||||
CFGFUN(workspace_back_and_forth, const char *value);
|
||||
CFGFUN(empty_workspaces, const char *value);
|
||||
CFGFUN(focus_follows_mouse, const char *value);
|
||||
CFGFUN(mouse_warping, const char *value);
|
||||
CFGFUN(focus_wrapping, const char *value);
|
||||
|
@ -119,6 +119,9 @@ struct Config {
|
||||
/** Default orientation for new containers */
|
||||
int default_orientation;
|
||||
|
||||
/** Init empty workspaces on startup */
|
||||
bool empty_workspaces;
|
||||
|
||||
/** By default, focus follows mouse. If the user explicitly wants to
|
||||
* turn this off (and instead rely only on the keyboard for changing
|
||||
* focus), we allow them to do this with this relatively special option.
|
||||
|
@ -210,6 +210,8 @@ bool load_configuration(const char *override_configpath, config_load_t load_type
|
||||
|
||||
config.show_marks = true;
|
||||
|
||||
config.empty_workspaces = false;
|
||||
|
||||
config.default_border = BS_NORMAL;
|
||||
config.default_floating_border = BS_NORMAL;
|
||||
config.default_border_width = logical_px(2);
|
||||
|
@ -411,6 +411,10 @@ CFGFUN(hide_edge_borders, const char *borders) {
|
||||
config.hide_edge_borders = HEBM_NONE;
|
||||
}
|
||||
|
||||
CFGFUN(empty_workspaces, const char *value) {
|
||||
config.empty_workspaces = boolstr(value);
|
||||
}
|
||||
|
||||
CFGFUN(focus_follows_mouse, const char *value) {
|
||||
config.disable_focus_follows_mouse = !boolstr(value);
|
||||
}
|
||||
|
@ -1199,7 +1199,11 @@ int main(int argc, char *argv[]) {
|
||||
atexit(i3_exit);
|
||||
|
||||
sd_notify(1, "READY=1");
|
||||
workspace_init();
|
||||
|
||||
if (config.empty_workspaces) {
|
||||
workspace_init();
|
||||
}
|
||||
|
||||
ev_loop(main_loop, 0);
|
||||
|
||||
/* Free these heap allocations just to satisfy LeakSanitizer. */
|
||||
|
@ -514,8 +514,9 @@ void workspace_show(Con *workspace) {
|
||||
* client, which will clear the urgency flag too early. Also, there is no
|
||||
* way for con_focus() to know about when to clear urgency immediately and
|
||||
* when to defer it. */
|
||||
/*
|
||||
if (old && TAILQ_EMPTY(&(old->nodes_head)) && TAILQ_EMPTY(&(old->floating_head))) {
|
||||
|
||||
if (old && TAILQ_EMPTY(&(old->nodes_head)) && TAILQ_EMPTY(&(old->floating_head))
|
||||
&& !config.empty_workspaces) {
|
||||
if (!workspace_is_visible(old)) {
|
||||
LOG("Closing old workspace (%p / %s), it is empty\n", old, old->name);
|
||||
yajl_gen gen = ipc_marshal_workspace_event("empty", old, NULL);
|
||||
@ -535,7 +536,6 @@ void workspace_show(Con *workspace) {
|
||||
ewmh_update_desktop_properties();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
workspace->fullscreen_mode = CF_OUTPUT;
|
||||
LOG("focused now = %p / %s\n", focused, focused->name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user