From 5c0086b94422a63587508c34bbac9bde6b313ca3 Mon Sep 17 00:00:00 2001 From: William McKinnon Date: Sun, 21 Aug 2022 17:12:54 -0400 Subject: [PATCH] Add rounded corners (#9) --- include/sway/commands.h | 5 +- include/sway/config.h | 5 +- include/sway/desktop/fx_renderer.h | 5 +- sway/commands.c | 1 + sway/commands/corner_radius.c | 23 ++ sway/config.c | 3 + sway/desktop/fx_renderer.c | 183 +++++++++++- sway/desktop/render.c | 34 ++- sway/meson.build | 439 +++++++++++++++-------------- 9 files changed, 454 insertions(+), 244 deletions(-) create mode 100644 sway/commands/corner_radius.c diff --git a/include/sway/commands.h b/include/sway/commands.h index 2746ef28..1383295d 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h @@ -17,9 +17,9 @@ struct cmd_handler { * Indicates the result of a command's execution. */ enum cmd_status { - CMD_SUCCESS, /**< The command was successful */ + CMD_SUCCESS, /**< The command was successful */ CMD_FAILURE, /**< The command resulted in an error */ - CMD_INVALID, /**< Unknown command or parser error */ + CMD_INVALID, /**< Unknown command or parser error */ CMD_DEFER, /**< Command execution deferred */ CMD_BLOCK, CMD_BLOCK_COMMANDS, @@ -118,6 +118,7 @@ sway_cmd cmd_client_urgent; sway_cmd cmd_client_placeholder; sway_cmd cmd_client_background; sway_cmd cmd_commands; +sway_cmd cmd_corner_radius; sway_cmd cmd_create_output; sway_cmd cmd_default_border; sway_cmd cmd_default_floating_border; diff --git a/include/sway/config.h b/include/sway/config.h index fda0e83f..e644003f 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -466,6 +466,9 @@ enum xwayland_mode { * The configuration struct. The result of loading a config file. */ struct sway_config { + // SwayFX config options + int corner_radius; + char *swaynag_command; struct swaynag_instance swaynag_config_errors; list_t *symbols; @@ -708,7 +711,7 @@ void free_workspace_config(struct workspace_config *wsc); /** * Updates the value of config->font_height based on the metrics for title's * font as reported by pango. - * + * * If the height has changed, all containers will be rearranged to take on the * new size. */ diff --git a/include/sway/desktop/fx_renderer.h b/include/sway/desktop/fx_renderer.h index f2ed0cbc..5ed3bc7d 100644 --- a/include/sway/desktop/fx_renderer.h +++ b/include/sway/desktop/fx_renderer.h @@ -8,6 +8,7 @@ struct gles2_tex_shader { GLint proj; GLint tex; GLint alpha; + GLint discardOpaque; GLint pos_attrib; GLint tex_attrib; }; @@ -43,10 +44,10 @@ void fx_renderer_scissor(struct wlr_box *box); bool fx_render_subtexture_with_matrix(struct fx_renderer *renderer, struct wlr_texture *wlr_texture, const struct wlr_fbox *box, - const float matrix[static 9], float alpha); + const float matrix[static 9], float alpha, int radius); bool fx_render_texture_with_matrix(struct fx_renderer *renderer, - struct wlr_texture *wlr_texture, const float matrix[static 9], float alpha); + struct wlr_texture *wlr_texture, const float matrix[static 9], float alpha, int radius); void fx_render_rect(struct fx_renderer *renderer, const struct wlr_box *box, const float color[static 4], const float projection[static 9]); diff --git a/sway/commands.c b/sway/commands.c index 5a1fd32e..d60cf84b 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -55,6 +55,7 @@ static const struct cmd_handler handlers[] = { { "client.placeholder", cmd_client_noop }, { "client.unfocused", cmd_client_unfocused }, { "client.urgent", cmd_client_urgent }, + { "corner_radius", cmd_corner_radius }, { "default_border", cmd_default_border }, { "default_floating_border", cmd_default_floating_border }, { "exec", cmd_exec }, diff --git a/sway/commands/corner_radius.c b/sway/commands/corner_radius.c new file mode 100644 index 00000000..ce1eff88 --- /dev/null +++ b/sway/commands/corner_radius.c @@ -0,0 +1,23 @@ +#include +#include "sway/commands.h" +#include "sway/config.h" +#include "log.h" + +struct cmd_results *cmd_corner_radius(int argc, char **argv) { + struct cmd_results *error = NULL; + if ((error = checkarg(argc, "corner_radius", EXPECTED_EQUAL_TO, 1))) { + return error; + } + + char *inv; + int value = strtol(argv[0], &inv, 10); + if (*inv != '\0' || value < 0 || value > 99) { + return cmd_results_new(CMD_FAILURE, "Invalid size specified"); + } + + config->corner_radius = value; + + // TODO: rerender windows (see opacity cmd) + + return cmd_results_new(CMD_SUCCESS, NULL); +} diff --git a/sway/config.c b/sway/config.c index e4745a5c..47f80ce7 100644 --- a/sway/config.c +++ b/sway/config.c @@ -325,6 +325,9 @@ static void config_defaults(struct sway_config *config) { color_to_rgba(config->border_colors.background, 0xFFFFFFFF); + // SwayFX defaults + config->corner_radius = 0; + // The keysym to keycode translation struct xkb_rule_names rules = {0}; config->keysym_translation_state = diff --git a/sway/desktop/fx_renderer.c b/sway/desktop/fx_renderer.c index 5403f763..6dbccc23 100644 --- a/sway/desktop/fx_renderer.c +++ b/sway/desktop/fx_renderer.c @@ -4,6 +4,8 @@ - https://github.com/vaxerski/Hyprland/blob/main/src/render/OpenGL.cpp */ +// TODO: add push / pop_gles2_debug(renderer)? + #define _POSIX_C_SOURCE 200809L #include #include @@ -64,8 +66,57 @@ const GLchar tex_fragment_src_rgba[] = "uniform sampler2D tex;\n" "uniform float alpha;\n" "\n" +"uniform vec2 topLeft;\n" +"uniform vec2 bottomRight;\n" +"uniform vec2 fullSize;\n" +"uniform float radius;\n" +"\n" +"uniform int discardOpaque;\n" +"\n" "void main() {\n" -" gl_FragColor = texture2D(tex, v_texcoord) * alpha;\n" +" vec4 pixColor = texture2D(tex, v_texcoord);\n" +"\n" +" if (discardOpaque == 1 && pixColor[3] * alpha == 1.0) {\n" +" discard;\n" +" return;\n" +" }\n" +"\n" +" vec2 pixCoord = fullSize * v_texcoord;\n" +"\n" +" if (pixCoord[0] < topLeft[0]) {\n" +" // we're close left\n" +" if (pixCoord[1] < topLeft[1]) {\n" + // top +" if (distance(topLeft, pixCoord) > radius) {\n" +" discard;\n" +" return;\n" +" }\n" +" } else if (pixCoord[1] > bottomRight[1]) {\n" + // bottom +" if (distance(vec2(topLeft[0], bottomRight[1]), pixCoord) > radius) {\n" +" discard;\n" +" return;\n" +" }\n" +" }\n" +" }\n" +" else if (pixCoord[0] > bottomRight[0]) {\n" + // we're close right +" if (pixCoord[1] < topLeft[1]) {\n" + // top +" if (distance(vec2(bottomRight[0], topLeft[1]), pixCoord) > radius) {\n" +" discard;\n" +" return;\n" +" }\n" +" } else if (pixCoord[1] > bottomRight[1]) {\n" + // bottom +" if (distance(bottomRight, pixCoord) > radius) {\n" +" discard;\n" +" return;\n" +" }\n" +" }\n" +" }\n" +"\n" +" gl_FragColor = pixColor * alpha;\n" "}\n"; const GLchar tex_fragment_src_rgbx[] = @@ -74,7 +125,55 @@ const GLchar tex_fragment_src_rgbx[] = "uniform sampler2D tex;\n" "uniform float alpha;\n" "\n" +"uniform vec2 topLeft;\n" +"uniform vec2 bottomRight;\n" +"uniform vec2 fullSize;\n" +"uniform float radius;\n" +"\n" +"uniform int discardOpaque;\n" +"\n" "void main() {\n" +"\n" +" if (discardOpaque == 1 && alpha == 1.0) {\n" +" discard;\n" +" return;\n" +" }\n" +"\n" +" vec2 pixCoord = fullSize * v_texcoord;\n" +"\n" +" if (pixCoord[0] < topLeft[0]) {\n" + // we're close left +" if (pixCoord[1] < topLeft[1]) {\n" + // top +" if (distance(topLeft, pixCoord) > radius) {\n" +" discard;\n" +" return;\n" +" }\n" +" } else if (pixCoord[1] > bottomRight[1]) {\n" + // bottom +" if (distance(vec2(topLeft[0], bottomRight[1]), pixCoord) > radius) {\n" +" discard;\n" +" return;\n" +" }\n" +" }\n" +" }\n" +" else if (pixCoord[0] > bottomRight[0]) {\n" + // we're close right +" if (pixCoord[1] < topLeft[1]) {\n" + // top +" if (distance(vec2(bottomRight[0], topLeft[1]), pixCoord) > radius) {\n" +" discard;\n" +" return;\n" +" }\n" +" } else if (pixCoord[1] > bottomRight[1]) {\n" + // bottom +" if (distance(bottomRight, pixCoord) > radius) {\n" +" discard;\n" +" return;\n" +" }\n" +" }\n" +" }\n" +"\n" " gl_FragColor = vec4(texture2D(tex, v_texcoord).rgb, 1.0) * alpha;\n" "}\n"; @@ -85,8 +184,58 @@ const GLchar tex_fragment_src_external[] = "uniform samplerExternalOES texture0;\n" "uniform float alpha;\n" "\n" +"uniform vec2 topLeft;\n" +"uniform vec2 bottomRight;\n" +"uniform vec2 fullSize;\n" +"uniform float radius;\n" +"\n" +"uniform int discardOpaque;\n" +"\n" "void main() {\n" -" gl_FragColor = texture2D(texture0, v_texcoord) * alpha;\n" +"\n" +" vec4 pixColor = texture2D(texture0, v_texcoord);\n" +"\n" +" if (discardOpaque == 1 && pixColor[3] * alpha == 1.0) {\n" +" discard;\n" +" return;\n" +" }\n" +"\n" +" vec2 pixCoord = fullSize * v_texcoord;\n" +"\n" +" if (pixCoord[0] < topLeft[0]) {\n" + // we're close left +" if (pixCoord[1] < topLeft[1]) {\n" + // top +" if (distance(topLeft, pixCoord) > radius) {\n" +" discard;\n" +" return;\n" +" }\n" +" } else if (pixCoord[1] > bottomRight[1]) {\n" + // bottom +" if (distance(vec2(topLeft[0], bottomRight[1]), pixCoord) > radius) {\n" +" discard;\n" +" return;\n" +" }\n" +" }\n" +" }\n" +" else if (pixCoord[0] > bottomRight[0]) {\n" + // we're close right +" if (pixCoord[1] < topLeft[1]) {\n" + // top +" if (distance(vec2(bottomRight[0], topLeft[1]), pixCoord) > radius) {\n" +" discard;\n" +" return;\n" +" }\n" +" } else if (pixCoord[1] > bottomRight[1]) {\n" + // bottom +" if (distance(bottomRight, pixCoord) > radius) {\n" +" discard;\n" +" return;\n" +" }\n" +" }\n" +" }\n" +"\n" +" gl_FragColor = pixColor * alpha;\n" "}\n"; /************************ @@ -207,6 +356,7 @@ struct fx_renderer *fx_renderer_create(struct wlr_egl *egl) { renderer->shaders.tex_rgba.alpha = glGetUniformLocation(prog, "alpha"); renderer->shaders.tex_rgba.pos_attrib = glGetAttribLocation(prog, "pos"); renderer->shaders.tex_rgba.tex_attrib = glGetAttribLocation(prog, "texcoord"); + renderer->shaders.tex_rgba.discardOpaque = glGetUniformLocation(prog, "discardOpaque"); prog = link_program(tex_vertex_src, tex_fragment_src_rgbx); renderer->shaders.tex_rgbx.program = prog; @@ -218,6 +368,7 @@ struct fx_renderer *fx_renderer_create(struct wlr_egl *egl) { renderer->shaders.tex_rgbx.alpha = glGetUniformLocation(prog, "alpha"); renderer->shaders.tex_rgbx.pos_attrib = glGetAttribLocation(prog, "pos"); renderer->shaders.tex_rgbx.tex_attrib = glGetAttribLocation(prog, "texcoord"); + renderer->shaders.tex_rgbx.discardOpaque = glGetUniformLocation(prog, "discardOpaque"); prog = link_program(tex_vertex_src, tex_fragment_src_external); renderer->shaders.tex_ext.program = prog; @@ -229,8 +380,8 @@ struct fx_renderer *fx_renderer_create(struct wlr_egl *egl) { renderer->shaders.tex_ext.alpha = glGetUniformLocation(prog, "alpha"); renderer->shaders.tex_ext.pos_attrib = glGetAttribLocation(prog, "pos"); renderer->shaders.tex_ext.tex_attrib = glGetAttribLocation(prog, "texcoord"); + renderer->shaders.tex_ext.discardOpaque = glGetUniformLocation(prog, "discardOpaque"); - // TODO: if remove renderer->egl, replace below with r->egl wlr_egl_unset_current(renderer->egl); sway_log(SWAY_INFO, "GLES2 RENDERER: Shaders Initialized Successfully"); @@ -262,7 +413,7 @@ void fx_renderer_begin(struct fx_renderer *renderer, uint32_t width, uint32_t he } void fx_renderer_end() { - + // TODO } void fx_renderer_clear(const float color[static 4]) { @@ -285,7 +436,7 @@ void fx_renderer_scissor(struct wlr_box *box) { bool fx_render_subtexture_with_matrix(struct fx_renderer *renderer, struct wlr_texture *wlr_texture, const struct wlr_fbox *box, - const float matrix[static 9], float alpha) { + const float matrix[static 9], float alpha, int radius) { assert(wlr_texture_is_gles2(wlr_texture)); struct wlr_gles2_texture_attribs texture_attrs; @@ -341,6 +492,7 @@ bool fx_render_subtexture_with_matrix(struct fx_renderer *renderer, glUniformMatrix3fv(shader->proj, 1, GL_FALSE, gl_matrix); glUniform1i(shader->tex, 0); glUniform1f(shader->alpha, alpha); + glUniform1i(shader->discardOpaque, 0); // TODO const GLfloat x1 = box->x / wlr_texture->width; const GLfloat y1 = box->y / wlr_texture->height; @@ -353,6 +505,23 @@ bool fx_render_subtexture_with_matrix(struct fx_renderer *renderer, x1, y2, // bottom left }; + glUniform2f( + glGetUniformLocation(shader->program, "topLeft"), + radius, + radius + ); + glUniform2f( + glGetUniformLocation(shader->program, "bottomRight"), + wlr_texture->width - radius, + wlr_texture->height - radius + ); + glUniform2f( + glGetUniformLocation(shader->program, "fullSize"), + wlr_texture->width, + wlr_texture->height + ); + glUniform1f(glGetUniformLocation(shader->program, "radius"), radius); + glVertexAttribPointer(shader->pos_attrib, 2, GL_FLOAT, GL_FALSE, 0, verts); glVertexAttribPointer(shader->tex_attrib, 2, GL_FLOAT, GL_FALSE, 0, texcoord); @@ -370,14 +539,14 @@ bool fx_render_subtexture_with_matrix(struct fx_renderer *renderer, } bool fx_render_texture_with_matrix(struct fx_renderer *renderer, - struct wlr_texture *wlr_texture, const float matrix[static 9], float alpha) { + struct wlr_texture *wlr_texture, const float matrix[static 9], float alpha, int radius) { struct wlr_fbox box = { .x = 0, .y = 0, .width = wlr_texture->width, .height = wlr_texture->height, }; - return fx_render_subtexture_with_matrix(renderer, wlr_texture, &box, matrix, alpha); + return fx_render_subtexture_with_matrix(renderer, wlr_texture, &box, matrix, alpha, radius); } void fx_render_rect(struct fx_renderer *renderer, const struct wlr_box *box, const float color[static 4], const float projection[static 9]) { diff --git a/sway/desktop/render.c b/sway/desktop/render.c index b7ad1cfa..897a6e9b 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -32,6 +32,7 @@ struct render_data { pixman_region32_t *damage; float alpha; + int corner_radius; struct wlr_box *clip_box; }; @@ -101,7 +102,7 @@ static void set_scale_filter(struct wlr_output *wlr_output, static void render_texture(struct wlr_output *wlr_output, pixman_region32_t *output_damage, struct wlr_texture *texture, const struct wlr_fbox *src_box, const struct wlr_box *dst_box, - const float matrix[static 9], float alpha) { + const float matrix[static 9], float alpha, int corner_radius) { struct sway_output *output = wlr_output->data; struct fx_renderer *renderer = output->server->renderer; @@ -121,9 +122,9 @@ static void render_texture(struct wlr_output *wlr_output, scissor_output(wlr_output, &rects[i]); set_scale_filter(wlr_output, texture, output->scale_filter); if (src_box != NULL) { - fx_render_subtexture_with_matrix(renderer, texture, src_box, matrix, alpha); + fx_render_subtexture_with_matrix(renderer, texture, src_box, matrix, alpha, corner_radius); } else { - fx_render_texture_with_matrix(renderer, texture, matrix, alpha); + fx_render_texture_with_matrix(renderer, texture, matrix, alpha, corner_radius); } } @@ -138,6 +139,7 @@ static void render_surface_iterator(struct sway_output *output, struct wlr_output *wlr_output = output->wlr_output; pixman_region32_t *output_damage = data->damage; float alpha = data->alpha; + int corner_radius = data->corner_radius; struct wlr_texture *texture = wlr_surface_get_texture(surface); if (!texture) { @@ -164,7 +166,7 @@ static void render_surface_iterator(struct sway_output *output, } scale_box(&dst_box, wlr_output->scale); - render_texture(wlr_output, output_damage, texture, &src_box, &dst_box, matrix, alpha); + render_texture(wlr_output, output_damage, texture, &src_box, &dst_box, matrix, alpha, corner_radius); wlr_presentation_surface_sampled_on_output(server.presentation, surface, wlr_output); @@ -175,6 +177,7 @@ static void render_layer_toplevel(struct sway_output *output, struct render_data data = { .damage = damage, .alpha = 1.0f, + .corner_radius = 0, }; output_layer_for_each_toplevel_surface(output, layer_surfaces, render_surface_iterator, &data); @@ -185,6 +188,7 @@ static void render_layer_popups(struct sway_output *output, struct render_data data = { .damage = damage, .alpha = 1.0f, + .corner_radius = 0, }; output_layer_for_each_popup_surface(output, layer_surfaces, render_surface_iterator, &data); @@ -196,6 +200,7 @@ static void render_unmanaged(struct sway_output *output, struct render_data data = { .damage = damage, .alpha = 1.0f, + .corner_radius = 0, }; output_unmanaged_for_each_surface(output, unmanaged, render_surface_iterator, &data); @@ -207,6 +212,7 @@ static void render_drag_icons(struct sway_output *output, struct render_data data = { .damage = damage, .alpha = 1.0f, + .corner_radius = 0, }; output_drag_icons_for_each_surface(output, drag_icons, render_surface_iterator, &data); @@ -255,10 +261,11 @@ void premultiply_alpha(float color[4], float opacity) { } static void render_view_toplevels(struct sway_view *view, - struct sway_output *output, pixman_region32_t *damage, float alpha) { + struct sway_output *output, pixman_region32_t *damage, float alpha, int corner_radius) { struct render_data data = { .damage = damage, .alpha = alpha, + .corner_radius = corner_radius, }; struct wlr_box clip_box; if (!container_is_current_floating(view->container)) { @@ -282,13 +289,14 @@ static void render_view_popups(struct sway_view *view, struct render_data data = { .damage = damage, .alpha = alpha, + .corner_radius = config->corner_radius, }; output_view_for_each_popup_surface(output, view, render_surface_iterator, &data); } static void render_saved_view(struct sway_view *view, - struct sway_output *output, pixman_region32_t *damage, float alpha) { + struct sway_output *output, pixman_region32_t *damage, float alpha, int corner_radius) { struct wlr_output *wlr_output = output->wlr_output; if (wl_list_empty(&view->saved_buffers)) { @@ -340,7 +348,7 @@ static void render_saved_view(struct sway_view *view, scale_box(&dst_box, wlr_output->scale); render_texture(wlr_output, damage, saved_buf->buffer->texture, - &saved_buf->source_box, &dst_box, matrix, alpha); + &saved_buf->source_box, &dst_box, matrix, alpha, corner_radius); } // FIXME: we should set the surface that this saved buffer originates from @@ -355,9 +363,9 @@ static void render_view(struct sway_output *output, pixman_region32_t *damage, struct sway_container *con, struct border_colors *colors) { struct sway_view *view = con->view; if (!wl_list_empty(&view->saved_buffers)) { - render_saved_view(view, output, damage, view->container->alpha); + render_saved_view(view, output, damage, view->container->alpha, config->corner_radius); } else if (view->surface) { - render_view_toplevels(view, output, damage, view->container->alpha); + render_view_toplevels(view, output, damage, view->container->alpha, config->corner_radius); } if (con->current.border == B_NONE || con->current.border == B_CSD) { @@ -521,7 +529,7 @@ static void render_titlebar(struct sway_output *output, texture_box.width = ob_inner_width; } render_texture(output->wlr_output, output_damage, marks_texture, - NULL, &texture_box, matrix, con->alpha); + NULL, &texture_box, matrix, con->alpha, 0); // Padding above memcpy(&color, colors->background, sizeof(float) * 4); @@ -597,7 +605,7 @@ static void render_titlebar(struct sway_output *output, } render_texture(output->wlr_output, output_damage, title_texture, - NULL, &texture_box, matrix, con->alpha); + NULL, &texture_box, matrix, con->alpha, 0); // Padding above memcpy(&color, colors->background, sizeof(float) * 4); @@ -1073,10 +1081,10 @@ void output_render(struct sway_output *output, struct timespec *when, if (fullscreen_con->view) { if (!wl_list_empty(&fullscreen_con->view->saved_buffers)) { - render_saved_view(fullscreen_con->view, output, damage, 1.0f); + render_saved_view(fullscreen_con->view, output, damage, 1.0f, 0); } else if (fullscreen_con->view->surface) { render_view_toplevels(fullscreen_con->view, - output, damage, 1.0f); + output, damage, 1.0f, 0); } } else { render_container(output, damage, fullscreen_con, diff --git a/sway/meson.build b/sway/meson.build index 68c0a14f..46aa0d0a 100644 --- a/sway/meson.build +++ b/sway/meson.build @@ -1,238 +1,239 @@ sway_sources = files( - 'commands.c', - 'config.c', - 'criteria.c', - 'decoration.c', - 'ipc-json.c', - 'ipc-server.c', - 'main.c', - 'server.c', - 'swaynag.c', - 'xdg_activation_v1.c', - 'xdg_decoration.c', + 'commands.c', + 'config.c', + 'criteria.c', + 'decoration.c', + 'ipc-json.c', + 'ipc-server.c', + 'main.c', + 'server.c', + 'swaynag.c', + 'xdg_activation_v1.c', + 'xdg_decoration.c', - 'desktop/desktop.c', - 'desktop/fx_renderer.c', - 'desktop/idle_inhibit_v1.c', - 'desktop/layer_shell.c', - 'desktop/output.c', - 'desktop/render.c', - 'desktop/surface.c', - 'desktop/transaction.c', - 'desktop/xdg_shell.c', + 'desktop/desktop.c', + 'desktop/fx_renderer.c', + 'desktop/idle_inhibit_v1.c', + 'desktop/layer_shell.c', + 'desktop/output.c', + 'desktop/render.c', + 'desktop/surface.c', + 'desktop/transaction.c', + 'desktop/xdg_shell.c', - 'input/input-manager.c', - 'input/cursor.c', - 'input/keyboard.c', - 'input/libinput.c', - 'input/seat.c', - 'input/seatop_default.c', - 'input/seatop_down.c', - 'input/seatop_move_floating.c', - 'input/seatop_move_tiling.c', - 'input/seatop_resize_floating.c', - 'input/seatop_resize_tiling.c', - 'input/switch.c', - 'input/tablet.c', - 'input/text_input.c', + 'input/input-manager.c', + 'input/cursor.c', + 'input/keyboard.c', + 'input/libinput.c', + 'input/seat.c', + 'input/seatop_default.c', + 'input/seatop_down.c', + 'input/seatop_move_floating.c', + 'input/seatop_move_tiling.c', + 'input/seatop_resize_floating.c', + 'input/seatop_resize_tiling.c', + 'input/switch.c', + 'input/tablet.c', + 'input/text_input.c', - 'config/bar.c', - 'config/output.c', - 'config/seat.c', - 'config/input.c', + 'config/bar.c', + 'config/output.c', + 'config/seat.c', + 'config/input.c', - 'commands/assign.c', - 'commands/bar.c', - 'commands/bind.c', - 'commands/border.c', - 'commands/client.c', - 'commands/create_output.c', - 'commands/default_border.c', - 'commands/default_floating_border.c', - 'commands/default_orientation.c', - 'commands/exit.c', - 'commands/exec.c', - 'commands/exec_always.c', - 'commands/floating.c', - 'commands/floating_minmax_size.c', - 'commands/floating_modifier.c', - 'commands/focus.c', - 'commands/focus_follows_mouse.c', - 'commands/focus_on_window_activation.c', - 'commands/focus_wrapping.c', - 'commands/font.c', - 'commands/for_window.c', - 'commands/force_display_urgency_hint.c', - 'commands/force_focus_wrapping.c', - 'commands/fullscreen.c', - 'commands/gaps.c', - 'commands/hide_edge_borders.c', - 'commands/inhibit_idle.c', - 'commands/kill.c', - 'commands/mark.c', - 'commands/max_render_time.c', - 'commands/opacity.c', - 'commands/include.c', - 'commands/input.c', - 'commands/layout.c', - 'commands/mode.c', - 'commands/mouse_warping.c', - 'commands/move.c', - 'commands/new_float.c', - 'commands/new_window.c', - 'commands/no_focus.c', - 'commands/nop.c', - 'commands/output.c', - 'commands/popup_during_fullscreen.c', - 'commands/reload.c', - 'commands/rename.c', - 'commands/resize.c', - 'commands/scratchpad.c', - 'commands/seat.c', - 'commands/seat/attach.c', - 'commands/seat/cursor.c', - 'commands/seat/fallback.c', - 'commands/seat/hide_cursor.c', - 'commands/seat/idle.c', - 'commands/seat/keyboard_grouping.c', - 'commands/seat/pointer_constraint.c', - 'commands/seat/shortcuts_inhibitor.c', - 'commands/seat/xcursor_theme.c', - 'commands/set.c', - 'commands/show_marks.c', - 'commands/shortcuts_inhibitor.c', - 'commands/smart_borders.c', - 'commands/smart_gaps.c', - 'commands/split.c', - 'commands/sticky.c', - 'commands/swaybg_command.c', - 'commands/swaynag_command.c', - 'commands/swap.c', - 'commands/tiling_drag.c', - 'commands/tiling_drag_threshold.c', - 'commands/title_align.c', - 'commands/title_format.c', - 'commands/titlebar_border_thickness.c', - 'commands/titlebar_padding.c', - 'commands/unmark.c', - 'commands/urgent.c', - 'commands/workspace.c', - 'commands/workspace_layout.c', - 'commands/ws_auto_back_and_forth.c', - 'commands/xwayland.c', + 'commands/assign.c', + 'commands/bar.c', + 'commands/bind.c', + 'commands/border.c', + 'commands/client.c', + 'commands/corner_radius.c', + 'commands/create_output.c', + 'commands/default_border.c', + 'commands/default_floating_border.c', + 'commands/default_orientation.c', + 'commands/exit.c', + 'commands/exec.c', + 'commands/exec_always.c', + 'commands/floating.c', + 'commands/floating_minmax_size.c', + 'commands/floating_modifier.c', + 'commands/focus.c', + 'commands/focus_follows_mouse.c', + 'commands/focus_on_window_activation.c', + 'commands/focus_wrapping.c', + 'commands/font.c', + 'commands/for_window.c', + 'commands/force_display_urgency_hint.c', + 'commands/force_focus_wrapping.c', + 'commands/fullscreen.c', + 'commands/gaps.c', + 'commands/hide_edge_borders.c', + 'commands/inhibit_idle.c', + 'commands/kill.c', + 'commands/mark.c', + 'commands/max_render_time.c', + 'commands/opacity.c', + 'commands/include.c', + 'commands/input.c', + 'commands/layout.c', + 'commands/mode.c', + 'commands/mouse_warping.c', + 'commands/move.c', + 'commands/new_float.c', + 'commands/new_window.c', + 'commands/no_focus.c', + 'commands/nop.c', + 'commands/output.c', + 'commands/popup_during_fullscreen.c', + 'commands/reload.c', + 'commands/rename.c', + 'commands/resize.c', + 'commands/scratchpad.c', + 'commands/seat.c', + 'commands/seat/attach.c', + 'commands/seat/cursor.c', + 'commands/seat/fallback.c', + 'commands/seat/hide_cursor.c', + 'commands/seat/idle.c', + 'commands/seat/keyboard_grouping.c', + 'commands/seat/pointer_constraint.c', + 'commands/seat/shortcuts_inhibitor.c', + 'commands/seat/xcursor_theme.c', + 'commands/set.c', + 'commands/show_marks.c', + 'commands/shortcuts_inhibitor.c', + 'commands/smart_borders.c', + 'commands/smart_gaps.c', + 'commands/split.c', + 'commands/sticky.c', + 'commands/swaybg_command.c', + 'commands/swaynag_command.c', + 'commands/swap.c', + 'commands/tiling_drag.c', + 'commands/tiling_drag_threshold.c', + 'commands/title_align.c', + 'commands/title_format.c', + 'commands/titlebar_border_thickness.c', + 'commands/titlebar_padding.c', + 'commands/unmark.c', + 'commands/urgent.c', + 'commands/workspace.c', + 'commands/workspace_layout.c', + 'commands/ws_auto_back_and_forth.c', + 'commands/xwayland.c', - 'commands/bar/bind.c', - 'commands/bar/binding_mode_indicator.c', - 'commands/bar/colors.c', - 'commands/bar/font.c', - 'commands/bar/gaps.c', - 'commands/bar/height.c', - 'commands/bar/hidden_state.c', - 'commands/bar/icon_theme.c', - 'commands/bar/id.c', - 'commands/bar/mode.c', - 'commands/bar/modifier.c', - 'commands/bar/output.c', - 'commands/bar/pango_markup.c', - 'commands/bar/position.c', - 'commands/bar/separator_symbol.c', - 'commands/bar/status_command.c', - 'commands/bar/status_edge_padding.c', - 'commands/bar/status_padding.c', - 'commands/bar/strip_workspace_numbers.c', - 'commands/bar/strip_workspace_name.c', - 'commands/bar/swaybar_command.c', - 'commands/bar/tray_bind.c', - 'commands/bar/tray_output.c', - 'commands/bar/tray_padding.c', - 'commands/bar/workspace_buttons.c', - 'commands/bar/workspace_min_width.c', - 'commands/bar/wrap_scroll.c', + 'commands/bar/bind.c', + 'commands/bar/binding_mode_indicator.c', + 'commands/bar/colors.c', + 'commands/bar/font.c', + 'commands/bar/gaps.c', + 'commands/bar/height.c', + 'commands/bar/hidden_state.c', + 'commands/bar/icon_theme.c', + 'commands/bar/id.c', + 'commands/bar/mode.c', + 'commands/bar/modifier.c', + 'commands/bar/output.c', + 'commands/bar/pango_markup.c', + 'commands/bar/position.c', + 'commands/bar/separator_symbol.c', + 'commands/bar/status_command.c', + 'commands/bar/status_edge_padding.c', + 'commands/bar/status_padding.c', + 'commands/bar/strip_workspace_numbers.c', + 'commands/bar/strip_workspace_name.c', + 'commands/bar/swaybar_command.c', + 'commands/bar/tray_bind.c', + 'commands/bar/tray_output.c', + 'commands/bar/tray_padding.c', + 'commands/bar/workspace_buttons.c', + 'commands/bar/workspace_min_width.c', + 'commands/bar/wrap_scroll.c', - 'commands/input/accel_profile.c', - 'commands/input/calibration_matrix.c', - 'commands/input/click_method.c', - 'commands/input/drag.c', - 'commands/input/drag_lock.c', - 'commands/input/dwt.c', - 'commands/input/events.c', - 'commands/input/left_handed.c', - 'commands/input/map_from_region.c', - 'commands/input/map_to_output.c', - 'commands/input/map_to_region.c', - 'commands/input/middle_emulation.c', - 'commands/input/natural_scroll.c', - 'commands/input/pointer_accel.c', - 'commands/input/repeat_delay.c', - 'commands/input/repeat_rate.c', - 'commands/input/scroll_button.c', - 'commands/input/scroll_factor.c', - 'commands/input/scroll_method.c', - 'commands/input/tap.c', - 'commands/input/tap_button_map.c', - 'commands/input/tool_mode.c', - 'commands/input/xkb_capslock.c', - 'commands/input/xkb_file.c', - 'commands/input/xkb_layout.c', - 'commands/input/xkb_model.c', - 'commands/input/xkb_numlock.c', - 'commands/input/xkb_options.c', - 'commands/input/xkb_rules.c', - 'commands/input/xkb_switch_layout.c', - 'commands/input/xkb_variant.c', + 'commands/input/accel_profile.c', + 'commands/input/calibration_matrix.c', + 'commands/input/click_method.c', + 'commands/input/drag.c', + 'commands/input/drag_lock.c', + 'commands/input/dwt.c', + 'commands/input/events.c', + 'commands/input/left_handed.c', + 'commands/input/map_from_region.c', + 'commands/input/map_to_output.c', + 'commands/input/map_to_region.c', + 'commands/input/middle_emulation.c', + 'commands/input/natural_scroll.c', + 'commands/input/pointer_accel.c', + 'commands/input/repeat_delay.c', + 'commands/input/repeat_rate.c', + 'commands/input/scroll_button.c', + 'commands/input/scroll_factor.c', + 'commands/input/scroll_method.c', + 'commands/input/tap.c', + 'commands/input/tap_button_map.c', + 'commands/input/tool_mode.c', + 'commands/input/xkb_capslock.c', + 'commands/input/xkb_file.c', + 'commands/input/xkb_layout.c', + 'commands/input/xkb_model.c', + 'commands/input/xkb_numlock.c', + 'commands/input/xkb_options.c', + 'commands/input/xkb_rules.c', + 'commands/input/xkb_switch_layout.c', + 'commands/input/xkb_variant.c', - 'commands/output/adaptive_sync.c', - 'commands/output/background.c', - 'commands/output/disable.c', - 'commands/output/dpms.c', - 'commands/output/enable.c', - 'commands/output/max_render_time.c', - 'commands/output/mode.c', - 'commands/output/position.c', - 'commands/output/render_bit_depth.c', - 'commands/output/scale.c', - 'commands/output/scale_filter.c', - 'commands/output/subpixel.c', - 'commands/output/toggle.c', - 'commands/output/transform.c', + 'commands/output/adaptive_sync.c', + 'commands/output/background.c', + 'commands/output/disable.c', + 'commands/output/dpms.c', + 'commands/output/enable.c', + 'commands/output/max_render_time.c', + 'commands/output/mode.c', + 'commands/output/position.c', + 'commands/output/render_bit_depth.c', + 'commands/output/scale.c', + 'commands/output/scale_filter.c', + 'commands/output/subpixel.c', + 'commands/output/toggle.c', + 'commands/output/transform.c', - 'tree/arrange.c', - 'tree/container.c', - 'tree/node.c', - 'tree/root.c', - 'tree/view.c', - 'tree/workspace.c', - 'tree/output.c', + 'tree/arrange.c', + 'tree/container.c', + 'tree/node.c', + 'tree/root.c', + 'tree/view.c', + 'tree/workspace.c', + 'tree/output.c', ) sway_deps = [ - cairo, - drm, - jsonc, - libevdev, - libinput, - libudev, - math, - pango, - pcre, - glesv2, - pixman, - server_protos, - wayland_server, - wlroots, - xkbcommon, + cairo, + drm, + jsonc, + libevdev, + libinput, + libudev, + math, + pango, + pcre, + glesv2, + pixman, + server_protos, + wayland_server, + wlroots, + xkbcommon, ] if have_xwayland - sway_sources += 'desktop/xwayland.c' - sway_deps += xcb + sway_sources += 'desktop/xwayland.c' + sway_deps += xcb endif executable( - 'sway', - sway_sources, - include_directories: [sway_inc], - dependencies: sway_deps, - link_with: [lib_sway_common], - install: true + 'sway', + sway_sources, + include_directories: [sway_inc], + dependencies: sway_deps, + link_with: [lib_sway_common], + install: true )