From ac65afdaf74d61dacfcbcbc6adef203ebfc921f8 Mon Sep 17 00:00:00 2001 From: Cosmo on FusionVoyager3 Date: Mon, 7 Jul 2025 18:52:41 +0300 Subject: [PATCH] add disableMaximizedServerDecor --- docs/labwc-config.5.scd | 5 +++++ include/config/rcxml.h | 1 + src/config/rcxml.c | 2 ++ src/ssd/ssd.c | 4 ++-- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/labwc-config.5.scd b/docs/labwc-config.5.scd index 5b303138..cd939ad0 100644 --- a/docs/labwc-config.5.scd +++ b/docs/labwc-config.5.scd @@ -186,6 +186,11 @@ this is for compatibility with Openbox. that it is not always possible to turn off client side decorations. Default is server. +** + Hide server side decoration when a window is maximized. + Useful for trying to replicate a KDE window controls setup where window controls + merge with the top panel + ** The distance in pixels between windows and output edges when using movement actions, for example MoveToEdge. Default is 0. diff --git a/include/config/rcxml.h b/include/config/rcxml.h index 05f75098..3eb58fb9 100644 --- a/include/config/rcxml.h +++ b/include/config/rcxml.h @@ -70,6 +70,7 @@ struct rcxml { enum adaptive_sync_mode adaptive_sync; enum tearing_mode allow_tearing; bool auto_enable_outputs; + bool disable_maximized_ssd_decor; bool reuse_output_mode; enum view_placement_policy placement_policy; bool xwayland_persistence; diff --git a/src/config/rcxml.c b/src/config/rcxml.c index cc207603..79370f14 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -1162,6 +1162,8 @@ entry(xmlNode *node, char *nodename, char *content, struct parser_state *state) rc.gap = atoi(content); } else if (!strcasecmp(nodename, "adaptiveSync.core")) { set_adaptive_sync_mode(content, &rc.adaptive_sync); + } else if (!strcasecmp(nodename, "disableMaximizedServerDecor.core")) { + set_bool(content, &rc.disable_maximized_ssd_decor); } else if (!strcasecmp(nodename, "allowTearing.core")) { set_tearing_mode(content, &rc.allow_tearing); } else if (!strcasecmp(nodename, "autoEnableOutputs.core")) { diff --git a/src/ssd/ssd.c b/src/ssd/ssd.c index 65416ca3..4ed76e0d 100644 --- a/src/ssd/ssd.c +++ b/src/ssd/ssd.c @@ -30,7 +30,7 @@ ssd_thickness(struct view *view) * in border-only deco mode as view->ssd would only be set * after ssd_create() returns. */ - if (!view->ssd_enabled || view->fullscreen) { + if (!view->ssd_enabled || view->fullscreen || (view->maximized && rc.disable_maximized_ssd_decor)) { return (struct border){ 0 }; } @@ -87,7 +87,7 @@ static enum ssd_part_type get_resizing_type(const struct ssd *ssd, struct wlr_cursor *cursor) { struct view *view = ssd ? ssd->view : NULL; - if (!view || !cursor || !view->ssd_enabled || view->fullscreen) { + if (!view || !cursor || !view->ssd_enabled || view->fullscreen || (view->maximized && rc.disable_maximized_ssd_decor)) { return LAB_SSD_NONE; }