replace requirement for python-xdg0 with python-pyxdg-py3

apply patches [release 3.6.1-3mamba;Mon Apr 01 2024]
This commit is contained in:
Silvan Calarco 2024-04-01 20:26:23 +02:00
parent 7c82a3b394
commit e4130e1c50
8 changed files with 335 additions and 23 deletions

View File

@ -0,0 +1,11 @@
--- openbox-3.5.0/openbox/client.c 2011-08-01 22:14:58.000000000 +0200
+++ openbox-3.5.0/openbox/client.c 2011-10-22 14:59:56.000000000 +0200
@@ -883,7 +883,7 @@
!g_pattern_match(app->role,
strlen(self->role), self->role, NULL))
match = FALSE;
- else if (app->title &&
+ else if (app->title && self->title &&
!g_pattern_match(app->title,
strlen(self->title), self->title, NULL))
match = FALSE;

View File

@ -0,0 +1,11 @@
--- openbox-3.5.0/data/autostart/autostart.in~ 2011-08-02 15:50:01.963531310 +0000
+++ openbox-3.5.0/data/autostart/autostart.in 2011-08-02 15:51:57.277879458 +0000
@@ -8,7 +8,7 @@
#
#if test -x @libexecdir@/gnome-settings-daemon >/dev/null; then
# @libexecdir@/gnome-settings-daemon &
-#elif which gnome-settings-daemon >/dev/null; then
+#elif which gnome-settings-daemon >/dev/null 2>&1; then
# gnome-settings-daemon &
#fi

View File

@ -0,0 +1,31 @@
Description: Fix toggled hover and pressed images masks not loaded
Author: "E. Serradilla" <eserradi@gmx.com>
Debian-Bugs: https://bugs.debian.org/887908
--- a/obrender/theme.c
+++ b/obrender/theme.c
@@ -1494,8 +1494,10 @@ static void read_button_styles(XrmDataba
READ_BUTTON_MASK_COPY(disabled, btn->unpressed_mask);
READ_BUTTON_MASK_COPY(hover, btn->unpressed_mask);
if (toggled_mask) {
- READ_BUTTON_MASK_COPY(pressed_toggled, btn->unpressed_toggled_mask);
- READ_BUTTON_MASK_COPY(hover_toggled, btn->unpressed_toggled_mask);
+ g_snprintf(name, 128, "%s_toggled_pressed.xbm", btnname);
+ READ_MASK_COPY(name, btn->pressed_toggled_mask, btn->unpressed_toggled_mask);
+ g_snprintf(name, 128, "%s_toggled_hover.xbm", btnname);
+ READ_MASK_COPY(name, btn->hover_toggled_mask, btn->unpressed_toggled_mask);
}
#define READ_BUTTON_APPEARANCE(typedots, type, fallback) \
@@ -1532,8 +1534,8 @@ static void read_button_styles(XrmDataba
READ_BUTTON_APPEARANCE("disabled", disabled, 0);
READ_BUTTON_APPEARANCE("hover", hover, 0);
if (toggled_mask) {
- READ_BUTTON_APPEARANCE("unpressed.toggled", unpressed_toggled, 1);
- READ_BUTTON_APPEARANCE("pressed.toggled", pressed_toggled, 0);
- READ_BUTTON_APPEARANCE("hover.toggled", hover_toggled, 0);
+ READ_BUTTON_APPEARANCE("toggled.unpressed", unpressed_toggled, 1);
+ READ_BUTTON_APPEARANCE("toggled.pressed", pressed_toggled, 0);
+ READ_BUTTON_APPEARANCE("toggled.hover", hover_toggled, 0);
}
}

View File

@ -0,0 +1,22 @@
diff --git a/data/xsession/openbox-kde-session.in b/data/xsession/openbox-kde-session.in
index 35722796..ee91c16f 100644
--- a/data/xsession/openbox-kde-session.in
+++ b/data/xsession/openbox-kde-session.in
@@ -17,4 +17,4 @@ xprop -root -remove _NET_NUMBER_OF_DESKTOPS \
# Run KDE with Openbox as its window manager
export KDEWM="@bindir@/openbox"
-exec startkde "$@"
+exec /usr/bin/startplasma-x11 "$@"
diff --git a/data/xsession/openbox-kde.desktop.in b/data/xsession/openbox-kde.desktop.in
index bc78a97c..a9bcc219 100644
--- a/data/xsession/openbox-kde.desktop.in
+++ b/data/xsession/openbox-kde.desktop.in
@@ -2,6 +2,6 @@
Name=KDE/Openbox
Comment=Use the Openbox window manager inside of the K Desktop Environment
Exec=@bindir@/openbox-kde-session
-TryExec=startkde
+TryExec=/usr/bin/startplasma-x11
Icon=openbox
Type=Application

163
openbox-3.5.1-python3.patch Normal file
View File

@ -0,0 +1,163 @@
From acfbbc4ea40932f183617bb7006700140fe5f61e Mon Sep 17 00:00:00 2001
From: Troy Curtis Jr <troycurtisjr@gmail.com>
Date: Wed, 13 Sep 2017 21:59:48 -0500
Subject: [PATCH] Add python3 support to openbox-xdg-autostart.
Updated syntax in openbox-xdg-autostart to support both python2 and
python3.
Added a configure substitution to set the choosen python at build time.
https://bugzilla.icculus.org/show_bug.cgi?id=6444
---
.gitignore | 1 +
configure.ac | 3 +
...xdg-autostart => openbox-xdg-autostart.in} | 70 +++++++++----------
3 files changed, 38 insertions(+), 36 deletions(-)
rename data/autostart/{openbox-xdg-autostart => openbox-xdg-autostart.in} (77%)
diff --git a/configure.ac b/configure.ac
index ca1602670..9a31e9845 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,6 +103,8 @@ AC_CHECK_HEADERS(ctype.h dirent.h errno.h fcntl.h grp.h locale.h pwd.h)
AC_CHECK_HEADERS(signal.h string.h stdio.h stdlib.h unistd.h sys/stat.h)
AC_CHECK_HEADERS(sys/select.h sys/socket.h sys/time.h sys/types.h sys/wait.h)
+AM_PATH_PYTHON([2],,)
+
AC_PATH_PROG([SED], [sed], [no])
if test "$SED" = "no"; then
AC_MSG_ERROR([The program "sed" is not available. This program is required to build Openbox.])
@@ -259,6 +261,7 @@ AC_CONFIG_FILES([
obrender/version.h
obt/version.h
version.h
+ data/autostart/openbox-xdg-autostart
])
AC_CONFIG_COMMANDS([doc],
[test -d doc || mkdir doc])
diff --git a/data/autostart/openbox-xdg-autostart b/data/autostart/openbox-xdg-autostart.in
similarity index 77%
rename from data/autostart/openbox-xdg-autostart
rename to data/autostart/openbox-xdg-autostart.in
index 04a17a199..3c365b112 100755
--- a/data/autostart/openbox-xdg-autostart
+++ b/data/autostart/openbox-xdg-autostart.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!@PYTHON@
# openbox-xdg-autostart runs things based on the XDG autostart specification
# Copyright (C) 2008 Dana Jansens
@@ -28,9 +28,7 @@ try:
from xdg.DesktopEntry import DesktopEntry
from xdg.Exceptions import ParsingError
except ImportError:
- print
- print >>sys.stderr, "ERROR:", ME, "requires PyXDG to be installed"
- print
+ sys.stderr.write("\nERROR: %s requires PyXDG to be installed\n" % ME)
sys.exit(1)
def main(argv=sys.argv):
@@ -51,7 +49,7 @@ def main(argv=sys.argv):
try:
autofile = AutostartFile(path)
except ParsingError:
- print "Invalid .desktop file: " + path
+ print("Invalid .desktop file: " + path)
else:
if not autofile in files:
files.append(autofile)
@@ -99,9 +97,9 @@ class AutostartFile:
def _alert(self, str, info=False):
if info:
- print "\t ", str
+ print("\t ", str)
else:
- print "\t*", str
+ print("\t*", str)
def _showInEnvironment(self, envs, verbose=False):
default = not self.de.getOnlyShowIn()
@@ -146,14 +144,14 @@ class AutostartFile:
def display(self, envs):
if self._shouldRun(envs):
- print "[*] " + self.de.getName()
+ print("[*] " + self.de.getName())
else:
- print "[ ] " + self.de.getName()
+ print("[ ] " + self.de.getName())
self._alert("File: " + self.path, info=True)
if self.de.getExec():
self._alert("Executes: " + self.de.getExec(), info=True)
self._shouldRun(envs, True)
- print
+ print()
def run(self, envs):
here = os.getcwd()
@@ -165,34 +163,34 @@ class AutostartFile:
os.chdir(here)
def show_help():
- print "Usage:", ME, "[OPTION]... [ENVIRONMENT]..."
- print
- print "This tool will run xdg autostart .desktop files"
- print
- print "OPTIONS"
- print " --list Show a list of the files which would be run"
- print " Files which would be run are marked with an asterix"
- print " symbol [*]. For files which would not be run,"
- print " information is given for why they are excluded"
- print " --help Show this help and exit"
- print " --version Show version and copyright information"
- print
- print "ENVIRONMENT specifies a list of environments for which to run autostart"
- print "applications. If none are specified, only applications which do not "
- print "limit themselves to certain environments will be run."
- print
- print "ENVIRONMENT can be one or more of:"
- print " GNOME Gnome Desktop"
- print " KDE KDE Desktop"
- print " ROX ROX Desktop"
- print " XFCE XFCE Desktop"
- print " Old Legacy systems"
- print
+ print("Usage:", ME, "[OPTION]... [ENVIRONMENT]...")
+ print()
+ print("This tool will run xdg autostart .desktop files")
+ print()
+ print("OPTIONS")
+ print(" --list Show a list of the files which would be run")
+ print(" Files which would be run are marked with an asterix")
+ print(" symbol [*]. For files which would not be run,")
+ print(" information is given for why they are excluded")
+ print(" --help Show this help and exit")
+ print(" --version Show version and copyright information")
+ print()
+ print("ENVIRONMENT specifies a list of environments for which to run autostart")
+ print("applications. If none are specified, only applications which do not ")
+ print("limit themselves to certain environments will be run.")
+ print()
+ print("ENVIRONMENT can be one or more of:")
+ print(" GNOME Gnome Desktop")
+ print(" KDE KDE Desktop")
+ print(" ROX ROX Desktop")
+ print(" XFCE XFCE Desktop")
+ print(" Old Legacy systems")
+ print()
def show_version():
- print ME, VERSION
- print "Copyright (c) 2008 Dana Jansens"
- print
+ print(ME, VERSION)
+ print("Copyright (c) 2008 Dana Jansens")
+ print()
if __name__ == "__main__":
sys.exit(main())

View File

@ -0,0 +1,50 @@
From 9ed6fdd71890c5cc43747f105382d5677e5d37e7 Mon Sep 17 00:00:00 2001
From: pldubouilh <pldubouilh@gmail.com>
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)

View File

@ -0,0 +1,22 @@
Description: Removed top border on undecorated maximized windows
Author: Valentin Blot <debian-devel@valentinblot.org>
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)

View File

@ -1,37 +1,35 @@
Name: openbox Name: openbox
Version: 3.6.1 Version: 3.6.1
Release: 2mamba Release: 3mamba
Summary: A highly configurable, next generation window manager with extensive standards support Summary: A highly configurable, next generation window manager with extensive standards support
Group: Graphical Desktop/Applications/Environment Group: Graphical Desktop/Applications/Environment
Vendor: openmamba Vendor: openmamba
Distribution: openmamba Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://openbox.org URL: http://openbox.org/wiki/Main_Page
Source: http://openbox.org/dist/openbox/openbox-%{version}.tar.gz Source: http://openbox.org/dist/openbox/openbox-%{version}.tar.gz
Patch0: openbox-3.5.0-title-matching.patch
Patch1: openbox-3.5.0-which-2.20.patch
Patch2: openbox-3.5.1-kde-paths.patch
Patch3: openbox-3.5.1-python3.patch
Patch4: openbox-3.5.1-debian.patch
Patch5: openbox-3.6.1-undecorated_maximized_no_border.patch
Patch6: openbox-3.6.1-glib-2.78.4.patch
License: GPL License: GPL
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
BuildRequires: ldconfig
BuildRequires: libICE-devel BuildRequires: libICE-devel
BuildRequires: libSM-devel BuildRequires: libSM-devel
BuildRequires: libX11-devel BuildRequires: libX11-devel
BuildRequires: libXau-devel BuildRequires: libXau-devel
BuildRequires: libXcursor-devel BuildRequires: libXcursor-devel
BuildRequires: libXdmcp-devel
BuildRequires: libXext-devel BuildRequires: libXext-devel
BuildRequires: libXfixes-devel
BuildRequires: libXft-devel BuildRequires: libXft-devel
BuildRequires: libXinerama-devel BuildRequires: libXinerama-devel
BuildRequires: libXrandr-devel BuildRequires: libXrandr-devel
BuildRequires: libXrender-devel BuildRequires: libXrender-devel
BuildRequires: libblkid-devel
BuildRequires: libbrotli-devel
BuildRequires: libbsd-devel
BuildRequires: libbzip2-devel BuildRequires: libbzip2-devel
BuildRequires: libcairo-devel BuildRequires: libcairo-devel
BuildRequires: libcroco-devel
BuildRequires: libexpat-devel
BuildRequires: libffi-devel
BuildRequires: libfontconfig-devel BuildRequires: libfontconfig-devel
BuildRequires: libfreetype-devel BuildRequires: libfreetype-devel
BuildRequires: libgdk-pixbuf-devel BuildRequires: libgdk-pixbuf-devel
@ -39,22 +37,15 @@ BuildRequires: libglib-devel
BuildRequires: libgraphite2-devel BuildRequires: libgraphite2-devel
BuildRequires: libharfbuzz-devel BuildRequires: libharfbuzz-devel
BuildRequires: libimlib2-devel BuildRequires: libimlib2-devel
BuildRequires: liblzma-devel
BuildRequires: libmount-devel
BuildRequires: libpango-devel BuildRequires: libpango-devel
BuildRequires: libpcre-devel BuildRequires: libpcre-devel
BuildRequires: libpng-devel
BuildRequires: librsvg-devel BuildRequires: librsvg-devel
BuildRequires: libselinux-devel
BuildRequires: libsepol-devel
BuildRequires: libstartup-notification-devel BuildRequires: libstartup-notification-devel
BuildRequires: libuuid-devel
BuildRequires: libxcb-devel
BuildRequires: libxml2-devel BuildRequires: libxml2-devel
BuildRequires: libz-devel BuildRequires: libz-devel
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
Requires: python-xdg0 BuildRequires: python-pyxdg-py3
BuildRoot: %{_tmppath}/%{name}-%{version}-root Requires: python-pyxdg-py3
%description %description
Openbox is a highly configurable, next generation window manager with extensive standards support. Openbox is a highly configurable, next generation window manager with extensive standards support.
@ -89,6 +80,16 @@ This package contains static libraries and header files needed for development.
%setup -q %setup -q
sed -i "s,| arm-\* |,| aarch64-\* | arm-\* |," config.sub sed -i "s,| arm-\* |,| aarch64-\* | arm-\* |," config.sub
%patch 0 -p1
%patch 1 -p1
%patch 2 -p1
%patch 3 -p1
%patch 4 -p1
%patch 5 -p1 -b .undecorated_maximized_no_border
%patch 6 -p1 -b .glib-2.78.4
autoreconf -fi
%build %build
%configure %configure
%make %make
@ -147,17 +148,18 @@ sed -i "s,| arm-\* |,| aarch64-\* | arm-\* |," config.sub
%defattr(-,root,root) %defattr(-,root,root)
%dir %{_includedir} %dir %{_includedir}
%{_libdir}/libobt.a %{_libdir}/libobt.a
%{_libdir}/libobt.la
%{_libdir}/libobt.so %{_libdir}/libobt.so
%{_libdir}/libobrender.a %{_libdir}/libobrender.a
%{_libdir}/libobrender.la
%{_libdir}/libobrender.so %{_libdir}/libobrender.so
%{_includedir}/openbox %{_includedir}/openbox
#%{_includedir}/openbox/$OB_MAJOR_VERSION.$OB_MINOR_VERSION/openbox/*.h
%{_libdir}/pkgconfig/*.pc %{_libdir}/pkgconfig/*.pc
%doc README %doc README
%changelog %changelog
* Mon Apr 01 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 3.6.1-3mamba
- replace requirement for python-xdg0 with python-pyxdg-py3
- apply patches
* Thu Oct 01 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 3.6.1-2mamba * Thu Oct 01 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 3.6.1-2mamba
- rebuilt - rebuilt