From 9303bed4d4523d158b33c44f534a53b21d7688d6 Mon Sep 17 00:00:00 2001 From: Jason Nader Date: Mon, 25 Oct 2021 13:28:32 +0900 Subject: refactor: use JSON_MAX_DEPTH everywhere --- include/ipc-client.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/ipc-client.h b/include/ipc-client.h index d3895023..9c5712d7 100644 --- a/include/ipc-client.h +++ b/include/ipc-client.h @@ -1,6 +1,9 @@ #ifndef _SWAY_IPC_CLIENT_H #define _SWAY_IPC_CLIENT_H +// arbitrary number, it's probably sufficient, higher number = more memory usage +#define JSON_MAX_DEPTH 512 + #include #include #include -- cgit v1.2.3 From 9969de9e00a1ca89ded85d418a72c4ebbce91331 Mon Sep 17 00:00:00 2001 From: bR3iN Date: Thu, 28 Oct 2021 15:31:23 +0200 Subject: Add smart_gaps inverse_outer command Add a subcommand for `smart_gaps` that enables outer gaps only on workspaces with exactly one visible child. Also add documentation for `smart_gaps toggle`. --- include/sway/config.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sway/config.h b/include/sway/config.h index 46dd4ffe..660245c1 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -283,6 +283,12 @@ struct side_gaps { int left; }; +enum smart_gaps_mode { + SMART_GAPS_OFF, + SMART_GAPS_ON, + SMART_GAPS_INVERSE_OUTER, +}; + /** * Stores configuration for a workspace, regardless of whether the workspace * exists. @@ -512,7 +518,7 @@ struct sway_config { bool tiling_drag; int tiling_drag_threshold; - bool smart_gaps; + enum smart_gaps_mode smart_gaps; int gaps_inner; struct side_gaps gaps_outer; -- cgit v1.2.3 From 38020d157ddb58e756c654e9a2ff203c1562b25b Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 21 Oct 2021 21:52:17 +0200 Subject: Bump RLIMIT_NOFILE Wayland compositors handle many file descriptors: client connections, DMA-BUFs, sync_files, wl_data_device pipes, and so on. Bump the limit to the max. Closes: https://github.com/swaywm/sway/issues/6285 --- include/sway/server.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/sway/server.h b/include/sway/server.h index 88dda097..f99bbda6 100644 --- a/include/sway/server.h +++ b/include/sway/server.h @@ -137,6 +137,8 @@ void server_fini(struct sway_server *server); bool server_start(struct sway_server *server); void server_run(struct sway_server *server); +void restore_nofile_limit(void); + void handle_compositor_new_surface(struct wl_listener *listener, void *data); void handle_new_output(struct wl_listener *listener, void *data); -- cgit v1.2.3 From 5865af75cf8029cc703cda36b68daafcb658c97b Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Mon, 15 Nov 2021 13:32:52 -0500 Subject: sway: create wlr_renderer and wlr_allocator wlroots now required the compositor to create its own wlr_renderer and wlr_allocator to initialize the wlr_output --- include/sway/server.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/sway/server.h b/include/sway/server.h index f99bbda6..109097d7 100644 --- a/include/sway/server.h +++ b/include/sway/server.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -35,6 +36,8 @@ struct sway_server { struct wlr_backend *noop_backend; // secondary headless backend used for creating virtual outputs on-the-fly struct wlr_backend *headless_backend; + struct wlr_renderer *renderer; + struct wlr_allocator *allocator; struct wlr_compositor *compositor; struct wl_listener compositor_new_surface; -- cgit v1.2.3 From a23cdbbea145e0890627743d316c0ab6fe6c9c1f Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Thu, 2 Sep 2021 21:45:23 -0400 Subject: Add 'output render_bit_depth [8|10]' command This makes it possible to hint to the renderer and backends how many bits per channel the buffers that the compositor draws windows onto should have. Renderers and backends may deviate from this if they do not support the formats with higher bit depth. --- include/sway/commands.h | 1 + include/sway/config.h | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'include') diff --git a/include/sway/commands.h b/include/sway/commands.h index 4be40870..c6f5c2e0 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h @@ -284,6 +284,7 @@ sway_cmd output_cmd_max_render_time; sway_cmd output_cmd_mode; sway_cmd output_cmd_modeline; sway_cmd output_cmd_position; +sway_cmd output_cmd_render_bit_depth; sway_cmd output_cmd_scale; sway_cmd output_cmd_scale_filter; sway_cmd output_cmd_subpixel; diff --git a/include/sway/config.h b/include/sway/config.h index 660245c1..aa71209d 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -247,6 +247,12 @@ enum scale_filter_mode { SCALE_FILTER_SMART, }; +enum render_bit_depth { + RENDER_BIT_DEPTH_DEFAULT, // the default is currently 8 + RENDER_BIT_DEPTH_8, + RENDER_BIT_DEPTH_10, +}; + /** * Size and position configuration for a particular output. * @@ -266,6 +272,7 @@ struct output_config { enum wl_output_subpixel subpixel; int max_render_time; // In milliseconds int adaptive_sync; + enum render_bit_depth render_bit_depth; char *background; char *background_option; -- cgit v1.2.3 From 0cd8efe0bb669e71e9cdc30d96ae466cb583e605 Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Mon, 4 Oct 2021 10:04:46 -0400 Subject: sway: replace noop_output by fallback_output wlroots removed the support for the noop backend. Instead we rely on the headless backend to provide the fallback output. --- include/sway/server.h | 1 - include/sway/tree/root.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/sway/server.h b/include/sway/server.h index 109097d7..7ac2af26 100644 --- a/include/sway/server.h +++ b/include/sway/server.h @@ -33,7 +33,6 @@ struct sway_server { const char *socket; struct wlr_backend *backend; - struct wlr_backend *noop_backend; // secondary headless backend used for creating virtual outputs on-the-fly struct wlr_backend *headless_backend; struct wlr_renderer *renderer; diff --git a/include/sway/tree/root.h b/include/sway/tree/root.h index e8f4d573..5d4a2f2d 100644 --- a/include/sway/tree/root.h +++ b/include/sway/tree/root.h @@ -31,7 +31,7 @@ struct sway_root { list_t *scratchpad; // struct sway_container // For when there's no connected outputs - struct sway_output *noop_output; + struct sway_output *fallback_output; struct sway_container *fullscreen_global; -- cgit v1.2.3 From f7725011efd3bc2762a0d1002ea5071470962213 Mon Sep 17 00:00:00 2001 From: Vsevolod Date: Fri, 10 Dec 2021 17:09:29 +0200 Subject: Add focused_tab_title --- include/sway/commands.h | 1 + include/sway/config.h | 3 +++ include/sway/tree/container.h | 2 ++ 3 files changed, 6 insertions(+) (limited to 'include') diff --git a/include/sway/commands.h b/include/sway/commands.h index c6f5c2e0..2746ef28 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h @@ -112,6 +112,7 @@ sway_cmd cmd_border; sway_cmd cmd_client_noop; sway_cmd cmd_client_focused; sway_cmd cmd_client_focused_inactive; +sway_cmd cmd_client_focused_tab_title; sway_cmd cmd_client_unfocused; sway_cmd cmd_client_urgent; sway_cmd cmd_client_placeholder; diff --git a/include/sway/config.h b/include/sway/config.h index aa71209d..fda0e83f 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -548,12 +548,15 @@ struct sway_config { struct { struct border_colors focused; struct border_colors focused_inactive; + struct border_colors focused_tab_title; struct border_colors unfocused; struct border_colors urgent; struct border_colors placeholder; float background[4]; } border_colors; + bool has_focused_tab_title; + // floating view int32_t floating_maximum_width; int32_t floating_maximum_height; diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 97fa98c1..05761150 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -117,12 +117,14 @@ struct sway_container { struct wlr_texture *title_focused; struct wlr_texture *title_focused_inactive; + struct wlr_texture *title_focused_tab_title; struct wlr_texture *title_unfocused; struct wlr_texture *title_urgent; list_t *marks; // char * struct wlr_texture *marks_focused; struct wlr_texture *marks_focused_inactive; + struct wlr_texture *marks_focused_tab_title; struct wlr_texture *marks_unfocused; struct wlr_texture *marks_urgent; -- cgit v1.2.3 From 4732325f591455f1e4bdcb35652505a8a636663a Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 7 Jun 2021 18:58:20 +0200 Subject: Add support for linux-dmabuf surface hints References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/1376 --- include/sway/server.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/sway/server.h b/include/sway/server.h index 7ac2af26..0bd860b2 100644 --- a/include/sway/server.h +++ b/include/sway/server.h @@ -41,6 +41,8 @@ struct sway_server { struct wlr_compositor *compositor; struct wl_listener compositor_new_surface; + struct wlr_linux_dmabuf_v1 *linux_dmabuf_v1; + struct wlr_data_device_manager *data_device_manager; struct sway_input_manager *input; -- cgit v1.2.3 From 57a7b3998ea62616223000eb6369c999b4cd1a94 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 13 Dec 2021 18:33:32 +0100 Subject: swaynag: remove xdg-output logic We can just get the output name from wl_output directly, now that wl_output version 4 exists. --- include/swaynag/swaynag.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/swaynag/swaynag.h b/include/swaynag/swaynag.h index 9e39e716..baa6ee8b 100644 --- a/include/swaynag/swaynag.h +++ b/include/swaynag/swaynag.h @@ -5,7 +5,6 @@ #include "list.h" #include "pool-buffer.h" #include "swaynag/types.h" -#include "xdg-output-unstable-v1-client-protocol.h" #define SWAYNAG_MAX_HEIGHT 500 @@ -75,13 +74,11 @@ struct swaynag_details { struct swaynag { bool run_display; - int querying_outputs; struct wl_display *display; struct wl_compositor *compositor; struct wl_seat *seat; struct wl_shm *shm; - struct zxdg_output_manager_v1 *xdg_output_manager; struct wl_list outputs; // swaynag_output::link struct wl_list seats; // swaynag_seat::link struct swaynag_output *output; -- cgit v1.2.3 From ebfe432ec3064094faebe0913b2d98932d590bfd Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Sun, 24 Oct 2021 18:49:39 -0700 Subject: output: change output::destroy to output::disable This changes output::destroy to output::disable and emits it only once when an output is disabled, instead of twice in succession. --- include/sway/output.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/sway/output.h b/include/sway/output.h index 5dfe0fff..26b9709f 100644 --- a/include/sway/output.h +++ b/include/sway/output.h @@ -48,7 +48,7 @@ struct sway_output { struct wl_listener damage_frame; struct { - struct wl_signal destroy; + struct wl_signal disable; } events; struct timespec last_presentation; -- cgit v1.2.3 From 297a0c9d35703e59b23d8bae59f181c22f52bc68 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 23 Dec 2021 12:09:14 +0100 Subject: Destroy sub-surfaces with parent layer-shell surface Closes: https://github.com/swaywm/sway/issues/6337 (cherry picked from commit e2b4c573d6506250c77f01512bc07c72996cd363) --- include/sway/layers.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/sway/layers.h b/include/sway/layers.h index 224dc5e6..14816861 100644 --- a/include/sway/layers.h +++ b/include/sway/layers.h @@ -25,6 +25,8 @@ struct sway_layer_surface { bool mapped; struct wlr_box extent; enum zwlr_layer_shell_v1_layer layer; + + struct wl_list subsurfaces; }; struct sway_layer_popup { @@ -44,6 +46,7 @@ struct sway_layer_popup { struct sway_layer_subsurface { struct wlr_subsurface *wlr_subsurface; struct sway_layer_surface *layer_surface; + struct wl_list link; struct wl_listener map; struct wl_listener unmap; -- cgit v1.2.3