1
1
Fork 0
mirror of https://github.com/swaywm/sway synced 2024-05-09 20:06:16 +02:00

Compare commits

...

10 Commits

Author SHA1 Message Date
neuromagus 573743ab50
Merge 8c8f0093dc into 646019cad9 2024-04-24 21:26:52 +03:00
neuromagus 8c8f0093dc
Merge branch 'master' into disable_titlebar 2024-04-24 21:26:48 +03:00
neuromagus ff9c5aa647
Merge branch 'master' into disable_titlebar 2024-04-22 22:55:20 +03:00
neuromagus cf608513f0
Merge branch 'master' into disable_titlebar 2024-04-15 10:52:43 +03:00
neuromagus 034fbb5789
Merge branch 'master' into disable_titlebar 2024-04-09 04:29:20 +03:00
neuromagus abce7e5200
Merge branch 'master' into disable_titlebar 2024-03-31 23:17:39 +03:00
neuromagus af5c748094
Merge branch 'master' into disable_titlebar 2024-03-28 16:56:44 +03:00
neuromagus 74fcb600a2
Merge branch 'master' into disable_titlebar 2024-03-28 11:27:08 +03:00
neuromagus b57879f9b2
Merge branch 'swaywm:master' into disable_titlebar 2024-03-07 18:06:32 +03:00
neuromagus e1bd348fc4 added 'disable_titlebar' option 2024-03-01 12:44:54 +03:00
8 changed files with 27 additions and 0 deletions

View File

@ -124,6 +124,7 @@ sway_cmd cmd_create_output;
sway_cmd cmd_default_border;
sway_cmd cmd_default_floating_border;
sway_cmd cmd_default_orientation;
sway_cmd cmd_disable_titlebar;
sway_cmd cmd_exec;
sway_cmd cmd_exec_always;
sway_cmd cmd_exit;

View File

@ -540,6 +540,7 @@ struct sway_config {
bool validating;
bool auto_back_and_forth;
bool show_marks;
bool disable_titlebar;
enum alignment title_align;
bool primary_selection;

View File

@ -57,6 +57,7 @@ static const struct cmd_handler handlers[] = {
{ "client.urgent", cmd_client_urgent },
{ "default_border", cmd_default_border },
{ "default_floating_border", cmd_default_floating_border },
{ "disable_titlebar", cmd_disable_titlebar },
{ "exec", cmd_exec },
{ "exec_always", cmd_exec_always },
{ "floating_maximum_size", cmd_floating_maximum_size },

View File

@ -0,0 +1,15 @@
#include "sway/commands.h"
#include "sway/config.h"
#include "util.h"
struct cmd_results *cmd_disable_titlebar(int argc, char **argv) {
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "disable_titlebar", EXPECTED_EQUAL_TO, 1))) {
return error;
}
config->disable_titlebar = parse_boolean(argv[0], config->disable_titlebar);
return cmd_results_new(CMD_SUCCESS, NULL);
}

View File

@ -278,6 +278,7 @@ static void config_defaults(struct sway_config *config) {
config->auto_back_and_forth = false;
config->reading = false;
config->show_marks = true;
config->disable_titlebar = false;
config->title_align = ALIGN_LEFT;
config->tiling_drag = true;
config->tiling_drag_threshold = 9;

View File

@ -50,6 +50,7 @@ sway_sources = files(
'commands/default_border.c',
'commands/default_floating_border.c',
'commands/default_orientation.c',
'commands/disable_titlebar.c',
'commands/exit.c',
'commands/exec.c',
'commands/exec_always.c',

View File

@ -732,6 +732,9 @@ The default colors are:
should be greater than titlebar_border_thickness. If _vertical_ value is
not specified it is set to the _horizontal_ value.
*disable_titlebar* yes|no.
Remove titlebar. Default is _no_.
*for_window* <criteria> <command>
Whenever a window that matches _criteria_ appears, run list of commands.
See *CRITERIA* for more details.

View File

@ -722,6 +722,10 @@ void container_update_representation(struct sway_container *con) {
}
size_t container_titlebar_height(void) {
if(config->disable_titlebar) {
return 0;
}
return config->font_height + config->titlebar_v_padding * 2;
}