diff --git a/README.md b/README.md index a1646e7b..2b670070 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@
-# SwayFX: A Beautiful Sway Fork +![swayfx logo](assets/swayfx_logo.svg) + +
https://discord.gg/qsSx397rkh
-![swayfx_screenshot](assets/swayfx_screenshot.jpg) +![swayfx screenshot](assets/swayfx_screenshot.jpg) Sway is an incredible window manager, and certainly one of the most well established wayland window managers. However, it is restricted to only include the functionality that existed in i3. This fork ditches the simple wlr_renderer, and replaces it with our fx_renderer, capable of rendering with fancy GLES2 effects. This, along with a couple of minor changes, expands sway's featureset to include the following: + **Blur** @@ -17,6 +19,13 @@ Sway is an incredible window manager, and certainly one of the most well establi + **Scratchpad treated as minimize**: Allows docks, or panels with a taskbar, to correctly interpret minimize / unminimize requests ([thanks to LCBCrion](https://github.com/swaywm/sway/issues/6457)) + **nixify the repo**: Allows nixos users to easily contribute to and test this project + + + + + +[SwayFX is also available on the Fedora copr](https://copr.fedorainfracloud.org/coprs/swayfx/swayfx/) + ## New Configuration Options + Window blur: @@ -54,11 +63,7 @@ Sway is an incredible window manager, and certainly one of the most well establi + fade in / out animations + window movement animations -## Installation - -[![Packaging status](https://repology.org/badge/vertical-allrepos/swayfx.svg)](https://repology.org/project/swayfx/versions) - -[SwayFX is also available on the Fedora copr](https://copr.fedorainfracloud.org/coprs/swayfx/swayfx/) +## Compiling From Source ### Nix @@ -75,7 +80,7 @@ You can also bring up a development shell and follow the build instructions belo nix develop ``` -### Compiling from Source +### Manual Steps Install dependencies: @@ -114,3 +119,14 @@ Here's a quick outline of where most of our changes lie vs the main sway reposit + `sway/desktop/render.c`: the file that handles calling `fx_renderer` to render to the screen, handles damage tracking and scaling + `sway/desktop/fx_renderer.c`: the meat and potatoes of this project, structured as similarly to wlr_renderer as possible + `sway/desktop/shaders`: where all of the shaders that fx_renderer uses live + +## Acknowledgements + +The SwayFX team would like to first and foremost thank the maintainers and contributors of the Sway window manager. We are but a humble group of Sway enthusiasts who wanted to expand upon your creation. + +We would also like to thank the talented artists in our community for contibuting the visual assets that give this project charm: ++ pkdesuwu and honchokomodo for creating the swayfx mascot: https://twitter.com/pkdesuwu/status/1664517033017368576 ++ spooky_skeleton for the swayfx logo, and basil.cafe for making some fine adjustments to it + +Lastly, we would like to thank you, the community, for enjoying and using window manager that we have spent so much time maintaining. + diff --git a/assets/swayfx_logo.svg b/assets/swayfx_logo.svg new file mode 100644 index 00000000..c4d5024d --- /dev/null +++ b/assets/swayfx_logo.svg @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/swayfx_mascot.png b/assets/swayfx_mascot.png new file mode 100644 index 00000000..717a05a5 Binary files /dev/null and b/assets/swayfx_mascot.png differ diff --git a/assets/swayfx_screenshot.jpg b/assets/swayfx_screenshot.jpg index afd86ed5..016641cd 100644 Binary files a/assets/swayfx_screenshot.jpg and b/assets/swayfx_screenshot.jpg differ diff --git a/build-scripts/aur/PKGBUILD b/build-scripts/aur/PKGBUILD index a3f39349..06406a36 100644 --- a/build-scripts/aur/PKGBUILD +++ b/build-scripts/aur/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Erik Reider _pkgname=swayfx pkgname="$_pkgname" -pkgver=0.3.1 +pkgver=0.3.2 pkgrel=1 license=("MIT") pkgdesc="SwayFX: Sway, but with eye candy!" diff --git a/build-scripts/swayfx.rpkg.spec b/build-scripts/swayfx.rpkg.spec index 418db3b9..684a22a8 100644 --- a/build-scripts/swayfx.rpkg.spec +++ b/build-scripts/swayfx.rpkg.spec @@ -4,7 +4,7 @@ # Change to current Sway base version! %global SwayBaseVersion 1.8.1 # Change to current SwayFX tag! -%global Tag 0.3.1 +%global Tag 0.3.2 Name: {{{ git_dir_name }}} Version: %{Tag} diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 9d468612..7b52aa4b 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -378,4 +378,6 @@ bool view_is_transient_for(struct sway_view *child, struct sway_view *ancestor); void view_assign_ctx(struct sway_view *view, struct launcher_ctx *ctx); +bool gaps_to_edge(struct sway_view *view); + #endif diff --git a/meson.build b/meson.build index 3332128a..74637d84 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'sway', 'c', - version: '0.3.1', + version: '0.3.2', license: 'MIT', meson_version: '>=0.60.0', default_options: [ diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 2b3f767e..02534b48 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -702,12 +702,27 @@ static void render_view_toplevels(struct sway_view *view, struct sway_output *ou clip_box.y = state.y - output->ly; clip_box.width = state.width; clip_box.height = state.height; + + bool smart = config->hide_edge_borders_smart == ESMART_ON || + (config->hide_edge_borders_smart == ESMART_NO_GAPS && + !gaps_to_edge(view)); + if (state.fullscreen_mode == FULLSCREEN_NONE - && (state.border == B_PIXEL || state.border == B_NORMAL)) { + && (state.border == B_PIXEL || state.border == B_NORMAL) + && !smart) { clip_box.x += state.border_thickness; - clip_box.y += state.border_thickness; clip_box.width -= state.border_thickness * 2; - clip_box.height -= state.border_thickness * 2; + + if (deco_data.has_titlebar) { + // Shift the box downward to compensate for the titlebar + int titlebar_thickness = container_titlebar_height(); + clip_box.y += titlebar_thickness; + clip_box.height -= state.border_thickness + titlebar_thickness; + } else { + // Regular border + clip_box.y += state.border_thickness; + clip_box.height -= state.border_thickness * 2; + } } data.clip_box = &clip_box; @@ -770,9 +785,18 @@ static void render_saved_view(struct sway_view *view, struct sway_output *output dst_box.height = state.height; if (state.border == B_PIXEL || state.border == B_NORMAL) { dst_box.x += state.border_thickness; - dst_box.y += state.border_thickness; dst_box.width -= state.border_thickness * 2; - dst_box.height -= state.border_thickness * 2; + + if (deco_data.has_titlebar) { + // Shift the box downward to compensate for the titlebar + int titlebar_thickness = container_titlebar_height(); + dst_box.y += titlebar_thickness; + dst_box.height -= state.border_thickness + titlebar_thickness; + } else { + // Regular border + dst_box.y += state.border_thickness; + dst_box.height -= state.border_thickness * 2; + } } scale_box(&dst_box, wlr_output->scale); @@ -1533,7 +1557,7 @@ static void render_containers_stacked(struct sway_output *output, struct decoration_data deco_data = { .alpha = current->alpha, - .dim_color = view_is_urgent(current->view) + .dim_color = current->view && view_is_urgent(current->view) ? config->dim_inactive_colors.urgent : config->dim_inactive_colors.unfocused, .dim = current->current.focused || parent->focused ? 0.0f : current->dim, diff --git a/sway/tree/view.c b/sway/tree/view.c index b66dc2f8..272967f4 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -233,7 +233,7 @@ static bool view_is_only_visible(struct sway_view *view) { return true; } -static bool gaps_to_edge(struct sway_view *view) { +bool gaps_to_edge(struct sway_view *view) { struct side_gaps gaps = view->container->pending.workspace->current_gaps; return gaps.top > 0 || gaps.right > 0 || gaps.bottom > 0 || gaps.left > 0; }