From 67cac5fc0b229ffd1eb83ea2928b1a8087422473 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sun, 12 Oct 2025 14:49:54 +0300 Subject: [PATCH] Add more patches --- pkg.info | 2 +- .../client-calc-layer-traversal-issue.patch | 50 +++++++++++++++++++ .../undecorated-maximized-no-border.patch | 22 ++++++++ 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 source-files/client-calc-layer-traversal-issue.patch create mode 100644 source-files/undecorated-maximized-no-border.patch diff --git a/pkg.info b/pkg.info index e5ef523..64d026d 100644 --- a/pkg.info +++ b/pkg.info @@ -1,7 +1,7 @@ name: openbox description: A minimalistic, highly configurable, next generation window manager with extensive standards support version: 3.6.1 -revision: 2 +revision: 3 url: http://openbox.org/ license: GPL2 architecture: any diff --git a/source-files/client-calc-layer-traversal-issue.patch b/source-files/client-calc-layer-traversal-issue.patch new file mode 100644 index 0000000..ef68d31 --- /dev/null +++ b/source-files/client-calc-layer-traversal-issue.patch @@ -0,0 +1,50 @@ +From 9ed6fdd71890c5cc43747f105382d5677e5d37e7 Mon Sep 17 00:00:00 2001 +From: pldubouilh +Date: Fri, 17 Mar 2023 18:23:47 +0100 +Subject: [PATCH] Fix list traversal issue in client_calc_layer + +The calls to client_calc_layer_internal can modify stacking_list, which +can cause us to follow dangling ->next pointers (either by the pointer +itself already being freed, or it pointing to a freed area). Avoid this +by copying the list first, the goal is to visit every client in the list +once so this should be fine. +--- + openbox/client.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/openbox/client.c b/openbox/client.c +index 7168b2407..b8264587c 100644 +--- a/openbox/client.c ++++ b/openbox/client.c +@@ -2742,9 +2742,12 @@ static void client_calc_layer_internal(ObClient *self) + void client_calc_layer(ObClient *self) + { + GList *it; ++ /* the client_calc_layer_internal calls below modify stacking_list, ++ so we have to make a copy to iterate over */ ++ GList *list = g_list_copy(stacking_list); + + /* skip over stuff above fullscreen layer */ +- for (it = stacking_list; it; it = g_list_next(it)) ++ for (it = list; it; it = g_list_next(it)) + if (window_layer(it->data) <= OB_STACKING_LAYER_FULLSCREEN) break; + + /* find the windows in the fullscreen layer, and mark them not-visited */ +@@ -2757,7 +2760,7 @@ void client_calc_layer(ObClient *self) + client_calc_layer_internal(self); + + /* skip over stuff above fullscreen layer */ +- for (it = stacking_list; it; it = g_list_next(it)) ++ for (it = list; it; it = g_list_next(it)) + if (window_layer(it->data) <= OB_STACKING_LAYER_FULLSCREEN) break; + + /* now recalc any windows in the fullscreen layer which have not +@@ -2768,6 +2771,8 @@ void client_calc_layer(ObClient *self) + !WINDOW_AS_CLIENT(it->data)->visited) + client_calc_layer_internal(it->data); + } ++ ++ g_list_free(it); + } + + gboolean client_should_show(ObClient *self) diff --git a/source-files/undecorated-maximized-no-border.patch b/source-files/undecorated-maximized-no-border.patch new file mode 100644 index 0000000..915cc1e --- /dev/null +++ b/source-files/undecorated-maximized-no-border.patch @@ -0,0 +1,22 @@ +Description: Removed top border on undecorated maximized windows +Author: Valentin Blot +Origin: other +Bug-Debian: https://bugs.debian.org/917204 +Forwarded: no +Last-Update: 2018-12-23 + +--- a/openbox/frame.c ++++ b/openbox/frame.c +@@ -585,12 +585,6 @@ void frame_adjust_area(ObFrame *self, gb + + if (self->decorations & OB_FRAME_DECOR_TITLEBAR) + self->size.top += ob_rr_theme->title_height + self->bwidth; +- else if (self->max_horz && self->max_vert) { +- /* A maximized and undecorated window needs a border on the +- top of the window to let the user still undecorate/unmaximize the +- window via the client menu. */ +- self->size.top += self->bwidth; +- } + + if (self->decorations & OB_FRAME_DECOR_HANDLE && + ob_rr_theme->handle_height > 0)