From 02cd56be9f225b7cc786b3aceae43a6a8e81524e Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Apr 27 2023 16:09:05 +0000 Subject: fix crash with new glib (#2178299) --- diff --git a/openbox-calc-layer.patch b/openbox-calc-layer.patch new file mode 100644 index 0000000..9f00bbb --- /dev/null +++ b/openbox-calc-layer.patch @@ -0,0 +1,36 @@ +From https://bugzilla.icculus.org/show_bug.cgi?id=6669#c2 + +diff --git a/openbox/client.c b/openbox/client.c +index 3ff278ae..ac4ff827 100644 +--- a/openbox/client.c ++++ b/openbox/client.c +@@ -2702,9 +2702,10 @@ static void client_calc_layer_internal(ObClient *self) + void client_calc_layer(ObClient *self) + { + GList *it; ++ 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 */ +@@ -2717,7 +2718,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 +@@ -2728,6 +2729,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/openbox.spec b/openbox.spec index cb0b381..3a4bc79 100644 --- a/openbox.spec +++ b/openbox.spec @@ -12,6 +12,7 @@ Source3: menu.xml Source4: terminals.menu Patch1: openbox-python3.patch Patch2: openbox-kf5menu.patch +Patch3: openbox-calc-layer.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} @@ -91,6 +92,7 @@ KDE session. %setup -q %patch1 -p1 -b .python3 %patch2 -p1 -b .kf5menu +%patch3 -p1 -b .calc-layer %build