mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2026-11-04 04:03:18 +00:00
Compare commits
6
Commits
8a28588683
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28f91b0326 | ||
|
|
3360d3acf7 | ||
|
|
730f15e95e | ||
|
|
9e89b5823f | ||
|
|
78e632455b | ||
|
|
ae0fe9e212 |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -2,8 +2,10 @@
|
||||
Implement `foreign-toplevel-management`, it add handlers for activate, close, fullscreen and destroy request events, it's missing minimize and maximize request handlers.
|
||||
|
||||
### Download
|
||||
- [git branch](https://codeberg.org/wochap/dwl/src/branch/v0.6-a/foreign-toplevel-management)
|
||||
- [git branch](https://codeberg.org/guidocella/dwl/src/branch/foreign-toplevel-management)
|
||||
- [2026-10-20](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/foreign-toplevel-management/foreign-toplevel-management.patch)
|
||||
- [2024-05-02](https://codeberg.org/dwl/dwl-patches/raw/commit/e58c3ec41a39df934d2998161d7187ac965ea77a/foreign-toplevel-management/foreign-toplevel-management.patch)
|
||||
|
||||
### Authors
|
||||
- [wochap](https://codeberg.org/wochap)
|
||||
- [wochap](https://codeberg.org/wochap)
|
||||
- [Guido Cella](https://codeberg.org/guidocella)
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
From dc63d64cd69f515013464b3feb8acb411f5a348f Mon Sep 17 00:00:00 2001
|
||||
From 7820c6ca511de2fc41ab5bcf74dc0a5e0803d33f Mon Sep 17 00:00:00 2001
|
||||
From: wochap <gean.marroquin@gmail.com>
|
||||
Date: Thu, 2 May 2024 17:25:45 -0500
|
||||
Date: Thu, 17 Sep 2026 08:22:59 +0200
|
||||
Subject: [PATCH] implement foreign toplevel management
|
||||
|
||||
---
|
||||
Makefile | 5 +-
|
||||
dwl.c | 93 +++++-
|
||||
dwl.c | 95 +++++-
|
||||
...oreign-toplevel-management-unstable-v1.xml | 270 ++++++++++++++++++
|
||||
3 files changed, 366 insertions(+), 2 deletions(-)
|
||||
3 files changed, 367 insertions(+), 3 deletions(-)
|
||||
create mode 100644 protocols/wlr-foreign-toplevel-management-unstable-v1.xml
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index a67fdd3..e0e1260 100644
|
||||
index 8304245..cfbc0e0 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -16,7 +16,7 @@ LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS)
|
||||
all: dwl
|
||||
dwl: dwl.o util.o
|
||||
$(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
|
||||
-dwl.o: dwl.c config.mk config.h client.h cursor-shape-v1-protocol.h pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h xdg-shell-protocol.h
|
||||
+dwl.o: dwl.c config.mk config.h client.h cursor-shape-v1-protocol.h pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h xdg-shell-protocol.h wlr-foreign-toplevel-management-unstable-v1-protocol.h
|
||||
util.o: util.c util.h
|
||||
@@ -20,7 +20,7 @@ all: dwl
|
||||
dwl: dwl.c client.h config.h ime.h util.h config.mk cursor-shape-v1-protocol.h \
|
||||
ext-image-copy-capture-v1-protocol.h \
|
||||
pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h \
|
||||
- wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h
|
||||
+ wlr-foreign-toplevel-management-unstable-v1-protocol.h wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h
|
||||
$(CC) dwl.c $(DWLCFLAGS) $(LDFLAGS) $(LDLIBS) -o $@
|
||||
|
||||
# wayland-scanner is a tool which generates C headers and rigging for Wayland
|
||||
@@ -37,6 +37,9 @@ wlr-layer-shell-unstable-v1-protocol.h:
|
||||
@@ -47,6 +47,9 @@ wlr-output-power-management-unstable-v1-protocol.h:
|
||||
xdg-shell-protocol.h:
|
||||
$(WAYLAND_SCANNER) server-header \
|
||||
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
|
||||
@@ -34,18 +34,18 @@ index a67fdd3..e0e1260 100644
|
||||
config.h:
|
||||
cp config.def.h $@
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index bf763df..648616d 100644
|
||||
index 89e8caf..006c615 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <wlr/types/wlr_data_device.h>
|
||||
#include <wlr/types/wlr_drm.h>
|
||||
#include <wlr/types/wlr_export_dmabuf_v1.h>
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <wlr/types/wlr_ext_image_capture_source_v1.h>
|
||||
#include <wlr/types/wlr_ext_image_copy_capture_v1.h>
|
||||
#include <wlr/types/wlr_ext_foreign_toplevel_list_v1.h>
|
||||
+#include <wlr/types/wlr_foreign_toplevel_management_v1.h>
|
||||
#include <wlr/types/wlr_fractional_scale_v1.h>
|
||||
#include <wlr/types/wlr_gamma_control_v1.h>
|
||||
#include <wlr/types/wlr_idle_inhibit_v1.h>
|
||||
@@ -126,6 +127,11 @@ typedef struct {
|
||||
@@ -151,6 +152,11 @@ typedef struct {
|
||||
struct wl_listener fullscreen;
|
||||
struct wl_listener set_decoration_mode;
|
||||
struct wl_listener destroy_decoration;
|
||||
@@ -54,10 +54,10 @@ index bf763df..648616d 100644
|
||||
+ struct wl_listener fclose;
|
||||
+ struct wl_listener ffullscreen;
|
||||
+ struct wl_listener fdestroy;
|
||||
struct wlr_box prev; /* layout-relative, includes border */
|
||||
struct wlr_box bounds;
|
||||
#ifdef XWAYLAND
|
||||
@@ -347,6 +353,11 @@ static Monitor *xytomon(double x, double y);
|
||||
struct wl_listener activate;
|
||||
struct wl_listener associate;
|
||||
@@ -387,8 +393,14 @@ static Monitor *xytomon(double x, double y);
|
||||
static void xytonode(double x, double y, struct wlr_surface **psurface,
|
||||
Client **pc, LayerSurface **pl, double *nx, double *ny);
|
||||
static void zoom(const Arg *arg);
|
||||
@@ -68,19 +68,22 @@ index bf763df..648616d 100644
|
||||
+static void ffullscreennotify(struct wl_listener *listener, void *data);
|
||||
|
||||
/* variables */
|
||||
static const char broken[] = "broken";
|
||||
@@ -392,6 +403,8 @@ static struct wlr_scene_rect *locked_bg;
|
||||
+static const char broken[] = "broken";
|
||||
static pid_t child_pid = -1;
|
||||
static int locked;
|
||||
static Client *focused_client;
|
||||
@@ -433,6 +445,8 @@ static struct wlr_session_lock_manager_v1 *session_lock_mgr;
|
||||
static struct wlr_scene_rect *locked_bg;
|
||||
static struct wlr_session_lock_v1 *cur_lock;
|
||||
static struct wl_listener lock_listener = {.notify = locksession};
|
||||
|
||||
+static struct wlr_foreign_toplevel_manager_v1 *foreign_toplevel_mgr;
|
||||
+
|
||||
static struct wlr_seat *seat;
|
||||
static KeyboardGroup kb_group = {0};
|
||||
static KeyboardGroup vkb_group = {0};
|
||||
@@ -458,6 +471,11 @@ applyrules(Client *c)
|
||||
if (!(title = client_get_title(c)))
|
||||
title = broken;
|
||||
static KeyboardGroup *kb_group;
|
||||
static unsigned int cursor_mode;
|
||||
@@ -588,6 +602,11 @@ applyrules(Client *c)
|
||||
appid = client_get_appid(c);
|
||||
title = client_get_title(c);
|
||||
|
||||
+ if (c->foreign_toplevel) {
|
||||
+ wlr_foreign_toplevel_handle_v1_set_app_id(c->foreign_toplevel, appid);
|
||||
@@ -90,34 +93,35 @@ index bf763df..648616d 100644
|
||||
for (r = rules; r < END(rules); r++) {
|
||||
if ((!r->title || strstr(title, r->title))
|
||||
&& (!r->id || strstr(appid, r->id))) {
|
||||
@@ -1288,6 +1306,8 @@ focusclient(Client *c, int lift)
|
||||
client_set_border_color(old_c, bordercolor);
|
||||
|
||||
client_activate_surface(old, 0);
|
||||
+ if (old_c->foreign_toplevel)
|
||||
+ wlr_foreign_toplevel_handle_v1_set_activated(old_c->foreign_toplevel, 0);
|
||||
}
|
||||
@@ -1631,6 +1650,8 @@ focusclient(Client *c, LayerSurface *l, int lift)
|
||||
if (s && s->mapped)
|
||||
client_activate_surface(s, 0);
|
||||
focused_client = NULL;
|
||||
+ if (old_c && old_c->foreign_toplevel)
|
||||
+ wlr_foreign_toplevel_handle_v1_set_activated(old_c->foreign_toplevel, 0);
|
||||
}
|
||||
printstatus();
|
||||
@@ -1306,6 +1326,8 @@ focusclient(Client *c, int lift)
|
||||
|
||||
/* Activate the new client */
|
||||
client_activate_surface(client_surface(c), 1);
|
||||
@@ -1653,6 +1674,9 @@ focusclient(Client *c, LayerSurface *l, int lift)
|
||||
|
||||
if (!client_is_unmanaged(c))
|
||||
focused_client = c;
|
||||
+
|
||||
+ if (c->foreign_toplevel)
|
||||
+ wlr_foreign_toplevel_handle_v1_set_activated(c->foreign_toplevel, 1);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1599,6 +1621,8 @@ mapnotify(struct wl_listener *listener, void *data)
|
||||
@@ -1975,6 +1999,8 @@ mapnotify(struct wl_listener *listener, void *data)
|
||||
c->border[i]->node.data = c;
|
||||
}
|
||||
|
||||
+ createforeigntoplevel(c);
|
||||
+
|
||||
/* Initialize client geometry with room for border */
|
||||
client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT | WLR_EDGE_RIGHT);
|
||||
c->geom.width += 2 * c->bw;
|
||||
@@ -2232,12 +2256,17 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
|
||||
client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT |
|
||||
WLR_EDGE_RIGHT);
|
||||
@@ -2661,12 +2687,17 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
|
||||
c->prev = c->geom;
|
||||
|
||||
/* Scene graph sends surface leave/enter events on move and resize */
|
||||
@@ -136,29 +140,28 @@ index bf763df..648616d 100644
|
||||
setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
|
||||
setfloating(c, c->isfloating);
|
||||
}
|
||||
@@ -2351,6 +2380,9 @@ setup(void)
|
||||
gamma_control_mgr = wlr_gamma_control_manager_v1_create(dpy);
|
||||
LISTEN_STATIC(&gamma_control_mgr->events.set_gamma, setgamma);
|
||||
@@ -2806,7 +2837,10 @@ setup(void)
|
||||
power_mgr = wlr_output_power_manager_v1_create(dpy);
|
||||
wl_signal_add(&power_mgr->events.set_mode, &output_power_mgr_set_mode);
|
||||
|
||||
- /* Creates an output layout, which is a wlroots utility for working with an
|
||||
+ /* Initializes foreign toplevel management */
|
||||
+ foreign_toplevel_mgr = wlr_foreign_toplevel_manager_v1_create(dpy);
|
||||
+
|
||||
/* Creates an output layout, which a wlroots utility for working with an
|
||||
+ /* Creates an output layout, which a wlroots utility for working with an
|
||||
* arrangement of screens in a physical layout. */
|
||||
output_layout = wlr_output_layout_create();
|
||||
@@ -2691,6 +2723,11 @@ unmapnotify(struct wl_listener *listener, void *data)
|
||||
wl_list_remove(&c->flink);
|
||||
output_layout = wlr_output_layout_create(dpy);
|
||||
wl_signal_add(&output_layout->events.change, &layout_change);
|
||||
@@ -3261,6 +3295,8 @@ unmapnotify(struct wl_listener *listener, void *data)
|
||||
wlr_ext_foreign_toplevel_handle_v1_destroy(c->foreign_toplevel_handle);
|
||||
c->foreign_toplevel_handle = NULL;
|
||||
}
|
||||
|
||||
+ if (c->foreign_toplevel) {
|
||||
+ if (c->foreign_toplevel)
|
||||
+ wlr_foreign_toplevel_handle_v1_destroy(c->foreign_toplevel);
|
||||
+ c->foreign_toplevel = NULL;
|
||||
+ }
|
||||
+
|
||||
wlr_scene_node_destroy(&c->scene->node);
|
||||
printstatus();
|
||||
motionnotify(0, NULL, 0, 0, 0, 0);
|
||||
@@ -2802,6 +2839,12 @@ void
|
||||
#ifdef XWAYLAND
|
||||
if (c->type != XDGShell && c->capture.image_capture_scene_surface) {
|
||||
wlr_scene_node_destroy(&c->capture.image_capture_scene_surface->buffer->node);
|
||||
@@ -3393,6 +3429,12 @@ void
|
||||
updatetitle(struct wl_listener *listener, void *data)
|
||||
{
|
||||
Client *c = wl_container_of(listener, c, set_title);
|
||||
@@ -170,8 +173,8 @@ index bf763df..648616d 100644
|
||||
+ }
|
||||
if (c == focustop(c->mon))
|
||||
printstatus();
|
||||
}
|
||||
@@ -2929,6 +2972,54 @@ zoom(const Arg *arg)
|
||||
|
||||
@@ -3531,6 +3573,55 @@ zoom(const Arg *arg)
|
||||
arrange(selmon);
|
||||
}
|
||||
|
||||
@@ -195,7 +198,7 @@ index bf763df..648616d 100644
|
||||
+ } else {
|
||||
+ setmon(c, selmon, 0);
|
||||
+ }
|
||||
+ focusclient(c, 1);
|
||||
+ focusclient(c, NULL, 1);
|
||||
+ arrange(c->mon);
|
||||
+}
|
||||
+
|
||||
@@ -221,6 +224,7 @@ index bf763df..648616d 100644
|
||||
+ wl_list_remove(&c->fclose.link);
|
||||
+ wl_list_remove(&c->ffullscreen.link);
|
||||
+ wl_list_remove(&c->fdestroy.link);
|
||||
+ c->foreign_toplevel = NULL;
|
||||
+}
|
||||
+
|
||||
#ifdef XWAYLAND
|
||||
@@ -503,5 +507,5 @@ index 0000000..44505bb
|
||||
+ </interface>
|
||||
+</protocol>
|
||||
--
|
||||
2.43.2
|
||||
2.56.0
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
### Description
|
||||
|
||||
Implement rounded corners, shadows and blur with [scenefx](https://github.com/wlrfx/scenefx) 0.5.
|
||||
|
||||
- [git branch](https://codeberg.org/guidocella/dwl/src/branch/scenefx)
|
||||
- [2026-10-29](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/scenefx/scenefx.patch)
|
||||
- [v0.5](https://codeberg.org/dwl/dwl-patches/raw/commit/7a5c3420822074c544fa102e030b7c30aa6b6be8/scenefx/scenefx.patch)
|
||||
|
||||
### Authors
|
||||
|
||||
- [wochap](https://codeberg.org/wochap)
|
||||
- [Guido Cella](https://codeberg.org/guidocella)
|
||||
@@ -0,0 +1,425 @@
|
||||
From 10d093f65881d49ff5e919168451ab75f16adce0 Mon Sep 17 00:00:00 2001
|
||||
From: Guido Cella <guido@guidocella.xyz>
|
||||
Date: Thu, 29 Oct 2026 18:06:25 +0100
|
||||
Subject: [PATCH] integrate scenefx
|
||||
|
||||
Add rounded corners, shadows and blur with scenefx.
|
||||
|
||||
The border is now a single rectangle with a hole for the window contents,
|
||||
so its corners can be rounded concentrically with them. Buffers are rounded
|
||||
when their corners coincide with the window's, which includes subsurfaces
|
||||
covering it.
|
||||
|
||||
Tiled windows show the cached blur of the background layer, which is
|
||||
redrawn only when it changes, while floating windows blur what's behind
|
||||
them. Fullscreen windows have no effects so that fullscreen_bg keeps
|
||||
hiding what's behind them.
|
||||
|
||||
scenefx has to be linked before wlroots so that its wlr_scene functions
|
||||
override wlroots' ones, including those called by wlroots' scene surface
|
||||
helpers, which scenefx doesn't reimplement.
|
||||
---
|
||||
Makefile | 4 +-
|
||||
client.h | 4 +-
|
||||
config.def.h | 8 +++
|
||||
config.mk | 5 ++
|
||||
dwl.c | 144 +++++++++++++++++++++++++++++++++++++++++++--------
|
||||
5 files changed, 137 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 8304245..aad87ba 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -13,8 +13,8 @@ DWLDEVCFLAGS = -g -Wpedantic -Wall -Wextra -Wdeclaration-after-statement \
|
||||
|
||||
# CFLAGS / LDFLAGS
|
||||
PKGS = wayland-server xkbcommon libinput $(XLIBS)
|
||||
-DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(WLR_INCS) $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
|
||||
-LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(WLR_LIBS) -lm $(LIBS)
|
||||
+DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(WLR_INCS) $(FX_INCS) $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
|
||||
+LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(FX_LIBS) $(WLR_LIBS) -lm $(LIBS)
|
||||
|
||||
all: dwl
|
||||
dwl: dwl.c client.h config.h ime.h util.h config.mk cursor-shape-v1-protocol.h \
|
||||
diff --git a/client.h b/client.h
|
||||
index ebe665b..d3f8091 100644
|
||||
--- a/client.h
|
||||
+++ b/client.h
|
||||
@@ -300,9 +300,7 @@ client_send_close(Client *c)
|
||||
static inline void
|
||||
client_set_border_color(Client *c, const float color[static 4])
|
||||
{
|
||||
- int i;
|
||||
- for (i = 0; i < 4; i++)
|
||||
- wlr_scene_rect_set_color(c->border[i], color);
|
||||
+ wlr_scene_rect_set_color(c->border, color);
|
||||
}
|
||||
|
||||
static inline void
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index 4901e7a..71ffa98 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -13,6 +13,14 @@ static const float bordercolor[] = COLOR(0x444444ff);
|
||||
static const float focuscolor[] = COLOR(0x005577ff);
|
||||
static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||
static const float fullscreen_bg[] = {0.0f, 0.0f, 0.0f, 1.0f}; /* You can also use glsl colors */
|
||||
+/* rounded corners, shadows and blur, see scenefx */
|
||||
+static const int corner_radius = 8; /* radius of the corners of window contents, 0 disables them */
|
||||
+static const int corner_radius_only_floating = 0; /* 1 means only floating windows have rounded corners */
|
||||
+static const int shadow_sigma = 20; /* blur sigma and size of window shadows, 0 disables them */
|
||||
+static const float shadow_color[] = COLOR(0x00000080);
|
||||
+/* blur behind translucent windows. Set num_passes to 0 to disable it */
|
||||
+static const struct blur_data blur_data = { .num_passes = 3, .radius = 5, .noise = 0.02f,
|
||||
+ .brightness = 0.9f, .contrast = 0.9f, .saturation = 1.1f };
|
||||
|
||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||
#define TAGCOUNT (9)
|
||||
diff --git a/config.mk b/config.mk
|
||||
index 0da079c..9293d5e 100644
|
||||
--- a/config.mk
|
||||
+++ b/config.mk
|
||||
@@ -24,6 +24,11 @@ WLR_LIBS = `$(PKG_CONFIG) --libs wlroots-0.20`
|
||||
# -I$(PWD)/wlroots/0.20/include/wlroots-0.20
|
||||
#WLR_LIBS = -Wl,-rpath,$(PWD)/wlroots/0.20/lib64 -L$(PWD)/wlroots/0.20/lib64 -lwlroots-0.20
|
||||
|
||||
+# scenefx's headers are included with -isystem to hide their -Wpedantic warnings,
|
||||
+# and after WLR_INCS so they don't override an alternative wlroots installation.
|
||||
+FX_INCS = -isystem `$(PKG_CONFIG) --variable=includedir scenefx-0.5`/scenefx-0.5
|
||||
+FX_LIBS = `$(PKG_CONFIG) --libs scenefx-0.5`
|
||||
+
|
||||
XWAYLAND =
|
||||
XLIBS =
|
||||
# Uncomment to build XWayland support
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index 89e8caf..1a702c9 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -6,6 +6,9 @@
|
||||
#include <limits.h>
|
||||
#include <linux/input-event-codes.h>
|
||||
#include <math.h>
|
||||
+#include <scenefx/render/fx_renderer/fx_renderer.h>
|
||||
+#include <scenefx/types/fx/clipped_region.h>
|
||||
+#include <scenefx/types/wlr_scene.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -51,7 +54,6 @@
|
||||
#include <wlr/types/wlr_primary_selection.h>
|
||||
#include <wlr/types/wlr_primary_selection_v1.h>
|
||||
#include <wlr/types/wlr_relative_pointer_v1.h>
|
||||
-#include <wlr/types/wlr_scene.h>
|
||||
#include <wlr/types/wlr_screencopy_v1.h>
|
||||
#include <wlr/types/wlr_seat.h>
|
||||
#include <wlr/types/wlr_server_decoration.h>
|
||||
@@ -120,7 +122,9 @@ typedef struct {
|
||||
|
||||
Monitor *mon;
|
||||
struct wlr_scene_tree *scene;
|
||||
- struct wlr_scene_rect *border[4]; /* top, bottom, left, right */
|
||||
+ struct wlr_scene_rect *border;
|
||||
+ struct wlr_scene_shadow *shadow;
|
||||
+ struct wlr_scene_blur *blur;
|
||||
struct wlr_scene_tree *scene_surface;
|
||||
struct wl_list link;
|
||||
struct wl_list flink;
|
||||
@@ -211,6 +215,7 @@ struct Monitor {
|
||||
struct wlr_output *wlr_output;
|
||||
struct wlr_scene_output *scene_output;
|
||||
struct wlr_scene_rect *fullscreen_bg; /* See createmon() for info */
|
||||
+ struct wlr_scene_optimized_blur *blur;
|
||||
struct wl_listener frame;
|
||||
struct wl_listener destroy;
|
||||
struct wl_listener request_state;
|
||||
@@ -284,6 +289,7 @@ static void commitlayersurfacenotify(struct wl_listener *listener, void *data);
|
||||
static void commitlocksurface(struct wl_listener *listener, void *data);
|
||||
static void commitnotify(struct wl_listener *listener, void *data);
|
||||
static void commitpopup(struct wl_listener *listener, void *data);
|
||||
+static int cornerradius(Client *c);
|
||||
static void createdecoration(struct wl_listener *listener, void *data);
|
||||
static void createidleinhibitor(struct wl_listener *listener, void *data);
|
||||
static void createkeyboard(struct wlr_keyboard *keyboard);
|
||||
@@ -346,6 +352,7 @@ static void requestdecorationmode(struct wl_listener *listener, void *data);
|
||||
static void requeststartdrag(struct wl_listener *listener, void *data);
|
||||
static void requestmonstate(struct wl_listener *listener, void *data);
|
||||
static void resize(Client *c, struct wlr_box geo, int interact);
|
||||
+static void roundbuffer(struct wlr_scene_buffer *buffer, int sx, int sy, void *data);
|
||||
static void run(char *startup_cmd);
|
||||
static void setcursor(struct wl_listener *listener, void *data);
|
||||
static void setcursorshape(struct wl_listener *listener, void *data);
|
||||
@@ -545,6 +552,9 @@ applygeom(Client *c)
|
||||
{
|
||||
struct wlr_box clip;
|
||||
Client *p = client_get_parent(c);
|
||||
+ int radius = cornerradius(c);
|
||||
+ int outer = radius ? radius + (int)c->bw : 0;
|
||||
+ int floating = c->isfloating || !c->mon->lt[c->mon->sellt]->arrange;
|
||||
|
||||
/* We move all floating clients to LyrTile while in floating layout
|
||||
* to avoid "real" floating clients be always on top */
|
||||
@@ -560,19 +570,37 @@ applygeom(Client *c)
|
||||
wlr_scene_node_set_enabled(&c->scene_surface->node, 1);
|
||||
}
|
||||
|
||||
- /* Update scene-graph, including borders */
|
||||
+ /* Update scene-graph, including borders. The border is a rectangle with
|
||||
+ * a hole for the content, so their rounded corners stay concentric. */
|
||||
wlr_scene_node_set_position(&c->scene->node, c->geom.x, c->geom.y);
|
||||
wlr_scene_node_set_position(&c->scene_surface->node, c->bw, c->bw);
|
||||
- wlr_scene_rect_set_size(c->border[0], c->geom.width, c->bw);
|
||||
- wlr_scene_rect_set_size(c->border[1], c->geom.width, c->bw);
|
||||
- wlr_scene_rect_set_size(c->border[2], c->bw, c->geom.height - 2 * c->bw);
|
||||
- wlr_scene_rect_set_size(c->border[3], c->bw, c->geom.height - 2 * c->bw);
|
||||
- wlr_scene_node_set_position(&c->border[1]->node, 0, c->geom.height - c->bw);
|
||||
- wlr_scene_node_set_position(&c->border[2]->node, 0, c->bw);
|
||||
- wlr_scene_node_set_position(&c->border[3]->node, c->geom.width - c->bw, c->bw);
|
||||
+ wlr_scene_rect_set_size(c->border, c->geom.width, c->geom.height);
|
||||
+ wlr_scene_rect_set_corner_radius(c->border, outer);
|
||||
+ wlr_scene_rect_set_clipped_region(c->border, (struct clipped_region){
|
||||
+ .area = { c->bw, c->bw, c->geom.width - 2 * c->bw, c->geom.height - 2 * c->bw },
|
||||
+ .corners = corner_radii_all(radius) });
|
||||
+
|
||||
+ wlr_scene_node_set_enabled(&c->shadow->node, shadow_sigma && !c->isfullscreen);
|
||||
+ wlr_scene_shadow_set_size(c->shadow, c->geom.width + 2 * shadow_sigma,
|
||||
+ c->geom.height + 2 * shadow_sigma);
|
||||
+ wlr_scene_shadow_set_corner_radius(c->shadow, outer);
|
||||
+ /* Don't draw the shadow behind translucent windows */
|
||||
+ wlr_scene_shadow_set_clipped_region(c->shadow, (struct clipped_region){
|
||||
+ .area = { shadow_sigma, shadow_sigma, c->geom.width, c->geom.height },
|
||||
+ .corners = corner_radii_all(outer) });
|
||||
+
|
||||
+ /* The fullscreen background hides what's behind fullscreen windows */
|
||||
+ wlr_scene_node_set_enabled(&c->blur->node, blur_data.num_passes && !c->isfullscreen);
|
||||
+ wlr_scene_node_set_position(&c->blur->node, c->bw, c->bw);
|
||||
+ wlr_scene_blur_set_size(c->blur, c->geom.width - 2 * c->bw, c->geom.height - 2 * c->bw);
|
||||
+ wlr_scene_blur_set_corner_radius(c->blur, radius);
|
||||
+ /* Only floating windows can be above other windows, tiled ones can use
|
||||
+ * the cached blur of the background layer */
|
||||
+ wlr_scene_blur_set_should_only_blur_bottom_layer(c->blur, !floating);
|
||||
|
||||
client_get_clip(c, &clip);
|
||||
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip);
|
||||
+ wlr_scene_node_for_each_buffer(&c->scene_surface->node, roundbuffer, c);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -890,6 +918,7 @@ cleanupmon(struct wl_listener *listener, void *data)
|
||||
|
||||
closemon(m);
|
||||
wlr_scene_node_destroy(&m->fullscreen_bg->node);
|
||||
+ wlr_scene_node_destroy(&m->blur->node);
|
||||
free(m);
|
||||
}
|
||||
|
||||
@@ -982,6 +1011,10 @@ commitlayersurfacenotify(struct wl_listener *listener, void *data)
|
||||
return;
|
||||
}
|
||||
|
||||
+ /* The cached blur of the background layer must be redrawn when it changes */
|
||||
+ if (scene_layer == layers[LyrBg] || l->scene->node.parent == layers[LyrBg])
|
||||
+ wlr_scene_optimized_blur_mark_dirty(l->mon->blur);
|
||||
+
|
||||
if (layer_surface->current.committed == 0 && l->mapped == layer_surface->surface->mapped)
|
||||
return;
|
||||
l->mapped = layer_surface->surface->mapped;
|
||||
@@ -1043,6 +1076,9 @@ commitnotify(struct wl_listener *listener, void *data)
|
||||
transactioncommit(c, c->resize_serial && c->surface.xdg->current.configure_serial
|
||||
>= c->resize_serial);
|
||||
resize(c, c->geom, (c->isfloating && !c->isfullscreen));
|
||||
+ /* Subsurfaces may have been added or resized */
|
||||
+ if (client_surface(c)->mapped)
|
||||
+ wlr_scene_node_for_each_buffer(&c->scene_surface->node, roundbuffer, c);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1075,6 +1111,15 @@ commitpopup(struct wl_listener *listener, void *data)
|
||||
free(listener);
|
||||
}
|
||||
|
||||
+int
|
||||
+cornerradius(Client *c)
|
||||
+{
|
||||
+ if (c->isfullscreen || (corner_radius_only_floating && !c->isfloating
|
||||
+ && c->mon && c->mon->lt[c->mon->sellt]->arrange))
|
||||
+ return 0;
|
||||
+ return corner_radius;
|
||||
+}
|
||||
+
|
||||
void
|
||||
createdecoration(struct wl_listener *listener, void *data)
|
||||
{
|
||||
@@ -1267,6 +1312,10 @@ createmon(struct wl_listener *listener, void *data)
|
||||
m->fullscreen_bg = wlr_scene_rect_create(layers[LyrFS], 0, 0, fullscreen_bg);
|
||||
wlr_scene_node_set_enabled(&m->fullscreen_bg->node, 0);
|
||||
|
||||
+ /* Caches the blur of everything below it, which tiled windows show */
|
||||
+ m->blur = wlr_scene_optimized_blur_create(&scene->tree, 0, 0);
|
||||
+ wlr_scene_node_place_above(&m->blur->node, &layers[LyrBg]->node);
|
||||
+
|
||||
/* Adds this to the output layout in the order it was configured.
|
||||
*
|
||||
* The output layout utility automatically adds a wl_output global to the
|
||||
@@ -1720,7 +1769,7 @@ gpureset(struct wl_listener *listener, void *data)
|
||||
struct wlr_renderer *old_drw = drw;
|
||||
struct wlr_allocator *old_alloc = alloc;
|
||||
struct Monitor *m;
|
||||
- if (!(drw = wlr_renderer_autocreate(backend)))
|
||||
+ if (!(drw = fx_renderer_create(backend)))
|
||||
die("couldn't recreate renderer");
|
||||
|
||||
if (!(alloc = wlr_allocator_autocreate(backend, drw)))
|
||||
@@ -1733,6 +1782,7 @@ gpureset(struct wl_listener *listener, void *data)
|
||||
|
||||
wl_list_for_each(m, &mons, link) {
|
||||
wlr_output_init_render(m->wlr_output, alloc, drw);
|
||||
+ wlr_scene_optimized_blur_mark_dirty(m->blur);
|
||||
}
|
||||
|
||||
wlr_allocator_destroy(old_alloc);
|
||||
@@ -1941,7 +1991,6 @@ mapnotify(struct wl_listener *listener, void *data)
|
||||
Client *p = NULL;
|
||||
Client *w, *c = wl_container_of(listener, c, map);
|
||||
Monitor *m;
|
||||
- int i;
|
||||
|
||||
struct wlr_ext_foreign_toplevel_handle_v1_state foreign_toplevel_state = {
|
||||
.app_id = client_get_appid(c),
|
||||
@@ -1969,11 +2018,14 @@ mapnotify(struct wl_listener *listener, void *data)
|
||||
goto unset_fullscreen;
|
||||
}
|
||||
|
||||
- for (i = 0; i < 4; i++) {
|
||||
- c->border[i] = wlr_scene_rect_create(c->scene, 0, 0,
|
||||
- c->isurgent ? urgentcolor : bordercolor);
|
||||
- c->border[i]->node.data = c;
|
||||
- }
|
||||
+ c->border = wlr_scene_rect_create(c->scene, 0, 0,
|
||||
+ c->isurgent ? urgentcolor : bordercolor);
|
||||
+ c->border->node.data = c;
|
||||
+ c->shadow = wlr_scene_shadow_create(c->scene, 0, 0, 0, shadow_sigma, shadow_color);
|
||||
+ wlr_scene_node_set_position(&c->shadow->node, -shadow_sigma, -shadow_sigma);
|
||||
+ wlr_scene_node_lower_to_bottom(&c->shadow->node);
|
||||
+ c->blur = wlr_scene_blur_create(c->scene, 0, 0);
|
||||
+ wlr_scene_node_lower_to_bottom(&c->blur->node);
|
||||
|
||||
/* Initialize client geometry with room for border */
|
||||
client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT |
|
||||
@@ -2494,6 +2546,22 @@ resize(Client *c, struct wlr_box geo, int interact)
|
||||
transactionschedule();
|
||||
}
|
||||
|
||||
+void
|
||||
+roundbuffer(struct wlr_scene_buffer *buffer, int sx, int sy, void *data)
|
||||
+{
|
||||
+ /* Round the corners of buffers which are at the corners of the window,
|
||||
+ * including subsurfaces covering it */
|
||||
+ Client *c = data;
|
||||
+ int radius = cornerradius(c);
|
||||
+ int left = sx == (int)c->bw, top = sy == (int)c->bw;
|
||||
+ int right = sx + buffer->dst_width == c->current.width - (int)c->bw;
|
||||
+ int bottom = sy + buffer->dst_height == c->current.height - (int)c->bw;
|
||||
+
|
||||
+ wlr_scene_buffer_set_corner_radii(buffer, corner_radii_new(
|
||||
+ top && left ? radius : 0, top && right ? radius : 0,
|
||||
+ bottom && right ? radius : 0, bottom && left ? radius : 0));
|
||||
+}
|
||||
+
|
||||
void
|
||||
run(char *startup_cmd)
|
||||
{
|
||||
@@ -2737,17 +2805,18 @@ setup(void)
|
||||
|
||||
/* Initialize the scene graph used to lay out windows */
|
||||
scene = wlr_scene_create();
|
||||
+ wlr_scene_set_blur_data(scene, blur_data.num_passes, (int)blur_data.radius, blur_data.noise,
|
||||
+ blur_data.brightness, blur_data.contrast, blur_data.saturation);
|
||||
root_bg = wlr_scene_rect_create(&scene->tree, 0, 0, rootcolor);
|
||||
for (i = 0; i < NUM_LAYERS; i++)
|
||||
layers[i] = wlr_scene_tree_create(&scene->tree);
|
||||
drag_icon = wlr_scene_tree_create(&scene->tree);
|
||||
wlr_scene_node_place_below(&drag_icon->node, &layers[LyrBlock]->node);
|
||||
|
||||
- /* Autocreates a renderer, either Pixman, GLES2 or Vulkan for us. The user
|
||||
- * can also specify a renderer using the WLR_RENDERER env var.
|
||||
+ /* Creates scenefx's GLES2 renderer, which is required to render its effects.
|
||||
* The renderer is responsible for defining the various pixel formats it
|
||||
* supports for shared memory, this configures that for clients. */
|
||||
- if (!(drw = wlr_renderer_autocreate(backend)))
|
||||
+ if (!(drw = fx_renderer_create(backend)))
|
||||
die("couldn't create renderer");
|
||||
wl_signal_add(&drw->events.lost, &gpu_reset);
|
||||
|
||||
@@ -2959,7 +3028,9 @@ snapshot(struct wlr_scene_node *node, struct wlr_scene_tree *parent, void *data)
|
||||
* the buffers so that they can be shown after the client changes them */
|
||||
struct wlr_scene_node *child, *copy;
|
||||
struct wlr_scene_tree *tree;
|
||||
- struct wlr_scene_rect *rect;
|
||||
+ struct wlr_scene_rect *src_rect, *rect;
|
||||
+ struct wlr_scene_shadow *src_shadow, *shadow;
|
||||
+ struct wlr_scene_blur *src_blur, *blur;
|
||||
struct wlr_scene_buffer *src, *buffer;
|
||||
|
||||
if (!node->enabled)
|
||||
@@ -2973,8 +3044,29 @@ snapshot(struct wlr_scene_node *node, struct wlr_scene_tree *parent, void *data)
|
||||
copy = &tree->node;
|
||||
break;
|
||||
case WLR_SCENE_NODE_RECT:
|
||||
- rect = wlr_scene_rect_from_node(node);
|
||||
- copy = &wlr_scene_rect_create(parent, rect->width, rect->height, rect->color)->node;
|
||||
+ src_rect = wlr_scene_rect_from_node(node);
|
||||
+ rect = wlr_scene_rect_create(parent, src_rect->width, src_rect->height, src_rect->color);
|
||||
+ wlr_scene_rect_set_corner_radii(rect, src_rect->corners);
|
||||
+ wlr_scene_rect_set_clipped_region(rect, src_rect->clipped_region);
|
||||
+ copy = &rect->node;
|
||||
+ break;
|
||||
+ case WLR_SCENE_NODE_SHADOW:
|
||||
+ src_shadow = wlr_scene_shadow_from_node(node);
|
||||
+ shadow = wlr_scene_shadow_create(parent, src_shadow->width, src_shadow->height,
|
||||
+ src_shadow->corner_radius, src_shadow->blur_sigma, src_shadow->color);
|
||||
+ wlr_scene_shadow_set_clipped_region(shadow, src_shadow->clipped_region);
|
||||
+ copy = &shadow->node;
|
||||
+ break;
|
||||
+ case WLR_SCENE_NODE_BLUR:
|
||||
+ src_blur = wlr_scene_blur_from_node(node);
|
||||
+ blur = wlr_scene_blur_create(parent, src_blur->width, src_blur->height);
|
||||
+ wlr_scene_blur_set_corner_radii(blur, src_blur->corners);
|
||||
+ wlr_scene_blur_set_clipped_region(blur, src_blur->clipped_region);
|
||||
+ wlr_scene_blur_set_should_only_blur_bottom_layer(blur,
|
||||
+ src_blur->should_only_blur_bottom_layer);
|
||||
+ wlr_scene_blur_set_alpha(blur, src_blur->alpha);
|
||||
+ wlr_scene_blur_set_strength(blur, src_blur->strength);
|
||||
+ copy = &blur->node;
|
||||
break;
|
||||
case WLR_SCENE_NODE_BUFFER:
|
||||
src = wlr_scene_buffer_from_node(node);
|
||||
@@ -2989,6 +3081,7 @@ snapshot(struct wlr_scene_node *node, struct wlr_scene_tree *parent, void *data)
|
||||
wlr_scene_buffer_set_color_range(buffer, src->color_range);
|
||||
wlr_scene_buffer_set_source_box(buffer, &src->src_box);
|
||||
wlr_scene_buffer_set_transform(buffer, src->transform);
|
||||
+ wlr_scene_buffer_set_corner_radii(buffer, src->corners);
|
||||
wlr_scene_buffer_set_buffer(buffer, src->buffer);
|
||||
copy = &buffer->node;
|
||||
break;
|
||||
@@ -3222,6 +3315,8 @@ unmaplayersurfacenotify(struct wl_listener *listener, void *data)
|
||||
wlr_scene_node_set_enabled(&l->scene->node, 0);
|
||||
if (l->layer_surface->output && (l->mon = l->layer_surface->output->data))
|
||||
arrangelayers(l->mon);
|
||||
+ if (l->mon && l->scene->node.parent == layers[LyrBg])
|
||||
+ wlr_scene_optimized_blur_mark_dirty(l->mon->blur);
|
||||
if (l->layer_surface->surface == seat->keyboard_state.focused_surface)
|
||||
focusclient(focustop(selmon), NULL, 1);
|
||||
motionnotify(0, NULL, 0, 0, 0, 0);
|
||||
@@ -3340,6 +3435,9 @@ updatemons(struct wl_listener *listener, void *data)
|
||||
wlr_scene_node_set_position(&m->fullscreen_bg->node, m->m.x, m->m.y);
|
||||
wlr_scene_rect_set_size(m->fullscreen_bg, m->m.width, m->m.height);
|
||||
|
||||
+ wlr_scene_node_set_position(&m->blur->node, m->m.x, m->m.y);
|
||||
+ wlr_scene_optimized_blur_set_size(m->blur, m->m.width, m->m.height);
|
||||
+
|
||||
if (m->lock_surface) {
|
||||
struct wlr_scene_tree *scene_tree = m->lock_surface->surface->data;
|
||||
wlr_scene_node_set_position(&scene_tree->node, m->m.x, m->m.y);
|
||||
--
|
||||
2.56.0
|
||||
|
||||
@@ -4,7 +4,8 @@ Swapfocus adds a new function on dwl: a shortcut to change the focus to the last
|
||||
- Alternatively: edit the patch and uncomment and comment out the lines instructed to keep the swapfocus shortcut from changing to another tag.
|
||||
|
||||
### Download
|
||||
- [v0.8](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/swapfocus/swapfocus.patch)
|
||||
- [2026-10-25](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/swapfocus/swapfocus.patch)
|
||||
- [v0.8](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/swapfocus/swapfocus-0.8.patch)
|
||||
|
||||
### Authors
|
||||
- [André Desgualdo Pereira](https://codeberg.org/Kana)
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
From 364b9f20b830886b9c0e6539ddba2cc206a286eb Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Andr=C3=A9=20Desgualdo=20Pereira?= <desgua@gmail.com>
|
||||
Date: Thu, 21 May 2026 09:50:03 -0300
|
||||
Subject: [PATCH] swapfocus patch
|
||||
|
||||
---
|
||||
config.def.h | 1 +
|
||||
dwl.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 91 insertions(+)
|
||||
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index 8a6eda0..23e502d 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -132,6 +132,7 @@ static const Key keys[] = {
|
||||
{ MODKEY, XKB_KEY_Return, zoom, {0} },
|
||||
{ MODKEY, XKB_KEY_Tab, view, {0} },
|
||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_c, killclient, {0} },
|
||||
+ { MODKEY, XKB_KEY_s, swapfocus, {0} },
|
||||
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
|
||||
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
|
||||
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index 101a45f..c512323 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -332,6 +332,7 @@ static void setsel(struct wl_listener *listener, void *data);
|
||||
static void setup(void);
|
||||
static void spawn(const Arg *arg);
|
||||
static void startdrag(struct wl_listener *listener, void *data);
|
||||
+static void swapfocus(const Arg *arg);
|
||||
static void tag(const Arg *arg);
|
||||
static void tagmon(const Arg *arg);
|
||||
static void tile(Monitor *m);
|
||||
@@ -375,6 +376,7 @@ static struct wlr_xdg_activation_v1 *activation;
|
||||
static struct wlr_xdg_decoration_manager_v1 *xdg_decoration_mgr;
|
||||
static struct wl_list clients; /* tiling order */
|
||||
static struct wl_list fstack; /* focus order */
|
||||
+static Client *prevclient = NULL;
|
||||
static struct wlr_idle_notifier_v1 *idle_notifier;
|
||||
static struct wlr_idle_inhibit_manager_v1 *idle_inhibit_mgr;
|
||||
static struct wlr_layer_shell_v1 *layer_shell;
|
||||
@@ -1330,6 +1332,8 @@ destroynotify(struct wl_listener *listener, void *data)
|
||||
{
|
||||
/* Called when the xdg_toplevel is destroyed. */
|
||||
Client *c = wl_container_of(listener, c, destroy);
|
||||
+ if (c == prevclient)
|
||||
+ prevclient = NULL;
|
||||
wl_list_remove(&c->destroy.link);
|
||||
wl_list_remove(&c->set_title.link);
|
||||
wl_list_remove(&c->fullscreen.link);
|
||||
@@ -1424,6 +1428,11 @@ focusclient(Client *c, int lift)
|
||||
wlr_xdg_popup_destroy(popup);
|
||||
}
|
||||
|
||||
+ /* Capture the client losing focus as the previous client */
|
||||
+ if (old_c && !client_is_unmanaged(old_c) && old_c != c) {
|
||||
+ prevclient = old_c;
|
||||
+ }
|
||||
+
|
||||
/* Put the new client atop the focus stack and select its monitor */
|
||||
if (c && !client_is_unmanaged(c)) {
|
||||
wl_list_remove(&c->flink);
|
||||
@@ -2679,6 +2688,87 @@ spawn(const Arg *arg)
|
||||
}
|
||||
}
|
||||
|
||||
+void
|
||||
+swapfocus(const Arg *arg)
|
||||
+{
|
||||
+ Client *c;
|
||||
+ int found = 0;
|
||||
+
|
||||
+ /* Verify the client still exists in the list of managed windows */
|
||||
+ if (prevclient) {
|
||||
+ wl_list_for_each(c, &clients, link) {
|
||||
+ if (c == prevclient) {
|
||||
+ found = 1;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (found && !client_is_unmanaged(prevclient)) {
|
||||
+ /* Get the bitmask of currently visible tags on the prevclient's monitor */
|
||||
+ unsigned int visible_tags = prevclient->mon->tagset[prevclient->mon->seltags];
|
||||
+
|
||||
+ /* Check if the client's tags are currently visible */
|
||||
+ if (!(prevclient->tags & visible_tags)) {
|
||||
+ /* Tag is NOT visible: Switch tags and monitor only.
|
||||
+ * dwl's view() calls arrange(), which automatically focuses the
|
||||
+ * top-most window in the focus stack for that tag. */
|
||||
+ Arg a = {.ui = prevclient->tags};
|
||||
+ selmon = prevclient->mon;
|
||||
+ view(&a);
|
||||
+
|
||||
+ /* Comment out the 3 lines above and
|
||||
+ * uncommment the following lines
|
||||
+ * if changing tags isn't desired */
|
||||
+
|
||||
+// int current_tag_clients = 0;
|
||||
+// Client *tmp;
|
||||
+// wl_list_for_each(tmp, &clients, link) {
|
||||
+// /* Make sure it's on the current monitor, visible on the current tag, and mapped */
|
||||
+// if (tmp->mon == selmon && (tmp->tags & selmon->tagset[selmon->seltags]) && !client_is_unmanaged(tmp)) {
|
||||
+// current_tag_clients++;
|
||||
+// }
|
||||
+// }
|
||||
+//
|
||||
+// /* If there's more than 1 window here, mimic Mod+k instead of switching tags */
|
||||
+// if (current_tag_clients > 1) {
|
||||
+// Arg arg_focus = {.i = -1};
|
||||
+// focusstack(&arg_focus);
|
||||
+// }
|
||||
+
|
||||
+ /* End of not changing tags logic */
|
||||
+ } else {
|
||||
+ /* Tag IS visible: Just swap focus within the same view */
|
||||
+ focusclient(prevclient, 1);
|
||||
+ }
|
||||
+ } else {
|
||||
+ Arg a = {.ui = 0};
|
||||
+ selmon = prevclient->mon;
|
||||
+ view(&a);
|
||||
+
|
||||
+ /* Comment out the 3 lines above and
|
||||
+ * uncommment the following lines
|
||||
+ * if changing tags isn't desired */
|
||||
+
|
||||
+ /* use the following if changing tags isn't desired */
|
||||
+// int current_tag_clients = 0;
|
||||
+// Client *tmp;
|
||||
+// wl_list_for_each(tmp, &clients, link) {
|
||||
+// /* Make sure it's on the current monitor, visible on the current tag, and mapped */
|
||||
+// if (tmp->mon == selmon && (tmp->tags & selmon->tagset[selmon->seltags]) && !client_is_unmanaged(tmp)) {
|
||||
+// current_tag_clients++;
|
||||
+// }
|
||||
+// }
|
||||
+//
|
||||
+// /* If there's more than 1 window here, mimic Mod+k instead of switching tags */
|
||||
+// if (current_tag_clients > 1) {
|
||||
+// Arg arg_focus = {.i = -1};
|
||||
+// focusstack(&arg_focus);
|
||||
+// }
|
||||
+ /* end of not changing tags logic */
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void
|
||||
startdrag(struct wl_listener *listener, void *data)
|
||||
{
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
From 364b9f20b830886b9c0e6539ddba2cc206a286eb Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Andr=C3=A9=20Desgualdo=20Pereira?= <desgua@gmail.com>
|
||||
Date: Thu, 21 May 2026 09:50:03 -0300
|
||||
Subject: [PATCH] swapfocus patch
|
||||
|
||||
---
|
||||
config.def.h | 1 +
|
||||
dwl.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 91 insertions(+)
|
||||
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index 8a6eda0..23e502d 100644
|
||||
index a4019d3..02ee21c 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -132,6 +132,7 @@ static const Key keys[] = {
|
||||
@@ -21,18 +11,18 @@ index 8a6eda0..23e502d 100644
|
||||
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
|
||||
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index 101a45f..c512323 100644
|
||||
index d5f2f98..5e65cfa 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -332,6 +332,7 @@ static void setsel(struct wl_listener *listener, void *data);
|
||||
static void setup(void);
|
||||
@@ -362,6 +362,7 @@ static struct wlr_scene_node *snapshot(struct wlr_scene_node *node,
|
||||
struct wlr_scene_tree *parent, void *data);
|
||||
static void spawn(const Arg *arg);
|
||||
static void startdrag(struct wl_listener *listener, void *data);
|
||||
+static void swapfocus(const Arg *arg);
|
||||
static void tag(const Arg *arg);
|
||||
static void tagmon(const Arg *arg);
|
||||
static void tile(Monitor *m);
|
||||
@@ -375,6 +376,7 @@ static struct wlr_xdg_activation_v1 *activation;
|
||||
@@ -410,6 +411,7 @@ static struct wlr_xdg_activation_v1 *activation;
|
||||
static struct wlr_xdg_decoration_manager_v1 *xdg_decoration_mgr;
|
||||
static struct wl_list clients; /* tiling order */
|
||||
static struct wl_list fstack; /* focus order */
|
||||
@@ -40,7 +30,7 @@ index 101a45f..c512323 100644
|
||||
static struct wlr_idle_notifier_v1 *idle_notifier;
|
||||
static struct wlr_idle_inhibit_manager_v1 *idle_inhibit_mgr;
|
||||
static struct wlr_layer_shell_v1 *layer_shell;
|
||||
@@ -1330,6 +1332,8 @@ destroynotify(struct wl_listener *listener, void *data)
|
||||
@@ -1500,6 +1502,8 @@ destroynotify(struct wl_listener *listener, void *data)
|
||||
{
|
||||
/* Called when the xdg_toplevel is destroyed. */
|
||||
Client *c = wl_container_of(listener, c, destroy);
|
||||
@@ -49,7 +39,7 @@ index 101a45f..c512323 100644
|
||||
wl_list_remove(&c->destroy.link);
|
||||
wl_list_remove(&c->set_title.link);
|
||||
wl_list_remove(&c->fullscreen.link);
|
||||
@@ -1424,6 +1428,11 @@ focusclient(Client *c, int lift)
|
||||
@@ -1600,6 +1604,11 @@ focusclient(Client *c, LayerSurface *l, int lift)
|
||||
wlr_xdg_popup_destroy(popup);
|
||||
}
|
||||
|
||||
@@ -61,7 +51,7 @@ index 101a45f..c512323 100644
|
||||
/* Put the new client atop the focus stack and select its monitor */
|
||||
if (c && !client_is_unmanaged(c)) {
|
||||
wl_list_remove(&c->flink);
|
||||
@@ -2679,6 +2688,87 @@ spawn(const Arg *arg)
|
||||
@@ -3015,6 +3024,87 @@ spawn(const Arg *arg)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +106,7 @@ index 101a45f..c512323 100644
|
||||
+ /* End of not changing tags logic */
|
||||
+ } else {
|
||||
+ /* Tag IS visible: Just swap focus within the same view */
|
||||
+ focusclient(prevclient, 1);
|
||||
+ focusclient(prevclient, NULL, 1);
|
||||
+ }
|
||||
+ } else {
|
||||
+ Arg a = {.ui = 0};
|
||||
@@ -149,6 +139,3 @@ index 101a45f..c512323 100644
|
||||
void
|
||||
startdrag(struct wl_listener *listener, void *data)
|
||||
{
|
||||
--
|
||||
2.53.0
|
||||
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
### Description
|
||||
|
||||
Implement https://github.com/wlrfx/scenefx
|
||||
|
||||
```c
|
||||
/* available options */
|
||||
|
||||
static const int opacity = 0; /* flag to enable opacity */
|
||||
static const float opacity_inactive = 0.5;
|
||||
static const float opacity_active = 1.0;
|
||||
|
||||
static const int shadow = 1; /* flag to enable shadow */
|
||||
static const int shadow_only_floating = 0; /* only apply shadow to floating windows */
|
||||
static const float shadow_color[4] = COLOR(0x0000FFff);
|
||||
static const float shadow_color_focus[4] = COLOR(0xFF0000ff);
|
||||
static const int shadow_blur_sigma = 20;
|
||||
static const int shadow_blur_sigma_focus = 40;
|
||||
static const char *const shadow_ignore_list[] = { NULL }; /* list of app-id to ignore */
|
||||
|
||||
static const int corner_radius = 8; /* 0 disables corner_radius */
|
||||
static const int corner_radius_inner = 8; /* 0 disables corner_radius */
|
||||
static const int corner_radius_only_floating = 0; /* only apply corner_radius and corner_radius_inner to floating windows */
|
||||
|
||||
static const int blur = 1; /* flag to enable blur */
|
||||
static const int blur_xray = 0; /* flag to make transparent fs and floating windows display your background */
|
||||
static const int blur_ignore_transparent = 1;
|
||||
static const struct blur_data blur_data = {
|
||||
.radius = 5,
|
||||
.num_passes = 3,
|
||||
.noise = (float)0.02,
|
||||
.brightness = (float)0.9,
|
||||
.contrast = (float)0.9,
|
||||
.saturation = (float)1.1,
|
||||
};
|
||||
```
|
||||
|
||||
> **NOTE:** If you are using nix with flakes, scenefx has a flake for scenefx https://github.com/wlrfx/scenefx/blob/main/flake.nix
|
||||
|
||||
> **NOTE:** Blur doesn't work on windows with opacity set (opacity_active, opacity_inactive)
|
||||
|
||||
> **NOTE:** In DWL's Makefile `scenefx-0.2` must be placed before `wlroots-0.18`, e.g. `PKGS = scenefx-0.2 wlroots-0.18 wayland-server ...`
|
||||
|
||||
<details>
|
||||
<summary>Preview</summary>
|
||||
<pre>
|
||||
<img src="https://i.imgur.com/nJIX6lp.png"/>
|
||||
</pre>
|
||||
</details>
|
||||
|
||||
### Download
|
||||
|
||||
- [git branch](https://codeberg.org/wochap/dwl/src/branch/v0.8-a/scenefx-b)
|
||||
|
||||
- [0.8-dev](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/scenefx/scenefx.patch)
|
||||
|
||||
**NOTE:** This patch was tested with the `87c0e8b6d5c86557a800445e8e4c322f387fe19c` commit on the `main` branch of `SceneFX`. It supports rounded borders, blur, and shadows. However, it does not add rounded borders or shadows to Xwayland apps. That said, Xwayland apps can have shadows, and they might also support rounded borders, but I was never able to make it work. PRs are welcome!
|
||||
|
||||
**IMPORTANT:** This patch requires you to build DWL with the following dependencies
|
||||
|
||||
- **scenefx**
|
||||
- libGL
|
||||
|
||||
- [2024-07-09](https://codeberg.org/dwl/dwl-patches/raw/commit/13d96b51b54500dd24544cf3a73c61b7a1414bc6/patches/scenefx/scenefx.patch)
|
||||
|
||||
**IMPORTANT:** This patch only works with the `2ec3505248e819191c37cb831197629f373326fb` commit on the `main` branch of `scenefx`, therefore, it does not support **blur**.
|
||||
|
||||
**IMPORTANT:** This patch requires you to build DWL with the following dependencies
|
||||
|
||||
- **scenefx**
|
||||
- libGL
|
||||
|
||||
<details>
|
||||
<summary>Preview</summary>
|
||||
<pre>
|
||||
<img src="https://i.imgur.com/4kFhSaS.png"/>
|
||||
<img src="https://i.imgur.com/9ZQAUXx.png"/>
|
||||
</pre>
|
||||
</details>
|
||||
|
||||
- [2024-04-11](https://codeberg.org/dwl/dwl-patches/raw/commit/6e3a57ffd16dafa31900b7e89e51672bd7bcc1e8/scenefx/scenefx.patch)
|
||||
|
||||
**IMPORTANT:** This patch only works with the `de4ec10e1ff9347b5833f00f8615d760d9378c99` commit on the `wlr_scene_blur` branch of `scenefx`, as it adds support for **blur**.
|
||||
|
||||
**IMPORTANT:** This patch requires you to build DWL with the dependencies of WLROOTS:
|
||||
|
||||
- **scenefx**
|
||||
- libGL
|
||||
- libcap
|
||||
- libinput
|
||||
- libpng
|
||||
- libxkbcommon
|
||||
- mesa
|
||||
- pixman
|
||||
- seatd
|
||||
- vulkan-loader
|
||||
- wayland
|
||||
- wayland-protocols
|
||||
- xorg.libX11
|
||||
- xorg.xcbutilerrors
|
||||
- xorg.xcbutilimage
|
||||
- xorg.xcbutilrenderutil
|
||||
- xorg.xcbutilwm
|
||||
- xwayland (optional)
|
||||
- ffmpeg
|
||||
- hwdata
|
||||
- libliftoff
|
||||
- libdisplay-info
|
||||
|
||||
- [v0.5](https://codeberg.org/dwl/dwl-patches/raw/commit/7a5c3420822074c544fa102e030b7c30aa6b6be8/scenefx/scenefx.patch)
|
||||
|
||||
### Authors
|
||||
|
||||
- [wochap](https://codeberg.org/wochap)
|
||||
@@ -1,700 +0,0 @@
|
||||
From d209aeaee541a045de9dba2154bbbd5475bba2ec Mon Sep 17 00:00:00 2001
|
||||
From: wochap <gean.marroquin@gmail.com>
|
||||
Date: Sun, 9 Mar 2025 17:26:07 -0500
|
||||
Subject: [PATCH] implement scenefx
|
||||
|
||||
---
|
||||
Makefile | 2 +-
|
||||
client.h | 18 +++
|
||||
config.def.h | 30 +++-
|
||||
dwl.c | 414 ++++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
4 files changed, 457 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 3358bae..8dc79bd 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -12,7 +12,7 @@ DWLDEVCFLAGS = -g -pedantic -Wall -Wextra -Wdeclaration-after-statement \
|
||||
-Wfloat-conversion
|
||||
|
||||
# CFLAGS / LDFLAGS
|
||||
-PKGS = wlroots-0.18 wayland-server xkbcommon libinput $(XLIBS)
|
||||
+PKGS = scenefx-0.2 wlroots-0.18 wayland-server xkbcommon libinput $(XLIBS)
|
||||
DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
|
||||
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` -lm $(LIBS)
|
||||
|
||||
diff --git a/client.h b/client.h
|
||||
index 42f225f..4e8f016 100644
|
||||
--- a/client.h
|
||||
+++ b/client.h
|
||||
@@ -147,6 +147,13 @@ client_get_clip(Client *c, struct wlr_box *clip)
|
||||
return;
|
||||
#endif
|
||||
|
||||
+ *clip = (struct wlr_box){
|
||||
+ .x = c->bw,
|
||||
+ .y = c->bw,
|
||||
+ .width = c->geom.width - c->bw * 2,
|
||||
+ .height = c->geom.height - c->bw * 2,
|
||||
+ };
|
||||
+
|
||||
wlr_xdg_surface_get_geometry(c->surface.xdg, &xdg_geom);
|
||||
clip->x = xdg_geom.x;
|
||||
clip->y = xdg_geom.y;
|
||||
@@ -328,6 +335,17 @@ static inline void
|
||||
client_set_border_color(Client *c, const float color[static 4])
|
||||
{
|
||||
int i;
|
||||
+
|
||||
+#ifdef XWAYLAND
|
||||
+ if (!client_is_x11(c)) {
|
||||
+#endif
|
||||
+ if (corner_radius > 0) {
|
||||
+ return;
|
||||
+ }
|
||||
+#ifdef XWAYLAND
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
for (i = 0; i < 4; i++)
|
||||
wlr_scene_rect_set_color(c->border[i], color);
|
||||
}
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index 22d2171..8c50932 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -12,7 +12,35 @@ static const float bordercolor[] = COLOR(0x444444ff);
|
||||
static const float focuscolor[] = COLOR(0x005577ff);
|
||||
static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
||||
-static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
|
||||
+static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 0.0f}; /* You can also use glsl colors */
|
||||
+
|
||||
+static const int opacity = 0; /* flag to enable opacity */
|
||||
+static const float opacity_inactive = 0.5;
|
||||
+static const float opacity_active = 1.0;
|
||||
+
|
||||
+static const int shadow = 1; /* flag to enable shadow */
|
||||
+static const int shadow_only_floating = 0; /* only apply shadow to floating windows */
|
||||
+static const float shadow_color[4] = COLOR(0x0000FFff);
|
||||
+static const float shadow_color_focus[4] = COLOR(0xFF0000ff);
|
||||
+static const int shadow_blur_sigma = 20;
|
||||
+static const int shadow_blur_sigma_focus = 40;
|
||||
+static const char *const shadow_ignore_list[] = { NULL }; /* list of app-id to ignore */
|
||||
+
|
||||
+static const int corner_radius = 8; /* 0 disables corner_radius */
|
||||
+static const int corner_radius_inner = 9; /* 0 disables corner_radius */
|
||||
+static const int corner_radius_only_floating = 0; /* only apply corner_radius and corner_radius_inner to floating windows */
|
||||
+
|
||||
+static const int blur = 1; /* flag to enable blur */
|
||||
+static const int blur_xray = 0; /* flag to make transparent fs and floating windows display your background */
|
||||
+static const int blur_ignore_transparent = 1;
|
||||
+static const struct blur_data blur_data = {
|
||||
+ .radius = 5,
|
||||
+ .num_passes = 3,
|
||||
+ .noise = (float)0.02,
|
||||
+ .brightness = (float)0.9,
|
||||
+ .contrast = (float)0.9,
|
||||
+ .saturation = (float)1.1,
|
||||
+};
|
||||
|
||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||
#define TAGCOUNT (9)
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index 5bf995e..655e175 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -10,8 +10,14 @@
|
||||
#include <stdlib.h>
|
||||
#include <sys/wait.h>
|
||||
#include <time.h>
|
||||
+#include <scenefx/render/fx_renderer/fx_renderer.h>
|
||||
+#include <scenefx/types/fx/blur_data.h>
|
||||
+#include <scenefx/types/fx/clipped_region.h>
|
||||
+#include <scenefx/types/fx/corner_location.h>
|
||||
+#include <scenefx/types/wlr_scene.h>
|
||||
#include <unistd.h>
|
||||
#include <wayland-server-core.h>
|
||||
+#include <wayland-util.h>
|
||||
#include <wlr/backend.h>
|
||||
#include <wlr/backend/libinput.h>
|
||||
#include <wlr/render/allocator.h>
|
||||
@@ -43,7 +49,6 @@
|
||||
#include <wlr/types/wlr_primary_selection.h>
|
||||
#include <wlr/types/wlr_primary_selection_v1.h>
|
||||
#include <wlr/types/wlr_relative_pointer_v1.h>
|
||||
-#include <wlr/types/wlr_scene.h>
|
||||
#include <wlr/types/wlr_screencopy_v1.h>
|
||||
#include <wlr/types/wlr_seat.h>
|
||||
#include <wlr/types/wlr_server_decoration.h>
|
||||
@@ -83,7 +88,7 @@
|
||||
/* enums */
|
||||
enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */
|
||||
enum { XDGShell, LayerShell, X11 }; /* client types */
|
||||
-enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock, NUM_LAYERS }; /* scene layers */
|
||||
+enum { LyrBg, LyrBlur, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock, NUM_LAYERS }; /* scene layers */
|
||||
#ifdef XWAYLAND
|
||||
enum { NetWMWindowTypeDialog, NetWMWindowTypeSplash, NetWMWindowTypeToolbar,
|
||||
NetWMWindowTypeUtility, NetLast }; /* EWMH atoms */
|
||||
@@ -141,6 +146,12 @@ typedef struct {
|
||||
uint32_t tags;
|
||||
int isfloating, isurgent, isfullscreen;
|
||||
uint32_t resize; /* configure serial of a pending resize */
|
||||
+
|
||||
+ float opacity;
|
||||
+ int corner_radius;
|
||||
+ struct wlr_scene_shadow *shadow;
|
||||
+ int has_shadow_enabled;
|
||||
+ struct wlr_scene_rect *round_border;
|
||||
} Client;
|
||||
|
||||
typedef struct {
|
||||
@@ -208,6 +219,7 @@ struct Monitor {
|
||||
int nmaster;
|
||||
char ltsymbol[16];
|
||||
int asleep;
|
||||
+ struct wlr_scene_optimized_blur *blur_layer;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
@@ -355,6 +367,18 @@ static Monitor *xytomon(double x, double y);
|
||||
static void xytonode(double x, double y, struct wlr_surface **psurface,
|
||||
Client **pc, LayerSurface **pl, double *nx, double *ny);
|
||||
static void zoom(const Arg *arg);
|
||||
+static void iter_xdg_scene_buffers(struct wlr_scene_buffer *buffer, int sx, int sy, void *user_data);
|
||||
+static void iter_xdg_scene_buffers_blur(struct wlr_scene_buffer *buffer, int sx, int sy, void *user_data);
|
||||
+static void iter_xdg_scene_buffers_opacity(struct wlr_scene_buffer *buffer, int sx, int sy, void *user_data);
|
||||
+static void iter_xdg_scene_buffers_corner_radius(struct wlr_scene_buffer *buffer, int sx, int sy, void *user_data);
|
||||
+static void output_configure_scene(struct wlr_scene_node *node, Client *c);
|
||||
+static int in_shadow_ignore_list(const char *str);
|
||||
+static void client_set_shadow_blur_sigma(Client *c, int blur_sigma);
|
||||
+static void update_client_corner_radius(Client *c);
|
||||
+static void update_client_shadow_color(Client *c);
|
||||
+static void update_client_focus_decorations(Client *c, int focused, int urgent);
|
||||
+static void update_client_blur(Client *c);
|
||||
+static void update_buffer_corner_radius(Client *c, struct wlr_scene_buffer *buffer);
|
||||
|
||||
/* variables */
|
||||
static const char broken[] = "broken";
|
||||
@@ -413,6 +437,8 @@ static struct wlr_box sgeom;
|
||||
static struct wl_list mons;
|
||||
static Monitor *selmon;
|
||||
|
||||
+static float transparent[4] = {0.1f, 0.1f, 0.1f, 0.0f};
|
||||
+
|
||||
#ifdef XWAYLAND
|
||||
static void activatex11(struct wl_listener *listener, void *data);
|
||||
static void associatex11(struct wl_listener *listener, void *data);
|
||||
@@ -499,6 +525,10 @@ arrange(Monitor *m)
|
||||
wlr_scene_node_set_enabled(&m->fullscreen_bg->node,
|
||||
(c = focustop(m)) && c->isfullscreen);
|
||||
|
||||
+ if (blur) {
|
||||
+ wlr_scene_node_set_enabled(&m->blur_layer->node, 1);
|
||||
+ }
|
||||
+
|
||||
strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
|
||||
|
||||
/* We move all clients (except fullscreen and unmanaged) to LyrTile while
|
||||
@@ -722,6 +752,11 @@ cleanupmon(struct wl_listener *listener, void *data)
|
||||
|
||||
closemon(m);
|
||||
wlr_scene_node_destroy(&m->fullscreen_bg->node);
|
||||
+
|
||||
+ if (blur) {
|
||||
+ wlr_scene_node_destroy(&m->blur_layer->node);
|
||||
+ }
|
||||
+
|
||||
free(m);
|
||||
}
|
||||
|
||||
@@ -785,6 +820,18 @@ commitlayersurfacenotify(struct wl_listener *listener, void *data)
|
||||
}
|
||||
|
||||
arrangelayers(l->mon);
|
||||
+
|
||||
+ if (blur) {
|
||||
+ // Rerender the optimized blur on change
|
||||
+ struct wlr_layer_surface_v1 *wlr_layer_surface = l->layer_surface;
|
||||
+ if (wlr_layer_surface->current.layer ==
|
||||
+ ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND ||
|
||||
+ wlr_layer_surface->current.layer == ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM) {
|
||||
+ if (l->mon) {
|
||||
+ wlr_scene_optimized_blur_mark_dirty(l->mon->blur_layer);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1036,6 +1083,12 @@ createmon(struct wl_listener *listener, void *data)
|
||||
m->fullscreen_bg = wlr_scene_rect_create(layers[LyrFS], 0, 0, fullscreen_bg);
|
||||
wlr_scene_node_set_enabled(&m->fullscreen_bg->node, 0);
|
||||
|
||||
+ if (blur) {
|
||||
+ m->blur_layer = wlr_scene_optimized_blur_create(&scene->tree, 0, 0);
|
||||
+ wlr_scene_node_reparent(&m->blur_layer->node, layers[LyrBlur]);
|
||||
+ wlr_scene_node_set_enabled(&m->blur_layer->node, 0);
|
||||
+ }
|
||||
+
|
||||
/* Adds this to the output layout in the order it was configured.
|
||||
*
|
||||
* The output layout utility automatically adds a wl_output global to the
|
||||
@@ -1061,6 +1114,9 @@ createnotify(struct wl_listener *listener, void *data)
|
||||
c->surface.xdg = toplevel->base;
|
||||
c->bw = borderpx;
|
||||
|
||||
+ c->opacity = opacity;
|
||||
+ c->corner_radius = corner_radius;
|
||||
+
|
||||
LISTEN(&toplevel->base->surface->events.commit, &c->commit, commitnotify);
|
||||
LISTEN(&toplevel->base->surface->events.map, &c->map, mapnotify);
|
||||
LISTEN(&toplevel->base->surface->events.unmap, &c->unmap, unmapnotify);
|
||||
@@ -1369,8 +1425,11 @@ focusclient(Client *c, int lift)
|
||||
|
||||
/* Don't change border color if there is an exclusive focus or we are
|
||||
* handling a drag operation */
|
||||
- if (!exclusive_focus && !seat->drag)
|
||||
+ if (!exclusive_focus && !seat->drag) {
|
||||
client_set_border_color(c, focuscolor);
|
||||
+
|
||||
+ update_client_focus_decorations(c, 1, 0);
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Deactivate old client if focus is changing */
|
||||
@@ -1389,6 +1448,8 @@ focusclient(Client *c, int lift)
|
||||
} else if (old_c && !client_is_unmanaged(old_c) && (!c || !client_wants_focus(c))) {
|
||||
client_set_border_color(old_c, bordercolor);
|
||||
|
||||
+ update_client_focus_decorations(old_c, 0, 0);
|
||||
+
|
||||
client_activate_surface(old, 0);
|
||||
}
|
||||
}
|
||||
@@ -1718,6 +1779,38 @@ mapnotify(struct wl_listener *listener, void *data)
|
||||
c->border[i]->node.data = c;
|
||||
}
|
||||
|
||||
+ wlr_scene_node_for_each_buffer(&c->scene_surface->node, iter_xdg_scene_buffers, c);
|
||||
+
|
||||
+#ifdef XWAYLAND
|
||||
+ if (!client_is_x11(c)) {
|
||||
+#endif
|
||||
+ if (corner_radius > 0) {
|
||||
+ c->round_border = wlr_scene_rect_create(c->scene, 0, 0, c->isurgent ? urgentcolor : bordercolor);
|
||||
+ c->round_border->node.data = c;
|
||||
+ /* Lower the border below the XDG scene tree */
|
||||
+ wlr_scene_node_lower_to_bottom(&c->round_border->node);
|
||||
+
|
||||
+ /* hide original border */
|
||||
+ for (i = 0; i < 4; i++) {
|
||||
+ wlr_scene_rect_set_color(c->border[i], transparent);
|
||||
+ }
|
||||
+ }
|
||||
+#ifdef XWAYLAND
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+#ifdef XWAYLAND
|
||||
+ if (!client_is_x11(c)) {
|
||||
+#endif
|
||||
+ if (shadow) {
|
||||
+ c->shadow = wlr_scene_shadow_create(c->scene, 0, 0, c->corner_radius, shadow_blur_sigma, shadow_color);
|
||||
+ /* Lower the shadow below the border */
|
||||
+ wlr_scene_node_lower_to_bottom(&c->shadow->node);
|
||||
+ }
|
||||
+#ifdef XWAYLAND
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
/* Initialize client geometry with room for border */
|
||||
client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT | WLR_EDGE_RIGHT);
|
||||
c->geom.width += 2 * c->bw;
|
||||
@@ -1739,6 +1832,13 @@ mapnotify(struct wl_listener *listener, void *data)
|
||||
}
|
||||
printstatus();
|
||||
|
||||
+ /* TODO: shouldn't we call iter_xdg_scene_buffers_corner_radius? */
|
||||
+ update_client_corner_radius(c);
|
||||
+
|
||||
+ update_client_shadow_color(c);
|
||||
+
|
||||
+ update_client_blur(c);
|
||||
+
|
||||
unset_fullscreen:
|
||||
m = c->mon ? c->mon : xytomon(c->geom.x, c->geom.y);
|
||||
wl_list_for_each(w, &clients, link) {
|
||||
@@ -2113,6 +2213,8 @@ rendermon(struct wl_listener *listener, void *data)
|
||||
goto skip;
|
||||
}
|
||||
|
||||
+ output_configure_scene(&m->scene_output->scene->tree.node, NULL);
|
||||
+
|
||||
/*
|
||||
* HACK: The "correct" way to set the gamma is to commit it together with
|
||||
* the rest of the state in one go, but to do that we would need to rewrite
|
||||
@@ -2207,6 +2309,21 @@ resize(Client *c, struct wlr_box geo, int interact)
|
||||
c->geom.height - 2 * c->bw);
|
||||
client_get_clip(c, &clip);
|
||||
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip);
|
||||
+
|
||||
+ if (corner_radius > 0 && c->round_border) {
|
||||
+ wlr_scene_node_set_position(&c->round_border->node, 0, 0);
|
||||
+ wlr_scene_rect_set_size(c->round_border, c->geom.width, c->geom.height);
|
||||
+ wlr_scene_rect_set_clipped_region(c->round_border, (struct clipped_region) {
|
||||
+ .corner_radius = c->corner_radius,
|
||||
+ .corners = CORNER_LOCATION_ALL,
|
||||
+ .area = { c->bw, c->bw, c->geom.width - c->bw * 2, c->geom.height - c->bw * 2 }
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
+ if (shadow && c->shadow) {
|
||||
+ /* TODO: shouldn't we call wlr_scene_shadow_set_blur_sigma? */
|
||||
+ client_set_shadow_blur_sigma(c, (int)round(c->shadow->blur_sigma));
|
||||
+ }
|
||||
}
|
||||
|
||||
void
|
||||
@@ -2307,6 +2424,13 @@ setfloating(Client *c, int floating)
|
||||
{
|
||||
Client *p = client_get_parent(c);
|
||||
c->isfloating = floating;
|
||||
+
|
||||
+ update_client_corner_radius(c);
|
||||
+
|
||||
+ update_client_shadow_color(c);
|
||||
+
|
||||
+ update_client_blur(c);
|
||||
+
|
||||
/* If in floating layout do not change the client's layer */
|
||||
if (!c->mon || !client_surface(c)->mapped || !c->mon->lt[c->mon->sellt]->arrange)
|
||||
return;
|
||||
@@ -2336,6 +2460,13 @@ setfullscreen(Client *c, int fullscreen)
|
||||
* client positions are set by the user and cannot be recalculated */
|
||||
resize(c, c->prev, 0);
|
||||
}
|
||||
+
|
||||
+ update_client_corner_radius(c);
|
||||
+
|
||||
+ update_client_shadow_color(c);
|
||||
+
|
||||
+ update_client_blur(c);
|
||||
+
|
||||
arrange(c->mon);
|
||||
printstatus();
|
||||
}
|
||||
@@ -2457,11 +2588,15 @@ setup(void)
|
||||
drag_icon = wlr_scene_tree_create(&scene->tree);
|
||||
wlr_scene_node_place_below(&drag_icon->node, &layers[LyrBlock]->node);
|
||||
|
||||
+ if (blur) {
|
||||
+ wlr_scene_set_blur_data(scene, blur_data);
|
||||
+ }
|
||||
+
|
||||
/* Autocreates a renderer, either Pixman, GLES2 or Vulkan for us. The user
|
||||
* can also specify a renderer using the WLR_RENDERER env var.
|
||||
* The renderer is responsible for defining the various pixel formats it
|
||||
* supports for shared memory, this configures that for clients. */
|
||||
- if (!(drw = wlr_renderer_autocreate(backend)))
|
||||
+ if (!(drw = fx_renderer_create(backend)))
|
||||
die("couldn't create renderer");
|
||||
LISTEN_STATIC(&drw->events.lost, gpureset);
|
||||
|
||||
@@ -2870,6 +3005,10 @@ updatemons(struct wl_listener *listener, void *data)
|
||||
|
||||
wlr_scene_node_set_position(&m->fullscreen_bg->node, m->m.x, m->m.y);
|
||||
wlr_scene_rect_set_size(m->fullscreen_bg, m->m.width, m->m.height);
|
||||
+
|
||||
+ if (blur) {
|
||||
+ wlr_scene_optimized_blur_set_size(m->blur_layer, m->m.width, m->m.height);
|
||||
+ }
|
||||
|
||||
if (m->lock_surface) {
|
||||
struct wlr_scene_tree *scene_tree = m->lock_surface->surface->data;
|
||||
@@ -2940,8 +3079,11 @@ urgent(struct wl_listener *listener, void *data)
|
||||
c->isurgent = 1;
|
||||
printstatus();
|
||||
|
||||
- if (client_surface(c)->mapped)
|
||||
+ if (client_surface(c)->mapped) {
|
||||
client_set_border_color(c, urgentcolor);
|
||||
+
|
||||
+ update_client_focus_decorations(c, 1, 1);
|
||||
+ }
|
||||
}
|
||||
|
||||
void
|
||||
@@ -3053,6 +3195,268 @@ zoom(const Arg *arg)
|
||||
arrange(selmon);
|
||||
}
|
||||
|
||||
+void
|
||||
+iter_xdg_scene_buffers(struct wlr_scene_buffer *buffer, int sx, int sy, void *user_data)
|
||||
+{
|
||||
+ Client *c = user_data;
|
||||
+ struct wlr_scene_surface * scene_surface = wlr_scene_surface_try_from_buffer(buffer);
|
||||
+ struct wlr_xdg_surface *xdg_surface;
|
||||
+
|
||||
+ if (!scene_surface) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ xdg_surface = wlr_xdg_surface_try_from_wlr_surface(scene_surface->surface);
|
||||
+
|
||||
+ if (c && xdg_surface && xdg_surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) {
|
||||
+ /* TODO: Be able to set whole decoration_data instead of calling */
|
||||
+ /* each individually? */
|
||||
+ if (opacity) {
|
||||
+ wlr_scene_buffer_set_opacity(buffer, c->opacity);
|
||||
+ }
|
||||
+
|
||||
+ if (!wlr_subsurface_try_from_wlr_surface(xdg_surface->surface)) {
|
||||
+ update_buffer_corner_radius(c, buffer);
|
||||
+
|
||||
+ if (blur) {
|
||||
+ int blur_optimized = !c->isfloating || blur_xray;
|
||||
+ wlr_scene_buffer_set_backdrop_blur(buffer, 1);
|
||||
+ wlr_scene_buffer_set_backdrop_blur_optimized(buffer, blur_optimized);
|
||||
+ wlr_scene_buffer_set_backdrop_blur_ignore_transparent(buffer, blur_ignore_transparent);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+iter_xdg_scene_buffers_blur(struct wlr_scene_buffer *buffer, int sx, int sy, void *user_data)
|
||||
+{
|
||||
+ Client *c = user_data;
|
||||
+ struct wlr_scene_surface * scene_surface = wlr_scene_surface_try_from_buffer(buffer);
|
||||
+ struct wlr_xdg_surface *xdg_surface;
|
||||
+
|
||||
+ if (!scene_surface) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ xdg_surface = wlr_xdg_surface_try_from_wlr_surface(scene_surface->surface);
|
||||
+
|
||||
+ if (c && xdg_surface && xdg_surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) {
|
||||
+ if (!wlr_subsurface_try_from_wlr_surface(xdg_surface->surface)) {
|
||||
+ if (blur) {
|
||||
+ int blur_optimized = !c->isfloating || blur_xray;
|
||||
+ wlr_scene_buffer_set_backdrop_blur_optimized(buffer, blur_optimized);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+iter_xdg_scene_buffers_opacity(struct wlr_scene_buffer *buffer, int sx, int sy, void *user_data)
|
||||
+{
|
||||
+ Client *c = user_data;
|
||||
+ struct wlr_scene_surface * scene_surface = wlr_scene_surface_try_from_buffer(buffer);
|
||||
+ struct wlr_xdg_surface *xdg_surface;
|
||||
+
|
||||
+ if (!scene_surface) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ xdg_surface = wlr_xdg_surface_try_from_wlr_surface(scene_surface->surface);
|
||||
+
|
||||
+ if (c && xdg_surface && xdg_surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) {
|
||||
+ /* TODO: Be able to set whole decoration_data instead of calling */
|
||||
+ /* each individually? */
|
||||
+ if (opacity) {
|
||||
+ wlr_scene_buffer_set_opacity(buffer, c->opacity);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+iter_xdg_scene_buffers_corner_radius(struct wlr_scene_buffer *buffer, int sx, int sy, void *user_data)
|
||||
+{
|
||||
+ Client *c = user_data;
|
||||
+ struct wlr_scene_surface * scene_surface = wlr_scene_surface_try_from_buffer(buffer);
|
||||
+ struct wlr_xdg_surface *xdg_surface;
|
||||
+
|
||||
+ if (!scene_surface) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ xdg_surface = wlr_xdg_surface_try_from_wlr_surface(scene_surface->surface);
|
||||
+
|
||||
+ if (c && xdg_surface && xdg_surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) {
|
||||
+ /* TODO: Be able to set whole decoration_data instead of calling */
|
||||
+ /* each individually? */
|
||||
+ update_buffer_corner_radius(c, buffer);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+output_configure_scene(struct wlr_scene_node *node, Client *c)
|
||||
+{
|
||||
+ Client *_c;
|
||||
+ struct wlr_xdg_surface *xdg_surface;
|
||||
+ struct wlr_scene_node *_node;
|
||||
+
|
||||
+ if (!node->enabled) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ _c = node->data;
|
||||
+ if (_c) {
|
||||
+ c = _c;
|
||||
+ }
|
||||
+
|
||||
+ if (node->type == WLR_SCENE_NODE_BUFFER) {
|
||||
+ struct wlr_scene_buffer *buffer = wlr_scene_buffer_from_node(node);
|
||||
+
|
||||
+ struct wlr_scene_surface *scene_surface = wlr_scene_surface_try_from_buffer(buffer);
|
||||
+ if (!scene_surface) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ xdg_surface = wlr_xdg_surface_try_from_wlr_surface(scene_surface->surface);
|
||||
+
|
||||
+ if (c && xdg_surface && xdg_surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) {
|
||||
+ if (opacity) {
|
||||
+ wlr_scene_buffer_set_opacity(buffer, c->opacity);
|
||||
+ }
|
||||
+
|
||||
+ if (!wlr_subsurface_try_from_wlr_surface(xdg_surface->surface)) {
|
||||
+ update_buffer_corner_radius(c, buffer);
|
||||
+ }
|
||||
+ }
|
||||
+ } else if (node->type == WLR_SCENE_NODE_TREE) {
|
||||
+ struct wlr_scene_tree *tree = wl_container_of(node, tree, node);
|
||||
+ wl_list_for_each(_node, &tree->children, link) {
|
||||
+ output_configure_scene(_node, c);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+in_shadow_ignore_list(const char *str)
|
||||
+{
|
||||
+ for (int i = 0; shadow_ignore_list[i] != NULL; i++) {
|
||||
+ if (strcmp(shadow_ignore_list[i], str) == 0) {
|
||||
+ return 1;
|
||||
+ }
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+client_set_shadow_blur_sigma(Client *c, int blur_sigma)
|
||||
+{
|
||||
+ wlr_scene_shadow_set_blur_sigma(c->shadow, blur_sigma);
|
||||
+ wlr_scene_node_set_position(&c->shadow->node, -blur_sigma, -blur_sigma);
|
||||
+ wlr_scene_shadow_set_size(c->shadow, c->geom.width + blur_sigma * 2, c->geom.height + blur_sigma * 2);
|
||||
+ wlr_scene_shadow_set_clipped_region(c->shadow, (struct clipped_region) {
|
||||
+ .corner_radius = c->corner_radius + c->bw,
|
||||
+ .corners = CORNER_LOCATION_ALL,
|
||||
+ .area = { blur_sigma, blur_sigma, c->geom.width, c->geom.height }
|
||||
+ });
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+update_client_corner_radius(Client *c)
|
||||
+{
|
||||
+ if (corner_radius && c->round_border) {
|
||||
+ int radius = c->corner_radius + c->bw;
|
||||
+ if ((corner_radius_only_floating && !c->isfloating) || c->isfullscreen) {
|
||||
+ radius = 0;
|
||||
+ }
|
||||
+ wlr_scene_rect_set_corner_radius(c->round_border, radius, CORNER_LOCATION_ALL);
|
||||
+ }
|
||||
+
|
||||
+#ifdef XWAYLAND
|
||||
+ if (!client_is_x11(c)) {
|
||||
+#endif
|
||||
+ if (corner_radius_inner > 0 && c->scene) {
|
||||
+ wlr_scene_node_for_each_buffer(&c->scene_surface->node, iter_xdg_scene_buffers_corner_radius, c);
|
||||
+ }
|
||||
+#ifdef XWAYLAND
|
||||
+ }
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+update_client_blur(Client *c)
|
||||
+{
|
||||
+ if (!blur) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (c->scene) {
|
||||
+ wlr_scene_node_for_each_buffer(&c->scene_surface->node, iter_xdg_scene_buffers_blur, c);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+update_buffer_corner_radius(Client *c, struct wlr_scene_buffer *buffer)
|
||||
+{
|
||||
+ int radius;
|
||||
+
|
||||
+#ifdef XWAYLAND
|
||||
+ if (client_is_x11(c)) {
|
||||
+ return;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+ if (!corner_radius_inner) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ radius = corner_radius_inner;
|
||||
+ if ((corner_radius_only_floating && !c->isfloating) || c->isfullscreen) {
|
||||
+ radius = 0;
|
||||
+ }
|
||||
+ wlr_scene_buffer_set_corner_radius(buffer, radius, CORNER_LOCATION_ALL);
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+update_client_shadow_color(Client *c)
|
||||
+{
|
||||
+ int has_shadow_enabled = 1;
|
||||
+ const float *color;
|
||||
+
|
||||
+ if (!shadow || !c->shadow) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ color = focustop(c->mon) == c ? shadow_color_focus : shadow_color;
|
||||
+
|
||||
+ if ((shadow_only_floating && !c->isfloating) ||
|
||||
+ in_shadow_ignore_list(client_get_appid(c)) ||
|
||||
+ c->isfullscreen) {
|
||||
+ color = transparent;
|
||||
+ has_shadow_enabled = 0;
|
||||
+ }
|
||||
+
|
||||
+ wlr_scene_shadow_set_color(c->shadow, color);
|
||||
+ c->has_shadow_enabled = has_shadow_enabled;
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+update_client_focus_decorations(Client *c, int focused, int urgent)
|
||||
+{
|
||||
+ if (corner_radius > 0 && c->round_border) {
|
||||
+ wlr_scene_rect_set_color(c->round_border, urgent ? urgentcolor : (focused ? focuscolor : bordercolor));
|
||||
+ }
|
||||
+ if (shadow && c->shadow) {
|
||||
+ client_set_shadow_blur_sigma(c, (int)round(focused ? shadow_blur_sigma_focus : shadow_blur_sigma));
|
||||
+ if (c->has_shadow_enabled) {
|
||||
+ wlr_scene_shadow_set_color(c->shadow, focused ? shadow_color_focus : shadow_color);
|
||||
+ }
|
||||
+ }
|
||||
+ if (opacity) {
|
||||
+ c->opacity = focused ? opacity_active : opacity_inactive;
|
||||
+ wlr_scene_node_for_each_buffer(&c->scene_surface->node, iter_xdg_scene_buffers_opacity, c);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
#ifdef XWAYLAND
|
||||
void
|
||||
activatex11(struct wl_listener *listener, void *data)
|
||||
--
|
||||
2.47.2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user