Compare commits
33 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6632a9dc2 | ||
|
|
dd044ef15c | ||
|
|
aefca4e5a6 | ||
|
|
1920af6351 | ||
|
|
6a01f80d0e | ||
|
|
ecf900d00b | ||
|
|
89af9464d2 | ||
|
|
5dc0381e63 | ||
|
|
99ef8dd927 | ||
|
|
90761f25d7 | ||
|
|
9ae4613d5c | ||
|
|
914d821494 | ||
|
|
d13b2604b1 | ||
|
|
120c491539 | ||
|
|
1139a14d53 | ||
|
|
b2f5f2f3d2 | ||
|
|
16418a72a5 | ||
|
|
2aa142348a | ||
|
|
510b27d474 | ||
|
|
5e2c9f6f8b | ||
|
|
6a65188e7e | ||
|
|
f610eff92b | ||
|
|
36fd489271 | ||
|
|
92dfead7a2 | ||
|
|
866258f938 | ||
|
|
d4bca32634 | ||
|
|
36963dd5a4 | ||
|
|
b01785d47e | ||
|
|
80b27aea79 | ||
|
|
a0560de267 | ||
|
|
16d99fd5bf | ||
| 762ae24991 | |||
|
78363643cd |
19 changed files with 1531 additions and 24 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +1,2 @@
|
|||
/motif-2.3.4-src.tgz
|
||||
/motif-2.3.8.tar.gz
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
From 2fa554b01ef6079a9b35df9332bdc4f139ed67e0 Mon Sep 17 00:00:00 2001
|
||||
From: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sat, 29 Apr 2023 17:50:39 -0700
|
||||
Subject: [PATCH] Fix CVE-2023-43788: Out of bounds read in
|
||||
XpmCreateXpmImageFromBuffer
|
||||
|
||||
When the test case for CVE-2022-46285 was run with the Address Sanitizer
|
||||
enabled, it found an out-of-bounds read in ParseComment() when reading
|
||||
from a memory buffer instead of a file, as it continued to look for the
|
||||
closing comment marker past the end of the buffer.
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
---
|
||||
lib/Xm/Xpmdata.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/Xm/Xpmdata.c b/lib/Xm/Xpmdata.c
|
||||
index 7524e65..0b0f1f3 100644
|
||||
--- a/lib/Xm/Xpmdata.c
|
||||
+++ b/lib/Xm/Xpmdata.c
|
||||
@@ -108,7 +108,7 @@ ParseComment(xpmData *data)
|
||||
n++;
|
||||
s2++;
|
||||
} while (c == *s2 && *s2 != '\0' && c);
|
||||
- if (*s2 == '\0') {
|
||||
+ if (*s2 == '\0' || c == '\0') {
|
||||
/* this is the end of the comment */
|
||||
notend = 0;
|
||||
mdata->cptr--;
|
||||
--
|
||||
2.41.0
|
||||
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
From 7e21cb63b9a1ca760a06cc4cd9b19bbc3fcd8f51 Mon Sep 17 00:00:00 2001
|
||||
From: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sat, 29 Apr 2023 18:30:34 -0700
|
||||
Subject: [PATCH] Fix CVE-2023-43789: Out of bounds read on XPM with corrupted
|
||||
colormap
|
||||
|
||||
Found with clang's libfuzzer
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
---
|
||||
lib/Xm/Xpmdata.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/Xm/Xpmdata.c b/lib/Xm/Xpmdata.c
|
||||
index 0b0f1f3..6e87455 100644
|
||||
--- a/lib/Xm/Xpmdata.c
|
||||
+++ b/lib/Xm/Xpmdata.c
|
||||
@@ -259,13 +259,13 @@ xpmNextWord(
|
||||
int c;
|
||||
|
||||
if (!mdata->type || mdata->type == XPMBUFFER) {
|
||||
- while (isspace(c = *mdata->cptr) && c != mdata->Eos)
|
||||
+ while ((c = *mdata->cptr) && isspace(c) && (c != mdata->Eos))
|
||||
mdata->cptr++;
|
||||
do {
|
||||
c = *mdata->cptr++;
|
||||
*buf++ = c;
|
||||
n++;
|
||||
- } while (!isspace(c) && c != mdata->Eos && n < buflen);
|
||||
+ } while (c && !isspace(c) && (c != mdata->Eos) && (n < buflen));
|
||||
n--;
|
||||
mdata->cptr--;
|
||||
} else {
|
||||
--
|
||||
2.41.0
|
||||
|
||||
146
0001-Xm-Screen-Add-_NET_WORKAREA-support.patch
Normal file
146
0001-Xm-Screen-Add-_NET_WORKAREA-support.patch
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
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
|
||||
|
||||
28
0001-Xm-String-Fix-memory-leak.patch
Normal file
28
0001-Xm-String-Fix-memory-leak.patch
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
From 30ff6e00e9a5edc15ff438b6cfd8a5a4169630a1 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Mon, 16 Jun 2025 14:49:55 +0200
|
||||
Subject: [PATCH] Xm/String: Fix memory leak
|
||||
|
||||
ComputeMetrics() would leak the string created by _XmUtf8ToUcs2(), make
|
||||
sure to free the string once done with it.
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
---
|
||||
lib/Xm/XmString.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/lib/Xm/XmString.c b/lib/Xm/XmString.c
|
||||
index 2c54ef57..6ee1c40e 100644
|
||||
--- a/lib/Xm/XmString.c
|
||||
+++ b/lib/Xm/XmString.c
|
||||
@@ -6272,6 +6272,7 @@ ComputeMetrics(XmRendition rend,
|
||||
|
||||
XTextExtents16(font_struct, str, str_len,
|
||||
&dir, &asc, &desc, &char_ret);
|
||||
+ XFree(str);
|
||||
} else
|
||||
XTextExtents16(font_struct,
|
||||
(XChar2b *)text, Half(byte_count),
|
||||
--
|
||||
2.50.0
|
||||
|
||||
61
0001-build-Check-for-Xinerama-availability.patch
Normal file
61
0001-build-Check-for-Xinerama-availability.patch
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
From 3a164564cf8241ee4544ff012659e8eb510b195b Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Tue, 19 Nov 2024 18:40:33 +0100
|
||||
Subject: [PATCH 1/7] build: Check for Xinerama availability
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
---
|
||||
configure.ac | 22 ++++++++++++++++++++++
|
||||
lib/Xm/Makefile.am | 2 +-
|
||||
2 files changed, 23 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index d57f71e6..f0b2617d 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -280,7 +280,29 @@ AC_SUBST(LIB_XP)
|
||||
AC_FIND_XFT
|
||||
AC_IMAGE_SUPPORT
|
||||
|
||||
+AC_ARG_ENABLE(xinerama,[ --enable-xinerama Enable Xinerama (default=yes)])
|
||||
+if test "x$enable_xinerama" = "x"
|
||||
+then
|
||||
+ enable_xinerama="yes"
|
||||
+fi
|
||||
+
|
||||
+if test "x$enable_xinerama" = "xyes"
|
||||
+then
|
||||
+ AC_MSG_CHECKING([for libXinerama])
|
||||
+ AC_CHECK_HEADERS(X11/extensions/Xinerama.h,
|
||||
+ AC_CHECK_LIB(Xinerama, XineramaQueryExtension, ,enable_xinerama="no"),
|
||||
+ enable_xinerama="no")
|
||||
+fi
|
||||
+
|
||||
+if test "x$enable_xinerama" = "xyes"
|
||||
+then
|
||||
+ LIB_XINERAMA=-lXinerama
|
||||
+else
|
||||
+ LIB_XINERAMA=
|
||||
+fi
|
||||
|
||||
+AM_CONDITIONAL(XINERAMA, test "$enable_xinerama" = "yes")
|
||||
+AC_SUBST(LIB_XINERAMA)
|
||||
|
||||
# AM_CONDITIONAL(Motif22Compatibility, test x$enable_motif22_compatibility = xyes)
|
||||
|
||||
diff --git a/lib/Xm/Makefile.am b/lib/Xm/Makefile.am
|
||||
index a95fa2db..07b733f5 100644
|
||||
--- a/lib/Xm/Makefile.am
|
||||
+++ b/lib/Xm/Makefile.am
|
||||
@@ -71,7 +71,7 @@ else
|
||||
PRINTS_SRC =
|
||||
endif
|
||||
|
||||
-libXm_la_LIBADD = ${X_LIBS} ${X_XMU} -lXt -lXext ${LIB_XP} -lX11 ${X_EXTRA_LIBS}
|
||||
+libXm_la_LIBADD = ${X_LIBS} ${X_XMU} -lXt -lXext ${LIB_XP} ${LIB_XINERAMA} -lX11 ${X_EXTRA_LIBS}
|
||||
|
||||
noinst_HEADERS = BaseClassI.h \
|
||||
BitmapsI.h \
|
||||
--
|
||||
2.49.0
|
||||
|
||||
419
0002-Xm-Display-Add-optional-Xinerama-support.patch
Normal file
419
0002-Xm-Display-Add-optional-Xinerama-support.patch
Normal file
|
|
@ -0,0 +1,419 @@
|
|||
From f8aa9901f3cfa5fb49b809fdb223798623bede63 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Wed, 20 Nov 2024 10:26:28 +0100
|
||||
Subject: [PATCH 2/7] Xm/Display: Add optional Xinerama support
|
||||
|
||||
Xinerama support is disabled by default, unless the Xresource
|
||||
"enableXinerama" is set in the X resources database, e.g.:
|
||||
|
||||
*enableXinerama: True
|
||||
|
||||
This also provides an additional private Screen API to get the monitor
|
||||
boundaries given a point on screen. This is meant to be used in the
|
||||
following commits to implement Xinerama awareness in the relevant
|
||||
widgets.
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
---
|
||||
doc/man/man3/XmDisplay.3 | 2 +
|
||||
lib/Xm/Display.c | 95 +++++++++++++++++++++++++++++
|
||||
lib/Xm/DisplayP.h | 18 ++++++
|
||||
lib/Xm/Screen.c | 128 +++++++++++++++++++++++++++++++++++++++
|
||||
lib/Xm/ScreenP.h | 8 +++
|
||||
lib/Xm/xmstring.list.in | 2 +
|
||||
6 files changed, 253 insertions(+)
|
||||
|
||||
diff --git a/doc/man/man3/XmDisplay.3 b/doc/man/man3/XmDisplay.3
|
||||
index a57ea089..ec360c80 100644
|
||||
--- a/doc/man/man3/XmDisplay.3
|
||||
+++ b/doc/man/man3/XmDisplay.3
|
||||
@@ -158,6 +158,8 @@ XmNnoRenditionCallbackXmCCallbackXtCallbackListNULLC
|
||||
_____
|
||||
XmNuserDataXmCUserDataXtPointerNULLCSG
|
||||
_____
|
||||
+XmNenableXineramaXmCEnableXineramaBooleanFalseC
|
||||
+_____
|
||||
.TE
|
||||
.IP "\fBXmNdefaultButtonEmphasis\fP" 10
|
||||
Specifies whether to change the look of the PushButton widget and
|
||||
diff --git a/lib/Xm/Display.c b/lib/Xm/Display.c
|
||||
index 55fe4cd3..3ab047f2 100644
|
||||
--- a/lib/Xm/Display.c
|
||||
+++ b/lib/Xm/Display.c
|
||||
@@ -35,6 +35,9 @@ static char rcsid[] = "$TOG: Display.c /main/23 1997/06/18 17:36:59 samborn $"
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/extensions/shape.h>
|
||||
+#ifdef HAVE_LIBXINERAMA
|
||||
+#include <X11/extensions/Xinerama.h>
|
||||
+#endif
|
||||
|
||||
#include <X11/Xatom.h>
|
||||
#include <Xm/AtomMgr.h>
|
||||
@@ -273,6 +276,13 @@ static XtResource resources[] = {
|
||||
XtOffsetOf(WMShellRec, wm.wm_hints.icon_pixmap),
|
||||
XmRImmediate, NULL
|
||||
},
|
||||
+ /* Xinerama support */
|
||||
+ {
|
||||
+ XmNenableXinerama, XmCEnableXinerama,
|
||||
+ XmRBoolean, sizeof(Boolean),
|
||||
+ Offset(display.enable_xinerama),
|
||||
+ XmRImmediate, (XtPointer) False
|
||||
+ },
|
||||
};
|
||||
|
||||
#undef Offset
|
||||
@@ -388,6 +398,45 @@ DisplayClassInitialize( void )
|
||||
XmMakeCanonicalString("_MOTIF_DRAG_AND_DROP_MESSAGE");
|
||||
}
|
||||
|
||||
+static void
|
||||
+DisplayInitializeXinerama( XmDisplay xmDisplay )
|
||||
+{
|
||||
+#ifdef HAVE_LIBXINERAMA
|
||||
+ Display *display = XtDisplay(xmDisplay);
|
||||
+ int dummy1, dummy2;
|
||||
+ Status have_xinerama;
|
||||
+
|
||||
+ xmDisplay->display.monitors = NULL;
|
||||
+ xmDisplay->display.n_monitors = 0;
|
||||
+
|
||||
+ /* Xinerama support is disabled by default, unless XmNenableXinerama is set */
|
||||
+ if (!xmDisplay->display.enable_xinerama) {
|
||||
+#ifdef DEBUG_XINERAMA
|
||||
+ printf("XINERAMA support not enabled\n");
|
||||
+#endif /* DEBUG_XINERAMA */
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (!XineramaQueryExtension(display, &dummy1, &dummy2)) {
|
||||
+#ifdef DEBUG_XINERAMA
|
||||
+ printf("XINERAMA extension not available\n");
|
||||
+#endif /* DEBUG_XINERAMA */
|
||||
+ xmDisplay->display.enable_xinerama = False;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (!XineramaIsActive(display)) {
|
||||
+#ifdef DEBUG_XINERAMA
|
||||
+ printf("XINERAMA extension not activated\n");
|
||||
+#endif /* DEBUG_XINERAMA */
|
||||
+ xmDisplay->display.enable_xinerama = False;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ _XmDisplayUpdateXinerama(xmDisplay);
|
||||
+#endif /* HAVE_LIBXINERAMA */
|
||||
+}
|
||||
+
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
SetDragReceiverInfo(
|
||||
@@ -553,6 +602,8 @@ DisplayInitialize(
|
||||
XmDRAG_PREFER_PREREGISTER;
|
||||
}
|
||||
|
||||
+ DisplayInitializeXinerama(xmDisplay);
|
||||
+
|
||||
_XmVirtKeysInitialize (new_widget);
|
||||
|
||||
_XmProcessLock();
|
||||
@@ -672,6 +723,9 @@ DisplayDestroy(
|
||||
|
||||
_XmVirtKeysDestroy (w);
|
||||
|
||||
+#ifdef HAVE_LIBXINERAMA
|
||||
+ XFree(dd->display.monitors);
|
||||
+#endif /* HAVE_LIBXINERAMA */
|
||||
XDeleteContext( XtDisplay( w), None, context) ;
|
||||
}
|
||||
|
||||
@@ -1225,3 +1279,44 @@ _XmSetThicknessDefault0(
|
||||
value->addr = (XPointer)&thickness;
|
||||
|
||||
}
|
||||
+
|
||||
+
|
||||
+Boolean
|
||||
+_XmDisplayUseXinerama(
|
||||
+ XmDisplay xmDisplay )
|
||||
+{
|
||||
+ return xmDisplay && xmDisplay->display.enable_xinerama;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+void
|
||||
+_XmDisplayUpdateXinerama(
|
||||
+ XmDisplay xmDisplay )
|
||||
+{
|
||||
+#ifdef HAVE_LIBXINERAMA
|
||||
+#ifdef DEBUG_XINERAMA
|
||||
+ int i;
|
||||
+#endif /* DEBUG_XINERAMA */
|
||||
+
|
||||
+ if (!_XmDisplayUseXinerama(xmDisplay))
|
||||
+ return;
|
||||
+
|
||||
+#ifdef DEBUG_XINERAMA
|
||||
+ printf("Updating XINERAMA configuration\n");
|
||||
+#endif /* DEBUG_XINERAMA */
|
||||
+
|
||||
+ if (xmDisplay->display.monitors)
|
||||
+ XFree(xmDisplay->display.monitors);
|
||||
+
|
||||
+ xmDisplay->display.monitors =
|
||||
+ XineramaQueryScreens (XtDisplay(xmDisplay), &xmDisplay->display.n_monitors);
|
||||
+
|
||||
+#ifdef DEBUG_XINERAMA
|
||||
+ for (i = 0; i < xmDisplay->display.n_monitors; ++i) {
|
||||
+ printf("XINERAMA Monitor %i: (%i,%i) [%ix%i]\n", i,
|
||||
+ xmDisplay->display.monitors[i].x_org, xmDisplay->display.monitors[i].y_org,
|
||||
+ xmDisplay->display.monitors[i].width, xmDisplay->display.monitors[i].height);
|
||||
+ }
|
||||
+#endif /* DEBUG_XINERAMA */
|
||||
+#endif /* HAVE_LIBXINERAMA */
|
||||
+}
|
||||
diff --git a/lib/Xm/DisplayP.h b/lib/Xm/DisplayP.h
|
||||
index 655c29b6..a2420f96 100644
|
||||
--- a/lib/Xm/DisplayP.h
|
||||
+++ b/lib/Xm/DisplayP.h
|
||||
@@ -23,6 +23,14 @@
|
||||
#ifndef _XmDisplayP_h
|
||||
#define _XmDisplayP_h
|
||||
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+#include <config.h>
|
||||
+#endif
|
||||
+
|
||||
+#ifdef HAVE_LIBXINERAMA
|
||||
+#include <X11/extensions/Xinerama.h>
|
||||
+#endif
|
||||
+
|
||||
#include <Xm/DesktopP.h>
|
||||
#include <Xm/VendorSEP.h>
|
||||
#include <Xm/DropSMgr.h>
|
||||
@@ -115,6 +123,11 @@ typedef struct {
|
||||
Boolean enable_unselectable_drag;
|
||||
Boolean enable_thin_thickness;
|
||||
Boolean enable_multi_key_bindings;
|
||||
+ Boolean enable_xinerama;
|
||||
+#ifdef HAVE_LIBXINERAMA
|
||||
+ XineramaScreenInfo *monitors;
|
||||
+ int n_monitors;
|
||||
+#endif
|
||||
} XmDisplayPart, *XmDisplayPartPtr;
|
||||
|
||||
typedef struct _XmDisplayInfo {
|
||||
@@ -143,6 +156,11 @@ externalref XmDisplayClassRec xmDisplayClassRec;
|
||||
|
||||
externalref String _Xm_MOTIF_DRAG_AND_DROP_MESSAGE ;
|
||||
|
||||
+extern Boolean _XmDisplayUseXinerama(
|
||||
+ XmDisplay xmDisplay ) ;
|
||||
+
|
||||
+extern void _XmDisplayUpdateXinerama(
|
||||
+ XmDisplay xmDisplay ) ;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
diff --git a/lib/Xm/Screen.c b/lib/Xm/Screen.c
|
||||
index 10ba8d2b..44abcfb3 100644
|
||||
--- a/lib/Xm/Screen.c
|
||||
+++ b/lib/Xm/Screen.c
|
||||
@@ -396,7 +396,67 @@ GetUnitFromFont(
|
||||
}
|
||||
|
||||
}
|
||||
+#ifdef HAVE_LIBXINERAMA
|
||||
+/* ARGSUSED */
|
||||
+static void
|
||||
+StructureNotifyHandler(
|
||||
+ Widget wid,
|
||||
+ XtPointer data,
|
||||
+ XEvent *event,
|
||||
+ Boolean *cont )
|
||||
+{
|
||||
+ Display *display = XtDisplay(wid);
|
||||
+
|
||||
+#ifdef DEBUG_XINERAMA
|
||||
+ printf("Root event received\n");
|
||||
+#endif /* DEBUG_XINERAMA */
|
||||
|
||||
+ if (event->type == ConfigureNotify)
|
||||
+ _XmDisplayUpdateXinerama((XmDisplay) XmGetXmDisplay(display)) ;
|
||||
+}
|
||||
+
|
||||
+/* ARGSUSED */
|
||||
+static void
|
||||
+InstallStructureNotifyHandler(
|
||||
+ XmScreen xmScreen)
|
||||
+{
|
||||
+ Display *display = XtDisplay(xmScreen);
|
||||
+ Window rootwindow;
|
||||
+ XWindowAttributes rootattributes;
|
||||
+
|
||||
+ if (!_XmDisplayUseXinerama((XmDisplay) XmGetXmDisplay(display)))
|
||||
+ return;
|
||||
+
|
||||
+ rootwindow = RootWindowOfScreen(XtScreen(xmScreen));
|
||||
+ XGetWindowAttributes(display, rootwindow, &rootattributes);
|
||||
+ XSelectInput(display,
|
||||
+ rootwindow,
|
||||
+ StructureNotifyMask | rootattributes.your_event_mask);
|
||||
+ XtRegisterDrawable(display, rootwindow, (Widget)xmScreen);
|
||||
+ XtAddEventHandler((Widget)xmScreen,
|
||||
+ (EventMask) StructureNotifyMask, True,
|
||||
+ StructureNotifyHandler, (XtPointer) NULL);
|
||||
+}
|
||||
+
|
||||
+/* ARGSUSED */
|
||||
+static void
|
||||
+UninstallStructureNotifyHandler(
|
||||
+ XmScreen xmScreen)
|
||||
+{
|
||||
+ Display *display = XtDisplay(xmScreen);
|
||||
+ Window rootwindow;
|
||||
+ XWindowAttributes rootattributes;
|
||||
+
|
||||
+ if (!_XmDisplayUseXinerama((XmDisplay) XmGetXmDisplay(display)))
|
||||
+ return;
|
||||
+
|
||||
+ rootwindow = RootWindowOfScreen(XtScreen(xmScreen));
|
||||
+ XtUnregisterDrawable(display, rootwindow);
|
||||
+ XtRemoveEventHandler((Widget)xmScreen,
|
||||
+ (EventMask) StructureNotifyMask, True,
|
||||
+ StructureNotifyHandler, (XtPointer) NULL);
|
||||
+}
|
||||
+#endif /* HAVE_LIBXINERAMA */
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
@@ -413,6 +473,8 @@ Initialize(
|
||||
{
|
||||
XmScreen xmScreen = (XmScreen)new_widget;
|
||||
Display *display = XtDisplay(new_widget);
|
||||
+ Window rootwindow;
|
||||
+ XWindowAttributes rootattributes;
|
||||
|
||||
xmScreen->screen.screenInfo = NULL;
|
||||
|
||||
@@ -474,6 +536,9 @@ Initialize(
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef HAVE_LIBXINERAMA
|
||||
+ InstallStructureNotifyHandler(xmScreen);
|
||||
+#endif /* HAVE_LIBXINERAMA */
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
@@ -672,6 +737,10 @@ Destroy(
|
||||
|
||||
/* need to remove pixmap and GC related to this screen */
|
||||
_XmCleanPixmapCache (XtScreen(widget), NULL);
|
||||
+
|
||||
+#ifdef HAVE_LIBXINERAMA
|
||||
+ UninstallStructureNotifyHandler(xmScreen);
|
||||
+#endif /* HAVE_LIBXINERAMA */
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1447,3 +1516,62 @@ XmGetXmScreen(
|
||||
_XmAppUnlock(app);
|
||||
return widget;
|
||||
}
|
||||
+
|
||||
+void
|
||||
+_XmScreenGetBoundariesAtpoint(
|
||||
+ Screen *screen,
|
||||
+ Position pt_x,
|
||||
+ Position pt_y,
|
||||
+ Position *ret_x,
|
||||
+ Position *ret_y,
|
||||
+ Position *ret_max_x,
|
||||
+ Position *ret_max_y )
|
||||
+{
|
||||
+ XmDisplay xmDisplay;
|
||||
+ Position screen_x, screen_y;
|
||||
+ Position screen_max_x, screen_max_y;
|
||||
+#ifdef HAVE_LIBXINERAMA
|
||||
+ Position tmp_x, tmp_y;
|
||||
+ Position tmp_max_x, tmp_max_y;
|
||||
+ int i;
|
||||
+#endif /* HAVE_LIBXINERAMA */
|
||||
+
|
||||
+ xmDisplay = (XmDisplay) XmGetXmDisplay(DisplayOfScreen(screen));
|
||||
+ screen_x = 0;
|
||||
+ screen_y = 0;
|
||||
+ screen_max_x = WidthOfScreen(screen);
|
||||
+ screen_max_y = HeightOfScreen(screen);
|
||||
+
|
||||
+ if (!_XmDisplayUseXinerama(xmDisplay))
|
||||
+ goto out;
|
||||
+
|
||||
+#ifdef HAVE_LIBXINERAMA
|
||||
+ for (i = 0; i < xmDisplay->display.n_monitors; ++i) {
|
||||
+ tmp_x = xmDisplay->display.monitors[i].x_org;
|
||||
+ tmp_y = xmDisplay->display.monitors[i].y_org;
|
||||
+ tmp_max_x = tmp_x + xmDisplay->display.monitors[i].width;
|
||||
+ tmp_max_y = tmp_y + xmDisplay->display.monitors[i].height;
|
||||
+
|
||||
+ if (pt_x >= tmp_x && pt_x < tmp_max_x && pt_y >= tmp_y && pt_y < tmp_max_y) {
|
||||
+ screen_x = tmp_x;
|
||||
+ screen_y = tmp_y;
|
||||
+ screen_max_x = tmp_max_x;
|
||||
+ screen_max_y = tmp_max_y;
|
||||
+ break; /* We have a match */
|
||||
+ }
|
||||
+ }
|
||||
+#endif /* HAVE_LIBXINERAMA */
|
||||
+out:
|
||||
+#ifdef DEBUG_XINERAMA
|
||||
+ printf("Point (%i,%i) constrained within (%i,%i) and (%i,%i)\n",
|
||||
+ pt_x, pt_y, screen_x, screen_y, screen_max_x, screen_max_y);
|
||||
+#endif /* DEBUG_XINERAMA */
|
||||
+ if (ret_x)
|
||||
+ *ret_x = screen_x;
|
||||
+ if (ret_y)
|
||||
+ *ret_y = screen_y;
|
||||
+ if (ret_max_x)
|
||||
+ *ret_max_x = screen_max_x;
|
||||
+ if (ret_max_y)
|
||||
+ *ret_max_y = screen_max_y;
|
||||
+}
|
||||
diff --git a/lib/Xm/ScreenP.h b/lib/Xm/ScreenP.h
|
||||
index c870c19e..b4b95a6f 100644
|
||||
--- a/lib/Xm/ScreenP.h
|
||||
+++ b/lib/Xm/ScreenP.h
|
||||
@@ -134,6 +134,14 @@ typedef struct _XmScreenRec {
|
||||
XmScreenPart screen;
|
||||
} XmScreenRec;
|
||||
|
||||
+extern void _XmScreenGetBoundariesAtpoint(
|
||||
+ Screen *screen,
|
||||
+ Position pt_x,
|
||||
+ Position pt_y,
|
||||
+ Position *ret_x,
|
||||
+ Position *ret_y,
|
||||
+ Position *ret_max_x,
|
||||
+ Position *ret_max_y ) ;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
diff --git a/lib/Xm/xmstring.list.in b/lib/Xm/xmstring.list.in
|
||||
index 8c0c4f9a..5887e7ad 100644
|
||||
--- a/lib/Xm/xmstring.list.in
|
||||
+++ b/lib/Xm/xmstring.list.in
|
||||
@@ -1692,6 +1692,8 @@ CFontEncoding
|
||||
NxftFont
|
||||
CXftFont
|
||||
SUTF8_STRING
|
||||
+NenableXinerama
|
||||
+CEnableXinerama
|
||||
|
||||
#file XmStrDefsI.h
|
||||
#table _XmStringsI
|
||||
--
|
||||
2.49.0
|
||||
|
||||
145
0002-Xm-Screen-Add-_GTK_WORKAREAS-support-for-multi-monit.patch
Normal file
145
0002-Xm-Screen-Add-_GTK_WORKAREAS-support-for-multi-monit.patch
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
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
|
||||
|
||||
136
0003-Xm-MenuShell-Use-Xinerama-to-place-menus.patch
Normal file
136
0003-Xm-MenuShell-Use-Xinerama-to-place-menus.patch
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
From 5fbc1dff0e2e248d61e43c362606c3f5e5255f7d Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Thu, 21 Nov 2024 11:52:22 +0100
|
||||
Subject: [PATCH 3/7] Xm/MenuShell: Use Xinerama to place menus
|
||||
|
||||
v2: If we have a pulldown button, use the location of that button to
|
||||
keep the menu on the same monitor as that button so that the menu
|
||||
doesn't eventually end up on another monitor entirely.
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
---
|
||||
lib/Xm/MenuShell.c | 47 +++++++++++++++++++++++++++++-----------------
|
||||
1 file changed, 30 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/lib/Xm/MenuShell.c b/lib/Xm/MenuShell.c
|
||||
index 483cc95a..c78bfb08 100644
|
||||
--- a/lib/Xm/MenuShell.c
|
||||
+++ b/lib/Xm/MenuShell.c
|
||||
@@ -41,6 +41,7 @@ static char rcsid[] = "$TOG: MenuShell.c /main/24 1999/07/08 16:49:59 vipin $"
|
||||
#include <Xm/LabelP.h>
|
||||
#include <Xm/LayoutT.h>
|
||||
#include <Xm/MenuT.h>
|
||||
+#include <Xm/ScreenP.h>
|
||||
#include <Xm/SpecRenderT.h>
|
||||
#include <Xm/TraitP.h>
|
||||
#include <Xm/TransltnsP.h>
|
||||
@@ -913,7 +914,9 @@ ForceMenuPaneOnScreen(
|
||||
register Position *y )
|
||||
{
|
||||
Position rightEdgeOfMenu, bottomEdgeOfMenu;
|
||||
- Dimension dispWidth, dispHeight;
|
||||
+ Position dispX, dispY, dispMaxX, dispMaxY;
|
||||
+ Position x1 = *x;
|
||||
+ Position y1 = *y;
|
||||
Widget pulldown_button = RC_CascadeBtn(rowcol);
|
||||
Dimension RowColBorderWidth = rowcol->core.border_width << 1;
|
||||
Dimension CascadeBorderWidth = 0;
|
||||
@@ -925,8 +928,18 @@ ForceMenuPaneOnScreen(
|
||||
|
||||
rightEdgeOfMenu = *x + RowColBorderWidth + rowcol->core.width;
|
||||
bottomEdgeOfMenu = *y + RowColBorderWidth + rowcol->core.height;
|
||||
- dispWidth = WidthOfScreen (XtScreen(rowcol));
|
||||
- dispHeight = HeightOfScreen (XtScreen(rowcol));
|
||||
+#ifdef HAVE_LIBXINERAMA
|
||||
+ if (pulldown_button)
|
||||
+ {
|
||||
+ /* If we have a pulldown button, use the location of that button to
|
||||
+ * keep the menu on the same monitor as that button so that the menu
|
||||
+ * doesn't eventually end up on another monitor entirely.
|
||||
+ */
|
||||
+ XtTranslateCoords((Widget) pulldown_button,
|
||||
+ XtX(pulldown_button), XtY(pulldown_button), &x1, &y1);
|
||||
+ }
|
||||
+#endif
|
||||
+ _XmScreenGetBoundariesAtpoint(XtScreen(rowcol), x1, y1, &dispX, &dispY, &dispMaxX, &dispMaxY);
|
||||
|
||||
/*
|
||||
* For OPTION menus, if the submenu is [partially] offscreen, offset it
|
||||
@@ -937,9 +950,9 @@ ForceMenuPaneOnScreen(
|
||||
(RC_Type(XtParent(pulldown_button)) == XmMENU_OPTION))
|
||||
{
|
||||
Position old_x = *x;
|
||||
- if (bottomEdgeOfMenu >= (Position)dispHeight)
|
||||
+ if (bottomEdgeOfMenu >= dispMaxY)
|
||||
{
|
||||
- *y = dispHeight - rowcol->core.height - RowColBorderWidth - 1;
|
||||
+ *y = dispMaxY - rowcol->core.height - RowColBorderWidth - 1;
|
||||
if (LayoutIsRtoLM(rowcol))
|
||||
*x = old_x - rowcol->core.width - (rowcol->core.border_width <<1);
|
||||
else
|
||||
@@ -948,9 +961,9 @@ ForceMenuPaneOnScreen(
|
||||
bottomEdgeOfMenu = *y + RowColBorderWidth + rowcol->core.height;
|
||||
}
|
||||
|
||||
- if (*y < 0)
|
||||
+ if (*y < dispY)
|
||||
{
|
||||
- *y = 0;
|
||||
+ *y = dispY;
|
||||
|
||||
/* Consider CascadeBtn as well as RowCol width to allow multi
|
||||
* column RowColumn
|
||||
@@ -963,13 +976,13 @@ ForceMenuPaneOnScreen(
|
||||
bottomEdgeOfMenu = *y + RowColBorderWidth + rowcol->core.height;
|
||||
}
|
||||
|
||||
- if (rightEdgeOfMenu >= (Position)dispWidth)
|
||||
+ if (rightEdgeOfMenu >= dispMaxX)
|
||||
{
|
||||
*x = old_x - rowcol->core.width + RowColBorderWidth;
|
||||
rightEdgeOfMenu = *x + RowColBorderWidth + rowcol->core.width;
|
||||
}
|
||||
|
||||
- if (*x < 0)
|
||||
+ if (*x < dispX)
|
||||
{
|
||||
if (LayoutIsRtoLM(rowcol))
|
||||
*x = old_x + pulldown_button->core.width + CascadeBorderWidth;
|
||||
@@ -982,10 +995,10 @@ ForceMenuPaneOnScreen(
|
||||
/*
|
||||
* If the submenu is offscreen force it completely on.
|
||||
*/
|
||||
- if (rightEdgeOfMenu >= (Position)dispWidth)
|
||||
- *x -= (rightEdgeOfMenu - dispWidth + 1);
|
||||
+ if (rightEdgeOfMenu >= dispMaxX)
|
||||
+ *x -= (rightEdgeOfMenu - dispMaxX + 1);
|
||||
|
||||
- if (bottomEdgeOfMenu >= (Position)dispHeight)
|
||||
+ if (bottomEdgeOfMenu >= dispMaxY)
|
||||
{
|
||||
if (pulldown_button && XtParent(pulldown_button) &&
|
||||
(RC_Type(XtParent(pulldown_button)) == XmMENU_BAR))
|
||||
@@ -1005,15 +1018,15 @@ ForceMenuPaneOnScreen(
|
||||
*y = y_temp;
|
||||
}
|
||||
else
|
||||
- *y -= (bottomEdgeOfMenu - dispHeight + 1);
|
||||
+ *y -= (bottomEdgeOfMenu - dispMaxY + 1);
|
||||
}
|
||||
|
||||
/* Make sure that the top left corner os on screen! */
|
||||
- if (*x < 0)
|
||||
- *x = 0;
|
||||
+ if (*x < dispX)
|
||||
+ *x = dispX;
|
||||
|
||||
- if (*y < 0)
|
||||
- *y = 0;
|
||||
+ if (*y < dispY)
|
||||
+ *y = dispY;
|
||||
}
|
||||
|
||||
/*
|
||||
--
|
||||
2.49.0
|
||||
|
||||
65
0004-Xm-DropDown-Use-Xinerama-for-placement.patch
Normal file
65
0004-Xm-DropDown-Use-Xinerama-for-placement.patch
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
From 0e834a8d37dfabd8fa4463f83c132478e50f8337 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Thu, 21 Nov 2024 14:11:11 +0100
|
||||
Subject: [PATCH 4/7] Xm/DropDown: Use Xinerama for placement
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
---
|
||||
lib/Xm/DropDown.c | 18 +++++++++---------
|
||||
1 file changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/lib/Xm/DropDown.c b/lib/Xm/DropDown.c
|
||||
index a25d1092..665e0e26 100644
|
||||
--- a/lib/Xm/DropDown.c
|
||||
+++ b/lib/Xm/DropDown.c
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "XmI.h"
|
||||
#include <Xm/VaSimpleP.h>
|
||||
#include <Xm/DrawP.h>
|
||||
-
|
||||
+#include <Xm/ScreenP.h>
|
||||
#include <Xm/DropDownP.h>
|
||||
|
||||
#include <X11/Shell.h>
|
||||
@@ -2169,8 +2169,9 @@ PopupList(Widget w)
|
||||
XmDropDownWidget cbw = (XmDropDownWidget) w;
|
||||
Widget shell = XmDropDown_popup_shell(cbw);
|
||||
Position x, y, temp;
|
||||
+ Position dispX, dispY, dispMaxX, dispMaxY;
|
||||
Dimension width;
|
||||
- int ret, scr_width, scr_height;
|
||||
+ int ret;
|
||||
Arg args[10];
|
||||
Cardinal num_args;
|
||||
|
||||
@@ -2209,21 +2210,20 @@ PopupList(Widget w)
|
||||
*
|
||||
* Lets start by getting the width and height of the screen.
|
||||
*/
|
||||
- scr_width = WidthOfScreen(XtScreen(shell));
|
||||
- scr_height = HeightOfScreen(XtScreen(shell));
|
||||
+ _XmScreenGetBoundariesAtpoint(XtScreen(shell), x, y, &dispX, &dispY, &dispMaxX, &dispMaxY);
|
||||
|
||||
- if( (int)(y + XtHeight(shell)) > scr_height )
|
||||
+ if( (int)(y + XtHeight(shell)) > dispMaxY )
|
||||
{
|
||||
Position tmp;
|
||||
XtTranslateCoords(w, 0, 0, &tmp, &y);
|
||||
y -= ((int)XtHeight(shell));
|
||||
}
|
||||
- if( y < 0 ) y = 0;
|
||||
- if( (int)(x + width) > scr_width )
|
||||
+ if( y < dispY ) y = dispY;
|
||||
+ if( (int)(x + width) > dispMaxX )
|
||||
{
|
||||
- x = scr_width - ((int)width);
|
||||
+ x = dispMaxX - ((int)width);
|
||||
}
|
||||
- if( x < 0 ) x = 0;
|
||||
+ if( x < dispX ) x = dispX;
|
||||
|
||||
XtSetArg(args[num_args], XmNx, x); num_args++;
|
||||
XtSetArg(args[num_args], XmNy, y); num_args++;
|
||||
--
|
||||
2.49.0
|
||||
|
||||
70
0005-Xm-RCMenu-Use-Xinerama-for-placement.patch
Normal file
70
0005-Xm-RCMenu-Use-Xinerama-for-placement.patch
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
From 3ef8c038b06f136a6abe7cfa23afec4d514af4f0 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Thu, 21 Nov 2024 14:17:21 +0100
|
||||
Subject: [PATCH 5/7] Xm/RCMenu: Use Xinerama for placement
|
||||
|
||||
Please note that when building with Xinerama enabled, the placement
|
||||
logic changes, as the original location of the CascadeButton is not
|
||||
taken into account when relocating the RCMenu widget.
|
||||
|
||||
Reason for that is because I reckon the current code is not correct, as
|
||||
it moves the RCMenu way off the screen, yet it doesn't show without
|
||||
Xinerama because there is another check later to make sure the widget
|
||||
remains on the overall screen, hence hiding the problem.
|
||||
|
||||
With Xinerama, that breaks in-between monitors and the RCMenu ends up
|
||||
completely misplaced, which is why I think the code was wrong, yet the
|
||||
logic is preserved when building without XINERAMA support to preserve
|
||||
the current behavior if needed.
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
---
|
||||
lib/Xm/RCMenu.c | 18 ++++++++++++++----
|
||||
1 file changed, 14 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/lib/Xm/RCMenu.c b/lib/Xm/RCMenu.c
|
||||
index 2c698d4f..abd7a70e 100644
|
||||
--- a/lib/Xm/RCMenu.c
|
||||
+++ b/lib/Xm/RCMenu.c
|
||||
@@ -537,6 +537,7 @@ LocatePulldown(
|
||||
XEvent *event )
|
||||
{
|
||||
Position x, y, x1, y1;
|
||||
+ Position dispX, dispMaxX;
|
||||
|
||||
if (root == NULL)
|
||||
return;
|
||||
@@ -617,17 +618,26 @@ LocatePulldown(
|
||||
* window co-ords.
|
||||
*/
|
||||
XtTranslateCoords( (Widget) p, x, y, &x1, &y1);
|
||||
+ _XmScreenGetBoundariesAtpoint(XtScreen(m), x1, y1, &dispX, NULL, &dispMaxX, NULL);
|
||||
|
||||
/* Oh no! we're going off screen. Let's try and do
|
||||
something reasonable. We're only doing the cascade
|
||||
off a menu case for now. (CR 6421) */
|
||||
- if ((x1 + XtWidth(m)) > WidthOfScreen(XtScreen(m))) {
|
||||
+ if ((x1 + XtWidth(m)) > dispMaxX) {
|
||||
if (!IsOption(root) && (XmIsCascadeButton(p) || XmIsCascadeButtonGadget(p))) {
|
||||
- x1 -= XtWidth(m) + x - XtX(p);
|
||||
+ x1 -= XtWidth(m) + x;
|
||||
+#ifndef HAVE_LIBXINERAMA
|
||||
+ /* XXX: I don't think it's correct, but that's what the original code was doing… */
|
||||
+ x1 -= XtX(p);
|
||||
+#endif /* not HAVE_LIBXINERAMA */
|
||||
}
|
||||
- } else if (x1 < 0) { /* R to L case */
|
||||
+ } else if (x1 < dispX) { /* R to L case */
|
||||
if (!IsOption(root) && (XmIsCascadeButton(p) || XmIsCascadeButtonGadget(p))) {
|
||||
- x1 += XtWidth(m) + x - XtX(p);
|
||||
+ x1 += XtWidth(m) + x;
|
||||
+#ifndef HAVE_LIBXINERAMA
|
||||
+ /* XXX: I don't think it's correct, but that's what the original code was doing… */
|
||||
+ x1 -= XtX(p);
|
||||
+#endif /* not HAVE_LIBXINERAMA */
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.49.0
|
||||
|
||||
53
0006-Xm-Tooltip-Use-Xinerama-for-placement.patch
Normal file
53
0006-Xm-Tooltip-Use-Xinerama-for-placement.patch
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
From f2bc91c789ed33fc1e0a31d167a6a7bc0383429e Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Thu, 21 Nov 2024 14:24:30 +0100
|
||||
Subject: [PATCH 6/7] Xm/Tooltip: Use Xinerama for placement
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
---
|
||||
lib/Xm/ToolTip.c | 13 +++++++++----
|
||||
1 file changed, 9 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/lib/Xm/ToolTip.c b/lib/Xm/ToolTip.c
|
||||
index dc65071d..fdd32221 100644
|
||||
--- a/lib/Xm/ToolTip.c
|
||||
+++ b/lib/Xm/ToolTip.c
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <Xm/VendorSEP.h>
|
||||
#include <Xm/GadgetP.h>
|
||||
#include <Xm/SlideC.h>
|
||||
+#include <Xm/ScreenP.h>
|
||||
#include <Xm/TraitP.h>
|
||||
#include <Xm/ToolTipCT.h>
|
||||
#include <Xm/ToolTipT.h>
|
||||
@@ -153,6 +154,8 @@ ToolTipPost (XtPointer client_data,
|
||||
XtWidgetGeometry geo;
|
||||
Position destX,
|
||||
destY;
|
||||
+ Position dispMaxX,
|
||||
+ dispMaxY;
|
||||
|
||||
XmToolTipConfigTrait ttp; /* ToolTip pointer */
|
||||
|
||||
@@ -197,12 +200,14 @@ ToolTipPost (XtPointer client_data,
|
||||
Don't let the tip be off the right/bottom of the screen
|
||||
*/
|
||||
destX = rx + (XmIsGadget (w) ? XtX (w) : 0) - x + XtWidth (w) / 2;
|
||||
- if (destX + geo.width > WidthOfScreen (XtScreen (w)))
|
||||
+ destY = ry + (XmIsGadget (w) ? XtY (w) : 0) - y + XtHeight (w);
|
||||
+ _XmScreenGetBoundariesAtpoint(XtScreen(w), destX, destY, NULL, NULL, &dispMaxX, &dispMaxY);
|
||||
+
|
||||
+ if (destX + geo.width > dispMaxX)
|
||||
{
|
||||
- destX = WidthOfScreen (XtScreen (w)) - geo.width;
|
||||
+ destX = dispMaxX - geo.width;
|
||||
}
|
||||
- destY = ry + (XmIsGadget (w) ? XtY (w) : 0) - y + XtHeight (w);
|
||||
- if (destY + geo.height > HeightOfScreen (XtScreen (w)))
|
||||
+ if (destY + geo.height > dispMaxY)
|
||||
{
|
||||
destY = ry + (XmIsGadget (w) ? XtY (w) : 0) - y - geo.height;
|
||||
}
|
||||
--
|
||||
2.49.0
|
||||
|
||||
51
0007-Xm-ComboBox-Use-Xinerama-for-placement.patch
Normal file
51
0007-Xm-ComboBox-Use-Xinerama-for-placement.patch
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
From eb193dce2b7f8ce80004d14ccf64c53552ae103c Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Thu, 21 Nov 2024 14:30:23 +0100
|
||||
Subject: [PATCH 7/7] Xm/ComboBox: Use Xinerama for placement
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
---
|
||||
lib/Xm/ComboBox.c | 11 +++++++----
|
||||
1 file changed, 7 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/lib/Xm/ComboBox.c b/lib/Xm/ComboBox.c
|
||||
index 1472e458..0f49de50 100644
|
||||
--- a/lib/Xm/ComboBox.c
|
||||
+++ b/lib/Xm/ComboBox.c
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <Xm/DisplayP.h>
|
||||
#include <Xm/DrawP.h>
|
||||
#include <Xm/GrabShellP.h>
|
||||
+#include <Xm/ScreenP.h>
|
||||
#include <Xm/List.h>
|
||||
#include <Xm/TextF.h>
|
||||
#include <Xm/TraitP.h>
|
||||
@@ -1791,6 +1792,7 @@ CBDropDownList(Widget widget,
|
||||
Cardinal n;
|
||||
int tmp;
|
||||
Position root_x, root_y, shell_x, shell_y;
|
||||
+ Position dispX, dispY, dispMaxX, dispMaxY;
|
||||
Dimension shell_width;
|
||||
|
||||
XtTranslateCoords((Widget)cb, XtX(cb), XtY(cb), &root_x, &root_y);
|
||||
@@ -1801,12 +1803,13 @@ CBDropDownList(Widget widget,
|
||||
XtY(cb);
|
||||
|
||||
/* Try to position the shell on the screen. */
|
||||
- tmp = WidthOfScreen(XtScreen(cb)) - XtWidth(CB_ListShell(cb));
|
||||
+ _XmScreenGetBoundariesAtpoint(XtScreen(cb), shell_x, shell_y, &dispX, &dispY, &dispMaxX, &dispMaxY);
|
||||
+ tmp = dispMaxX - XtWidth(CB_ListShell(cb));
|
||||
tmp = MIN(tmp, shell_x);
|
||||
- shell_x = MAX(0, tmp);
|
||||
- tmp = HeightOfScreen(XtScreen(cb)) - XtHeight(CB_ListShell(cb));
|
||||
+ shell_x = MAX(dispX, tmp);
|
||||
+ tmp = dispMaxY - XtHeight(CB_ListShell(cb));
|
||||
tmp = MIN(tmp, shell_y);
|
||||
- shell_y = MAX(0, tmp);
|
||||
+ shell_y = MAX(dispY, tmp);
|
||||
|
||||
/* CR 8446: The shell width may have changed unexpectedly. */
|
||||
shell_width = XtWidth(cb) - 2 * CB_HighlightThickness(cb);
|
||||
--
|
||||
2.49.0
|
||||
|
||||
72
includes.patch
Normal file
72
includes.patch
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
--- motif-2.3.8/lib/Xm/XpmCrBufFrI.c~ 2016-03-15 21:10:08.000000000 -0500
|
||||
+++ motif-2.3.8/lib/Xm/XpmCrBufFrI.c 2025-08-14 14:07:13.543514735 -0500
|
||||
@@ -39,7 +39,7 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
-
|
||||
+#include <string.h>
|
||||
|
||||
/* October 2004, source code review by Thomas Biege <thomas@suse.de> */
|
||||
|
||||
--- motif-2.3.8/lib/Xm/XpmWrFFrI.c~ 2016-03-15 21:10:08.000000000 -0500
|
||||
+++ motif-2.3.8/lib/Xm/XpmWrFFrI.c 2025-08-14 14:10:27.307965260 -0500
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
+#include <string.h>
|
||||
|
||||
/* October 2004, source code review by Thomas Biege <thomas@suse.de> */
|
||||
|
||||
--- motif-2.3.8/lib/Xm/Xpmrgb.c~ 2016-03-15 21:10:08.000000000 -0500
|
||||
+++ motif-2.3.8/lib/Xm/Xpmrgb.c 2025-08-14 14:13:47.593686683 -0500
|
||||
@@ -50,6 +50,7 @@
|
||||
|
||||
#include "XpmI.h"
|
||||
#include <ctype.h>
|
||||
+#include <string.h>
|
||||
|
||||
#ifndef FOR_MSW /* normal part first, MSW part at
|
||||
* the end, (huge ifdef!) */
|
||||
--- motif-2.3.8/lib/Xm/XpmCrDatFrI.c~ 2016-03-15 21:10:08.000000000 -0500
|
||||
+++ motif-2.3.8/lib/Xm/XpmCrDatFrI.c 2025-08-14 14:14:21.697225831 -0500
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
+#include <string.h>
|
||||
|
||||
/* October 2004, source code review by Thomas Biege <thomas@suse.de> */
|
||||
|
||||
--- motif-2.3.8/lib/Xm/XpmRdFToI.c~ 2016-03-15 21:10:08.000000000 -0500
|
||||
+++ motif-2.3.8/lib/Xm/XpmRdFToI.c 2025-08-14 14:16:09.040737658 -0500
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
+#include <string.h>
|
||||
|
||||
/* October 2004, source code review by Thomas Biege <thomas@suse.de> */
|
||||
|
||||
--- motif-2.3.8/lib/Xm/Xpmcreate.c~ 2016-03-15 21:10:08.000000000 -0500
|
||||
+++ motif-2.3.8/lib/Xm/Xpmcreate.c 2025-08-14 14:17:00.651339098 -0500
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
+#include <string.h>
|
||||
|
||||
/* October 2004, source code review by Thomas Biege <thomas@suse.de> */
|
||||
|
||||
--- motif-2.3.8/lib/Xm/XpmI.h~ 2017-08-16 19:38:43.000000000 -0500
|
||||
+++ motif-2.3.8/lib/Xm/XpmI.h 2025-08-14 14:20:19.913720840 -0500
|
||||
@@ -28,6 +28,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
+#include <string.h>
|
||||
+
|
||||
/* Xpm internal symbols are prefixed with _Xm */
|
||||
|
||||
#define xpmParseData _XmxpmParseData
|
||||
19
motif-c99-string.patch
Normal file
19
motif-c99-string.patch
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
Unconditionally include <string.h>, to avoid implicit function
|
||||
declarations. libXpm defines SYSV during the build, which is why they
|
||||
do not see t his isssue.
|
||||
|
||||
diff --git a/lib/Xm/XpmI.h b/lib/Xm/XpmI.h
|
||||
index bbba02b0cac1f91e..3468f2d1edf84f7c 100644
|
||||
--- a/lib/Xm/XpmI.h
|
||||
+++ b/lib/Xm/XpmI.h
|
||||
@@ -118,9 +118,9 @@ extern "C" {
|
||||
extern FILE *popen();
|
||||
#endif
|
||||
|
||||
-#if defined(SYSV) || defined(SVR4) || defined(VMS) || defined(WIN32) || defined (_SVID_SOURCE)
|
||||
#include <string.h>
|
||||
|
||||
+#if defined(SYSV) || defined(SVR4) || defined(VMS) || defined(WIN32) || defined (_SVID_SOURCE)
|
||||
#ifndef index
|
||||
#define index strchr
|
||||
#endif
|
||||
37
motif-c99-void-sprintf.patch
Normal file
37
motif-c99-void-sprintf.patch
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
Stop defining VOID_SPRINTF, following what upstream libXpm does. The
|
||||
check has an implicit declaration of exit and an implicit int, so it
|
||||
will fail to build with future compilers.
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 3b412361e6f43da4..6cbeb2f5eea235eb 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -120,7 +120,6 @@ AC_FUNC_STRCOLL
|
||||
AC_FUNC_STRFTIME
|
||||
AC_FUNC_FORK([])
|
||||
AC_FUNC_VPRINTF
|
||||
-AM_FUNC_VOID_SPRINTF
|
||||
AC_CHECK_FUNCS(wcslen wcscpy wcsncpy wcschr wcscat wcsncat getcwd gettimeofday mkdir re_comp regcmp select strcspn strerror strstr strtod strtol uname)
|
||||
AC_CHECK_FUNCS(strdup,,AC_DEFINE(NEED_STRDUP, 1, no strdup))
|
||||
AC_CHECK_FUNCS(strcasecmp,,AC_DEFINE(NEED_STRCASECMP, 1, no strcasecmp))
|
||||
--- motif-2.3.8/acinclude.m4~ 2025-08-14 13:27:19.058051442 -0500
|
||||
+++ motif-2.3.8/acinclude.m4 2025-08-14 13:29:04.868675609 -0500
|
||||
@@ -46,18 +46,6 @@
|
||||
fi
|
||||
])
|
||||
|
||||
-dnl This test is not very reliable probably ...
|
||||
-AC_DEFUN([AM_FUNC_VOID_SPRINTF],
|
||||
-[AC_CACHE_CHECK(whether sprintf returns void, ac_cv_func_void_sprintf,
|
||||
-[AC_TRY_RUN([#include <stdio.h>
|
||||
-int sprintf(); main() { exit(sprintf(".")); }],
|
||||
- ac_cv_func_void_sprintf=no, ac_cv_func_void_sprintf=yes, ac_cv_func_void_sprintf=yes)])
|
||||
-if test $ac_cv_func_void_sprintf = no; then
|
||||
- AC_DEFINE(VOID_SPRINTF,1,
|
||||
- [Define if sprintf doesn't return the number of chars written])
|
||||
-fi
|
||||
-])
|
||||
-
|
||||
dnl This tests whether weak aliases are supported.
|
||||
AC_DEFUN([WEAK_ALIAS_SUPPORT],
|
||||
[AC_CACHE_CHECK(whether weak aliases are supported, ac_cv_weak_alias_support,
|
||||
20
motif-configure-c99.patch
Normal file
20
motif-configure-c99.patch
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
Another implicit declaration of exit in the -DXTHREADS check, which
|
||||
will go wrong with future compilers that do not support implicit
|
||||
function declarations.
|
||||
|
||||
diff --git a/acinclude.m4 b/acinclude.m4
|
||||
index 61706f3e63d94d8a..88edfce3d169a267 100644
|
||||
--- a/acinclude.m4
|
||||
+++ b/acinclude.m4
|
||||
@@ -22,9 +22,9 @@ int main() {
|
||||
Boolean brc;
|
||||
brc=XtToolkitThreadInitialize();
|
||||
if (True==brc)
|
||||
- exit(0);
|
||||
+ return 0;
|
||||
else
|
||||
- exit(1);
|
||||
+ return 1;
|
||||
}
|
||||
],
|
||||
lt_cv_xthreads=yes,
|
||||
162
motif.spec
162
motif.spec
|
|
@ -1,22 +1,19 @@
|
|||
Summary: Run-time libraries and programs
|
||||
Name: motif
|
||||
Version: 2.3.4
|
||||
Release: 17%{?dist}
|
||||
License: LGPLv2+
|
||||
Group: System Environment/Libraries
|
||||
Source: http://downloads.sf.net/motif/motif-%{version}-src.tgz
|
||||
Version: 2.3.8
|
||||
Release: 4%{?dist}
|
||||
# Automatically converted from old format: LGPLv2+ - review is highly recommended.
|
||||
License: LicenseRef-Callaway-LGPLv2+
|
||||
Source: http://downloads.sf.net/motif/motif-%{version}.tar.gz
|
||||
Source1: xmbind
|
||||
URL: http://www.motifzone.net/
|
||||
Obsoletes: openmotif < 2.3.4
|
||||
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
|
||||
BuildRequires: flex-static
|
||||
%endif
|
||||
BuildRequires: byacc, pkgconfig
|
||||
BuildRequires: libjpeg-devel libpng-devel
|
||||
BuildRequires: libXft-devel libXmu-devel libXp-devel libXt-devel libXext-devel
|
||||
|
|
@ -31,6 +28,28 @@ 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: motif-configure-c99.patch
|
||||
Patch50: motif-c99-void-sprintf.patch
|
||||
Patch51: motif-c99-string.patch
|
||||
# CVE-2023-43788
|
||||
Patch55: 0001-Fix-CVE-2023-43788-Out-of-bounds-read-in-XpmCreateXp.patch
|
||||
# CVE-2023-43789
|
||||
Patch56: 0001-Fix-CVE-2023-43789-Out-of-bounds-read-on-XPM-with-co.patch
|
||||
# https://sourceforge.net/p/motif/code/merge-requests/9/
|
||||
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
|
||||
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://sourceforge.net/p/motif/code/merge-requests/10/
|
||||
Patch65: 0001-Xm-String-Fix-memory-leak.patch
|
||||
# https://sourceforge.net/p/motif/code/merge-requests/11/
|
||||
Patch66: 0001-Xm-Screen-Add-_NET_WORKAREA-support.patch
|
||||
Patch67: 0002-Xm-Screen-Add-_GTK_WORKAREAS-support-for-multi-monit.patch
|
||||
|
||||
Patch68: includes.patch
|
||||
|
||||
Conflicts: lesstif <= 0.92.32-6
|
||||
|
||||
|
|
@ -41,7 +60,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}
|
||||
|
|
@ -56,7 +74,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}
|
||||
|
||||
|
|
@ -65,18 +82,36 @@ This package contains the static Motif libraries.
|
|||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch22 -p1 -b .no_demos
|
||||
%patch23 -p1 -b .uil_lib
|
||||
%patch43 -p1 -b .rgbtxt
|
||||
%patch45 -p1 -b .mwmrc_dir
|
||||
%patch46 -p1 -b .bindings
|
||||
%patch47 -p1 -b .no_X11R6
|
||||
%patch48 -p1 -b .format-security
|
||||
%patch -P 22 -p1 -b .no_demos
|
||||
%patch -P 23 -p1 -b .uil_lib
|
||||
%patch -P 43 -p1 -b .rgbtxt
|
||||
%patch -P 45 -p1 -b .mwmrc_dir
|
||||
%patch -P 46 -p1 -b .bindings
|
||||
%patch -P 47 -p1 -b .no_X11R6
|
||||
%patch -P 48 -p1 -b .format-security
|
||||
%patch -P 49 -p1
|
||||
%patch -P 50 -p1
|
||||
%patch -P 51 -p1
|
||||
%patch -P 55 -p1
|
||||
%patch -P 56 -p1
|
||||
%patch -P 58 -p1 -b .xinerama
|
||||
%patch -P 59 -p1 -b .xinerama
|
||||
%patch -P 60 -p1 -b .xinerama
|
||||
%patch -P 61 -p1 -b .xinerama
|
||||
%patch -P 62 -p1 -b .xinerama
|
||||
%patch -P 63 -p1 -b .xinerama
|
||||
%patch -P 64 -p1 -b .xinerama
|
||||
%patch -P 65 -p1 -b .utf8-memleak
|
||||
%patch -P 66 -p1 -b .net-workarea
|
||||
%patch -P 67 -p1 -b .gtk-workareas
|
||||
|
||||
%patch -P 68 -p1 -b .includes
|
||||
|
||||
%build
|
||||
CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64" \
|
||||
./autogen.sh --libdir=%{_libdir} --enable-static --enable-xft --enable-jpeg \
|
||||
--enable-png
|
||||
export CFLAGS="$CFLAGS -std=gnu17"
|
||||
touch AUTHORS NEWS
|
||||
autoreconf -fi
|
||||
%configure --enable-static --enable-xft --enable-jpeg --enable-png
|
||||
|
||||
make clean %{?_smp_mflags}
|
||||
make -C include
|
||||
|
|
@ -90,8 +125,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
|
||||
%ldconfig_scriptlets
|
||||
|
||||
%files
|
||||
%doc COPYING README RELEASE RELNOTES
|
||||
|
|
@ -123,6 +157,88 @@ rm -f %{buildroot}%{_libdir}/*.la
|
|||
%{_libdir}/lib*.a
|
||||
|
||||
%changelog
|
||||
* Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.8-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
|
||||
|
||||
* Fri Jan 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.8-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
|
||||
|
||||
* Thu Dec 11 2025 Olivier Fourdan <ofourdan@redhat.com> - 2.3.8-2
|
||||
- Fix memleak in XmString from:
|
||||
https://sourceforge.net/p/motif/code/merge-requests/10/
|
||||
- Add NET_WORKAREA and GTK_WORKAREAS support from:
|
||||
https://sourceforge.net/p/motif/code/merge-requests/11/
|
||||
|
||||
* Thu Aug 14 2025 Gwyn Ciesla <gwync@protonmail.com> - 2.3.8-1
|
||||
- 2.3.8
|
||||
|
||||
* Thu Jul 24 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-39
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
|
||||
|
||||
* Mon Jun 2 2025 Olivier Fourdan <ofourdan@redhat.com> - 2.3.4-38
|
||||
- Add Xinerama support from https://sourceforge.net/p/motif/code/merge-requests/9/
|
||||
|
||||
* Fri Jan 17 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-37
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
|
||||
|
||||
* Mon Sep 02 2024 Miroslav Suchý <msuchy@redhat.com> - 2.3.4-36
|
||||
- convert license to SPDX
|
||||
|
||||
* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-35
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
|
||||
|
||||
* Sun Apr 14 2024 Yaakov Selkowitz <yselkowi@redhat.com> - 2.3.4-34
|
||||
- Drop xorg-x11-xinit dependency
|
||||
|
||||
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-33
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Sun Jan 21 2024 Florian Weimer <fweimer@redhat.com> - 2.3.4-32
|
||||
- Backport upstream patch to fix incompatible-pointer-types issues
|
||||
|
||||
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-31
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Mon Nov 27 2023 José Expósito <jexposit@redhat.com> - 2.3.4-30
|
||||
- Fix CVE-2023-43788: out of bounds read in XpmCreateXpmImageFromBuffer()
|
||||
- Fix CVE-2023-43789: out of bounds read on XPM with corrupted colormap
|
||||
|
||||
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-29
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
* Fri Apr 14 2023 Florian Weimer <fweimer@redhat.com> - 2.3.4-28
|
||||
- Port to C99 (#2186773)
|
||||
|
||||
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-27
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-26
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Thu Feb 03 2022 Adam Jackson <ajax@redhat.com> - 2.3.4-25
|
||||
- Fix invoking autogen/configure so the default CFLAGS actually get applied
|
||||
|
||||
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-24
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-23
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* 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
|
||||
|
||||
|
|
|
|||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
612bb8127d0d31da6e5474edf8a5c247 motif-2.3.4-src.tgz
|
||||
SHA512 (motif-2.3.8.tar.gz) = 1ab8e8eece25ef97e948592b5fa3e19d98e932695290a18b7a8e90f1aa2766bc4f082bdbc3999dff5660e684821178a149040f76bb477163e53ca06474d02b55
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue