From 385ff13e7b170f71b88c9f1b37677fe846163ce7 Mon Sep 17 00:00:00 2001 From: speckitor Date: Mon, 4 May 2026 12:40:06 +0700 Subject: [PATCH] fix xwayland border --- Makefile | 1 + include/config.h | 9 +++++---- src/focus.c | 2 +- src/keyboard.c | 2 +- src/server.c | 2 ++ 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 380991b..887b9d1 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ proto: compile: proto gcc -o absinthe src/* \ -Wall -Wextra -Wpedantic \ + -DXWAYLAND \ -I./ -I./include -DWLR_USE_UNSTABLE $(shell pkg-config wlroots-0.20 --libs --cflags) -lwayland-server -lxkbcommon \ -O3 \ -g diff --git a/include/config.h b/include/config.h index 5e306b1..d1d8348 100644 --- a/include/config.h +++ b/include/config.h @@ -5,15 +5,16 @@ #define CURSOR_MOVE_BUTTON BTN_LEFT #define CURSOR_RESIZE_BUTTON BTN_RIGHT -#define TOPLEVEL_BW 1 +#define TOPLEVEL_BW 1 -static const float focused_bc[4] = { 0.64, 0.75, 0.55, 1.0 }; -static const float urgent_bc[4] = { 0.84, 0.47, 0.5, 1.0 }; -static const float unfocused_bc[4] = { 0.39, 0.42, 0.46, 1.0 }; +static const float focused_bc[4] = { 0.0, 0.0, 1.0, 1.0 }; +static const float urgent_bc[4] = { 1.0, 0.0, 0.0, 1.0 }; +static const float unfocused_bc[4] = { 0.28, 0.28, 0.28, 1.0 }; #define MSTACK_SIZE 1 #define MSTACK_WIDTH 0.5 #define OUTPUT_GAP 0 #define LAYOUT_GAP 0 + #endif diff --git a/src/focus.c b/src/focus.c index 573901e..5978fcc 100644 --- a/src/focus.c +++ b/src/focus.c @@ -39,7 +39,7 @@ focus_toplevel(struct absinthe_toplevel *toplevel) struct wlr_xwayland_surface *prev_xwayland_surface = wlr_xwayland_surface_try_from_wlr_surface(prev_surface); if (prev_xwayland_surface) - toplevel_set_border_color(prev_surface->data, + toplevel_set_border_color(prev_xwayland_surface->data, unfocused_bc); #endif } diff --git a/src/keyboard.c b/src/keyboard.c index 33a3fa6..bcd0030 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -31,7 +31,7 @@ handle_keybind(struct absinthe_server *server, xkb_keysym_t keysym) break; case XKB_KEY_Return: if (fork() == 0) - execl("/bin/sh", "sh", "-c", "ghostty", NULL); + execl("/bin/sh", "sh", "-c", "alacritty", NULL); break; case XKB_KEY_r: if (fork() == 0) diff --git a/src/server.c b/src/server.c index 359b0f5..c799736 100644 --- a/src/server.c +++ b/src/server.c @@ -80,6 +80,8 @@ new_xdg_toplevel(struct wl_listener *listener, void *data) toplevel->xdg = xdg_toplevel; toplevel->xdg->base->data = toplevel; + wlr_surface_set_preferred_buffer_scale(toplevel->xdg->base->surface, 1); + toplevel->commit.notify = toplevel_commit; wl_signal_add(&xdg_toplevel->base->surface->events.commit, &toplevel->commit);