Compare commits

...

No commits in common. "c8" and "c9-beta" have entirely different histories.
c8 ... c9-beta

3 changed files with 53 additions and 338 deletions

View File

@ -1,146 +0,0 @@
From 78a0cd5bdbe447bab807a09fae18d8a961366abc Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Mon, 16 Jun 2025 14:29:22 +0200
Subject: [PATCH 1/2] Xm/Screen: Add _NET_WORKAREA support
Add support for the extended window manager hint _NET_WORKAREA to
prevent Motif from placing its widgets outside of the geometry
advertised by the window manager.
Support for _NET_WORKAREA depends on the Xinerama patches as it shares
the same logic.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
---
lib/Xm/Screen.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 108 insertions(+)
diff --git a/lib/Xm/Screen.c b/lib/Xm/Screen.c
index 44abcfb3..6269ffb3 100644
--- a/lib/Xm/Screen.c
+++ b/lib/Xm/Screen.c
@@ -1517,6 +1517,113 @@ XmGetXmScreen(
return widget;
}
+static int
+_XmScreenGetCurrentDesktop(Screen *screen)
+{
+ static Atom XmA_NET_CURRENT_DESKTOP = None;
+ Atom type;
+ Display *dpy;
+ Window rootwindow;
+ int result = False;
+ int desktop = 0;
+ int format;
+ unsigned long lengthRtn;
+ unsigned long bytesAfter;
+ unsigned char *data;
+
+ dpy = DisplayOfScreen(screen);
+ rootwindow = RootWindowOfScreen(screen);
+
+ if (XmA_NET_CURRENT_DESKTOP == None)
+ XmA_NET_CURRENT_DESKTOP = XInternAtom(dpy, "_NET_CURRENT_DESKTOP", False);
+
+ result =XGetWindowProperty(dpy, rootwindow,
+ XmA_NET_CURRENT_DESKTOP,
+ 0L, 100000L, False, XA_CARDINAL,
+ &type, &format, &lengthRtn, &bytesAfter,
+ &data);
+
+ if (type == XA_CARDINAL) {
+ desktop = *(int *)data;
+ XFree(data);
+ }
+#ifdef DEBUG_XINERAMA
+ printf("Current desktop is %i\n", desktop);
+#endif /* DEBUG_XINERAMA */
+
+ return desktop;
+}
+
+static void
+_XmCheckNetWorkarea(
+ Screen *screen,
+ Position *ret_x,
+ Position *ret_y,
+ Position *ret_max_x,
+ Position *ret_max_y )
+{
+ static Atom XmA_NET_WORKAREA = None;
+ Atom type;
+ Display *dpy;
+ Window rootwindow;
+ int result = False;
+ int desktop = 0;
+ int format;
+ unsigned long lengthRtn;
+ unsigned long bytesAfter;
+ unsigned char *data;
+ long *net_workarea;
+
+ dpy = DisplayOfScreen(screen);
+ rootwindow = RootWindowOfScreen(screen);
+ desktop = _XmScreenGetCurrentDesktop(screen);
+
+ if (XmA_NET_WORKAREA == None)
+ XmA_NET_WORKAREA = XInternAtom(dpy, "_NET_WORKAREA", False);
+
+ result =XGetWindowProperty(dpy, rootwindow,
+ XmA_NET_WORKAREA,
+ 0L, 100000L, False, XA_CARDINAL,
+ &type, &format, &lengthRtn, &bytesAfter,
+ &data);
+
+ if (result != Success || type != XA_CARDINAL || format != 32 ||
+ bytesAfter != 0 || lengthRtn % 4 != 0 || desktop + 1 > lengthRtn / 4)
+ goto done;
+
+ net_workarea = (long *) data;
+
+#define NET_WORKAREA_X (desktop * 4)
+#define NET_WORKAREA_Y (desktop * 4 + 1)
+#define NET_WORKAREA_WIDTH (desktop * 4 + 2)
+#define NET_WORKAREA_HEIGHT (desktop * 4 + 3)
+
+ if (*ret_x < net_workarea[NET_WORKAREA_X])
+ *ret_x = net_workarea[NET_WORKAREA_X];
+
+ if (*ret_y < net_workarea[NET_WORKAREA_Y])
+ *ret_y = net_workarea[NET_WORKAREA_Y];
+
+ if (*ret_max_x > net_workarea[NET_WORKAREA_X] + net_workarea[NET_WORKAREA_WIDTH])
+ *ret_max_x = net_workarea[NET_WORKAREA_X] + net_workarea[NET_WORKAREA_WIDTH];
+
+ if (*ret_max_y > net_workarea[NET_WORKAREA_Y] + net_workarea[NET_WORKAREA_HEIGHT])
+ *ret_max_y = net_workarea[NET_WORKAREA_Y] + net_workarea[NET_WORKAREA_HEIGHT];
+
+#undef NET_WORKAREA_X
+#undef NET_WORKAREA_Y
+#undef NET_WORKAREA_WIDTH
+#undef NET_WORKAREA_HEIGHT
+
+#ifdef DEBUG_XINERAMA
+ printf("_NET_WORKAREA within (%i,%i) and (%i,%i)\n", *ret_x, *ret_y, *ret_max_x, *ret_max_y);
+#endif /* DEBUG_XINERAMA */
+
+done:
+ if (data)
+ XFree(data);
+}
+
void
_XmScreenGetBoundariesAtpoint(
Screen *screen,
@@ -1561,6 +1668,7 @@ _XmScreenGetBoundariesAtpoint(
}
}
#endif /* HAVE_LIBXINERAMA */
+ _XmCheckNetWorkarea(screen, &screen_x, &screen_y, &screen_max_x, &screen_max_y);
out:
#ifdef DEBUG_XINERAMA
printf("Point (%i,%i) constrained within (%i,%i) and (%i,%i)\n",
--
2.50.0

View File

@ -1,145 +0,0 @@
From 2f18ccbffee237845c0b3c2d745d20ac66748f8a Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Fri, 27 Jun 2025 12:11:41 +0200
Subject: [PATCH 2/2] Xm/Screen: Add _GTK_WORKAREAS support for multi-monitor
Add support for the GTK property _GTK_WORKAREAS to prevent Motif from
placing its widgets outside of the geometry advertised by the window
manager on a multi-monitor setup.
Unlike the extended window manager hint _NET_WORKAREA which defines a
single rectangle for the whole screen spanning across all the monitors,
_GTK_WORKAREAS provides an area per monitor, making that property more
adequate on a multi-monitor setup.
However, if _GTK_WORKAREAS is not supported, we fallback to the standard
_NET_WORKAREA property.
Support for _GTK_WORKAREAS depends on the Xinerama patches as it shares
the same logic.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
---
lib/Xm/Screen.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 91 insertions(+), 1 deletion(-)
diff --git a/lib/Xm/Screen.c b/lib/Xm/Screen.c
index 6269ffb3..d8d24e9a 100644
--- a/lib/Xm/Screen.c
+++ b/lib/Xm/Screen.c
@@ -1554,6 +1554,91 @@ _XmScreenGetCurrentDesktop(Screen *screen)
return desktop;
}
+static Boolean
+_XmCheckGtkWorkareas(
+ Screen *screen,
+ Position pt_x,
+ Position pt_y,
+ Position *ret_x,
+ Position *ret_y,
+ Position *ret_max_x,
+ Position *ret_max_y )
+{
+ Atom XmA_GTK_WORKAREAS;
+ Atom type;
+ Display *dpy;
+ Window rootwindow;
+ int result = False;
+ int desktop = 0;
+ int format;
+ unsigned long lengthRtn;
+ unsigned long bytesAfter;
+ unsigned char *data;
+ long *gtk_workareas;
+ char atom_name[32];
+ int monitor, n_monitors;
+ Position tmp_x, tmp_y;
+ Position tmp_max_x, tmp_max_y;
+ Boolean ret = False;
+
+ dpy = DisplayOfScreen(screen);
+ rootwindow = RootWindowOfScreen(screen);
+ desktop = _XmScreenGetCurrentDesktop(screen);
+
+ snprintf(atom_name, sizeof(atom_name), "_GTK_WORKAREAS_D%d", desktop);
+ XmA_GTK_WORKAREAS = XInternAtom(dpy, atom_name, False);
+
+ result = XGetWindowProperty(dpy, rootwindow,
+ XmA_GTK_WORKAREAS,
+ 0L, 100000L, False, XA_CARDINAL,
+ &type, &format, &lengthRtn, &bytesAfter,
+ &data);
+
+ if (result != Success || type != XA_CARDINAL || format != 32 ||
+ bytesAfter != 0 || lengthRtn % 4 != 0) {
+ goto done;
+ }
+
+ gtk_workareas = (long *) data;
+ n_monitors = lengthRtn / 4;
+
+#define GTK_WORKAREA_X (monitor * 4)
+#define GTK_WORKAREA_Y (monitor * 4 + 1)
+#define GTK_WORKAREA_WIDTH (monitor * 4 + 2)
+#define GTK_WORKAREA_HEIGHT (monitor * 4 + 3)
+
+ for (monitor = 0; monitor < n_monitors; ++monitor) {
+ tmp_x = gtk_workareas[GTK_WORKAREA_X];
+ tmp_y = gtk_workareas[GTK_WORKAREA_Y];
+ tmp_max_x = tmp_x + gtk_workareas[GTK_WORKAREA_WIDTH];
+ tmp_max_y = tmp_y + gtk_workareas[GTK_WORKAREA_HEIGHT];
+
+ if (pt_x >= tmp_x && pt_x < tmp_max_x && pt_y >= tmp_y && pt_y < tmp_max_y) {
+ *ret_x = tmp_x;
+ *ret_y = tmp_y;
+ *ret_max_x = tmp_max_x;
+ *ret_max_y = tmp_max_y;
+ ret = True;
+ break; /* We have a match */
+ }
+ }
+
+#undef GTK_WORKAREA_X
+#undef GTK_WORKAREA_Y
+#undef GTK_WORKAREA_WIDTH
+#undef GTK_WORKAREA_HEIGHT
+
+#ifdef DEBUG_XINERAMA
+ printf("Point (%i,%i) constrained by _GTK_WORKAREAS_D%d within (%i,%i) and (%i,%i)\n",
+ pt_x, pt_y, desktop, *ret_x, *ret_y, *ret_max_x, *ret_max_y);
+#endif /* DEBUG_XINERAMA */
+
+done:
+ if (data)
+ XFree(data);
+ return ret;
+}
+
static void
_XmCheckNetWorkarea(
Screen *screen,
@@ -1637,6 +1722,7 @@ _XmScreenGetBoundariesAtpoint(
XmDisplay xmDisplay;
Position screen_x, screen_y;
Position screen_max_x, screen_max_y;
+ Boolean check_gtk_workarea;
#ifdef HAVE_LIBXINERAMA
Position tmp_x, tmp_y;
Position tmp_max_x, tmp_max_y;
@@ -1668,7 +1754,11 @@ _XmScreenGetBoundariesAtpoint(
}
}
#endif /* HAVE_LIBXINERAMA */
- _XmCheckNetWorkarea(screen, &screen_x, &screen_y, &screen_max_x, &screen_max_y);
+ check_gtk_workarea = _XmCheckGtkWorkareas(screen, pt_x, pt_y,
+ &screen_x, &screen_y,
+ &screen_max_x, &screen_max_y);
+ if (!check_gtk_workarea)
+ _XmCheckNetWorkarea(screen, &screen_x, &screen_y, &screen_max_x, &screen_max_y);
out:
#ifdef DEBUG_XINERAMA
printf("Point (%i,%i) constrained within (%i,%i) and (%i,%i)\n",
--
2.50.0

View File

@ -1,9 +1,8 @@
Summary: Run-time libraries and programs
Name: motif
Version: 2.3.4
Release: 24%{?dist}
Release: 31%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
Source: http://downloads.sf.net/motif/motif-%{version}-src.tgz
Source1: xmbind
URL: http://www.motifzone.net/
@ -12,6 +11,7 @@ Provides: openmotif = %{version}-%{release}
Requires: xorg-x11-xbitmaps
Requires: xorg-x11-xinit
BuildRequires: make
BuildRequires: automake, libtool, autoconf, flex
# flex static libs have been part of flex for RHEL <= 6 and Fedora <= 12
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
@ -30,9 +30,6 @@ Patch43: openMotif-2.3.0-rgbtxt.patch
Patch45: motif-2.3.4-mwmrc_dir.patch
Patch46: motif-2.3.4-bindings.patch
Patch47: openMotif-2.3.0-no_X11R6.patch
# FTBFS #1448819
Patch48: motif-2.3.4-Fix-issues-with-Werror-format-security.patch
Patch49: openmotif-2.3.1-rhbz_997241.patch
Patch50: motif-2.3.5-motifzone_1654.patch
Patch51: motif-2.3.4-motifzone_1564-88bdce1.patch
@ -40,13 +37,17 @@ Patch52: revert-of-motifzone_1565.patch
Patch53: motifzone_1660.patch
Patch54: motifzone_1612.patch
# FTBFS #1448819
Patch48: motif-2.3.4-Fix-issues-with-Werror-format-security.patch
# rhbz#2125560
Patch55: 0001-EditresCom-Fix-build-with-modern-systems.patch
# CVE-2023-43788
Patch56: 0001-Fix-CVE-2023-43788-Out-of-bounds-read-in-XpmCreateXp.patch
# CVE-2023-43789
Patch57: 0001-Fix-CVE-2023-43789-Out-of-bounds-read-on-XPM-with-co.patch
# https://issues.redhat.com/browse/RHEL-67987
# https://issues.redhat.com/browse/RHEL-69956
Patch58: 0001-build-Check-for-Xinerama-availability.patch
Patch59: 0002-Xm-Display-Add-optional-Xinerama-support.patch
Patch60: 0003-Xm-MenuShell-Use-Xinerama-to-place-menus.patch
@ -54,12 +55,9 @@ Patch61: 0004-Xm-DropDown-Use-Xinerama-for-placement.patch
Patch62: 0005-Xm-RCMenu-Use-Xinerama-for-placement.patch
Patch63: 0006-Xm-Tooltip-Use-Xinerama-for-placement.patch
Patch64: 0007-Xm-ComboBox-Use-Xinerama-for-placement.patch
# https://issues.redhat.com/browse/RHEL-96948
# https://issues.redhat.com/browse/RHEL-100816
Patch65: 0001-Xm-String-Fix-memory-leak.patch
# https://issues.redhat.com/browse/RHEL-97048
# (see also https://issues.redhat.com/browse/RHEL-87743)
Patch66: 0001-Xm-Screen-Add-_NET_WORKAREA-support.patch
Patch67: 0002-Xm-Screen-Add-_GTK_WORKAREAS-support-for-multi-monit.patch
Conflicts: lesstif <= 0.92.32-6
@ -70,7 +68,6 @@ linked against Motif and the Motif Window Manager mwm.
%package devel
Summary: Development libraries and header files
Group: Development/Libraries
Conflicts: lesstif-devel <= 0.92.32-6
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: libjpeg-devel%{?_isa} libpng-devel%{?_isa}
@ -85,7 +82,6 @@ header files and also static libraries necessary to build Motif applications.
%package static
Summary: Static libraries
Group: Development/Libraries
Conflicts: lesstif-devel <= 0.92.32-6
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
@ -101,7 +97,6 @@ This package contains the static Motif libraries.
%patch46 -p1 -b .bindings
%patch47 -p1 -b .no_X11R6
%patch48 -p1 -b .format-security
%patch49 -p1 -b .rhbz_997241
%patch50 -p1 -b .motifzone_1654
%patch51 -p1 -b .motifzone_1564-88bdce1
@ -119,16 +114,10 @@ This package contains the static Motif libraries.
%patch63 -p1 -b .xinerama
%patch64 -p1 -b .xinerama
%patch65 -p1 -b .memleak
%patch66 -p1 -b .net_workarea
%patch67 -p1 -b .gtk_workareas
%build
CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64" \
./autogen.sh --libdir=%{_libdir} --enable-static --enable-xft --enable-jpeg \
--enable-png
%configure --libdir=%{_libdir} --enable-static --enable-xft --enable-jpeg \
--enable-png
./autogen.sh
%configure --enable-static --enable-xft --enable-jpeg --enable-png
make clean %{?_smp_mflags}
make -C include
@ -142,11 +131,7 @@ install -m 755 %{SOURCE1} %{buildroot}/etc/X11/xinit/xinitrc.d/xmbind.sh
rm -f %{buildroot}%{_libdir}/*.la
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%clean
rm -rf %{buildroot}
%ldconfig_scriptlets
%files
%doc COPYING README RELEASE RELNOTES
@ -178,38 +163,59 @@ rm -rf %{buildroot}
%{_libdir}/lib*.a
%changelog
* Fri Sep 5 2025 Olivier Fourdan <ofourdan@redhat.com> - 2.3.4-24
- Add support for _NET_WORKAREA and _GTK_WORKAREAS
Resolves: RHEL-97048
* Fri Jun 27 2025 Olivier Fourdan <ofourdan@redhat.com> - 2.3.4-23
* Fri Jun 27 2025 Olivier Fourdan <ofourdan@redhat.com> - 2.3.4-31
- Fix a memory leak with UTF-8 strings
Resolves: RHEL-96948
Resolves: RHEL-100816
* Mon Jun 2 2025 Olivier Fourdan <ofourdan@redhat.com> - 2.3.4-22
* Mon Jun 2 2025 Olivier Fourdan <ofourdan@redhat.com> - 2.3.4-30
- Keep drop-down menus on the same monitor as the pull-down button with
Xinerama
Resolves: RHEL-91951
Resolves: RHEL-92832
* Mon Nov 25 2024 Olivier Fourdan <ofourdan@redhat.com> - 2.3.4-21
- Add Xinerama support (RHEL-67987)
* Mon Nov 25 2024 Olivier Fourdan <ofourdan@redhat.com> - 2.3.4-29
- Add Xinerama support (RHEL-69956)
* Mon Nov 27 2023 José Expósito <jexposit@redhat.com> - 2.3.4-20
* Mon Nov 27 2023 José Expósito <jexposit@redhat.com> - 2.3.4-28
- Fix CVE-2023-43788: out of bounds read in XpmCreateXpmImageFromBuffer()
- Fix CVE-2023-43789: out of bounds read on XPM with corrupted colormap
* Mon Sep 26 2022 Olivier Fourdan <ofourdan@redhat.com> - 2.3.4-19
- Fix LONG_BIT definition missing (rhbz#2124810)
* Mon Sep 26 2022 Olivier Fourdan <ofourdan@redhat.com> - 2.3.4-27
- Fix LONG_BIT definition missing (rhbz#2125560)
* Wed Sep 07 2022 Mika Penttila <mpenttil@redhat.com> - 2.3.4-18
- Version bump
* Thu May 12 2022 Mika Penttila <mpenttil@redhat.com> - 2.3.4-26
- Added patches from rhel-7
* Fri Apr 08 2022 Mika Penttila <mpenttil@redhat.com> - 2.3.4-17
- Added forgotten patches and corrected release number
* Thu Feb 03 2022 Adam Jackson <ajax@redhat.com> - 2.3.4-25
- Fix invoking autogen/configure so the default CFLAGS actually get applied
Resolves: rhbz#2044881
* Tue Sep 11 2018 Carlos Soriano <csoriano@redhat.com> - 2.3.4-16
- Fix hardened flags, make sure to always pass LDFLAGS on the spec
- Resolves: RHBZ#1624143
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.3.4-24
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.3.4-23
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild