From 2a21f00c35a42af80db735ff761d80572fcd2174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=20Penttil=C3=A4?= Date: Thu, 12 May 2022 11:45:15 +0300 Subject: [PATCH] Add patches from rhel-7 Resolves: rhbz#2066634 --- motif-2.3.4-motifzone_1564-88bdce1.patch | 449 +++++++++++++++++++++++ motif-2.3.5-motifzone_1654.patch | 39 ++ motif.spec | 18 +- motifzone_1612.patch | 104 ++++++ motifzone_1660.patch | 27 ++ openmotif-2.3.1-rhbz_997241.patch | 11 + revert-of-motifzone_1565.patch | 427 +++++++++++++++++++++ 7 files changed, 1074 insertions(+), 1 deletion(-) create mode 100644 motif-2.3.4-motifzone_1564-88bdce1.patch create mode 100644 motif-2.3.5-motifzone_1654.patch create mode 100644 motifzone_1612.patch create mode 100644 motifzone_1660.patch create mode 100644 openmotif-2.3.1-rhbz_997241.patch create mode 100644 revert-of-motifzone_1565.patch diff --git a/motif-2.3.4-motifzone_1564-88bdce1.patch b/motif-2.3.4-motifzone_1564-88bdce1.patch new file mode 100644 index 0000000..c2f533a --- /dev/null +++ b/motif-2.3.4-motifzone_1564-88bdce1.patch @@ -0,0 +1,449 @@ +commit 88bdce139baf89839b6e13d698576fc56211e845 +Author: Oleksiy Chernyavskyy +Date: Wed Mar 16 00:46:49 2016 +0200 + + Reimplemented bugfix 1565 + + Signed-off-by: Oleksiy Chernyavskyy + +diff --git a/lib/Xm/ComboBox.c b/lib/Xm/ComboBox.c +index 1472e45..cf507da 100644 +--- a/lib/Xm/ComboBox.c ++++ b/lib/Xm/ComboBox.c +@@ -3164,6 +3164,9 @@ CreatePulldown(Widget parent, + Arg args[4]; + ArgList merged_args; + Cardinal n; ++#ifdef FIX_1565 ++ XmGrabShellWidget grabsh; ++#endif + + n = 0; + XtSetArg(args[n], XmNlayoutDirection, LayoutM(parent)), n++; +@@ -3175,6 +3178,11 @@ CreatePulldown(Widget parent, + merged_args, n + *num_args); + XtFree((char*)merged_args); + ++#ifdef FIX_1565 ++ grabsh = (XmGrabShellWidget) shell; ++ grabsh->grab_shell.set_input_focus = False; ++#endif ++ + return shell; + } + +diff --git a/lib/Xm/DropDown.c b/lib/Xm/DropDown.c +index 37fec03..5cd15ca 100644 +--- a/lib/Xm/DropDown.c ++++ b/lib/Xm/DropDown.c +@@ -2027,6 +2027,9 @@ CreatePopup(Widget w, ArgList args, Cardinal num_args) + Arg *new_list, largs[10]; + Cardinal num_largs; + Widget sb; ++#ifdef FIX_1565 ++ XmGrabShellWidget grabsh; ++#endif + + num_largs = 0; + XtSetArg(largs[num_largs], XmNoverrideRedirect, True); num_largs++; +@@ -2040,6 +2043,10 @@ CreatePopup(Widget w, ArgList args, Cardinal num_args) + xmGrabShellWidgetClass, w, + new_list, + num_largs + num_args); ++#ifdef FIX_1565 ++ grabsh = (XmGrabShellWidget) XmDropDown_popup_shell(cbw); ++ grabsh->grab_shell.set_input_focus = False; ++#endif + XtFree((char *) new_list); + + #ifdef FIX_1446 +diff --git a/lib/Xm/GrabShell.c b/lib/Xm/GrabShell.c +index 88f3154..af13e0b 100644 +--- a/lib/Xm/GrabShell.c ++++ b/lib/Xm/GrabShell.c +@@ -283,6 +283,10 @@ Initialize(Widget req, /* unused */ + + /* CR 9920: Popdown may be requested before MapNotify. */ + grabsh->grab_shell.mapped = False; ++ ++#ifdef FIX_1565 ++ grabsh->grab_shell.set_input_focus = True; ++#endif + } + + /* +@@ -395,8 +399,16 @@ MapNotifyHandler(Widget shell, XtPointer client_data, + XGetInputFocus(XtDisplay(shell), &grabshell->grab_shell.old_focus, + &grabshell->grab_shell.old_revert_to); + old_handler = XSetErrorHandler(IgnoreXErrors); +- XSetInputFocus(XtDisplay(shell), XtWindow(shell), RevertToParent, time); +- XSync(XtDisplay(shell), False); ++#ifdef FIX_1565 ++ if (! grabshell->grab_shell.set_input_focus) { ++ XmForceGrabKeyboard(shell, time); ++ } else { ++#endif ++ XSetInputFocus(XtDisplay(shell), XtWindow(shell), RevertToParent, time); ++ XSync(XtDisplay(shell), False); ++#ifdef FIX_1565 ++ } ++#endif + XSetErrorHandler(old_handler); + } + +diff --git a/lib/Xm/GrabShellP.h b/lib/Xm/GrabShellP.h +index 92fe508..025f001 100644 +--- a/lib/Xm/GrabShellP.h ++++ b/lib/Xm/GrabShellP.h +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include "XmI.h" + + #ifdef __cplusplus + extern "C" { +@@ -55,6 +56,9 @@ typedef struct + Boolean mapped; + Window old_focus; + int old_revert_to; ++#ifdef FIX_1565 ++ Boolean set_input_focus; ++#endif + } XmGrabShellPart; + + +diff --git a/lib/Xm/MenuShell.c b/lib/Xm/MenuShell.c +index 2ed3dd8..9887087 100644 +--- a/lib/Xm/MenuShell.c ++++ b/lib/Xm/MenuShell.c +@@ -1514,9 +1514,7 @@ ChangeManaged( + + /** the real grab ***/ + _XmMenuGrabKeyboardAndPointer((Widget)rowcol, _time); +-#ifndef FIX_1565 + _XmMenuFocus(XtParent(rowcol), XmMENU_BEGIN, _time); +-#endif + + /* To support menu replay, keep the pointer in sync mode */ + XAllowEvents(XtDisplay(rowcol), SyncPointer, CurrentTime); +diff --git a/lib/Xm/MenuUtil.c b/lib/Xm/MenuUtil.c +index 1d88390..2fb6a27 100644 +--- a/lib/Xm/MenuUtil.c ++++ b/lib/Xm/MenuUtil.c +@@ -1053,11 +1053,7 @@ _XmMenuGrabKeyboardAndPointer( + + register int status = + (_XmGrabKeyboard(widget, +-#ifdef FIX_1565 +- False, +-#else + True, +-#endif + GrabModeSync, + GrabModeAsync, + time) != GrabSuccess); +diff --git a/lib/Xm/RCMenu.c b/lib/Xm/RCMenu.c +index 2c698d4..8b156da 100644 +--- a/lib/Xm/RCMenu.c ++++ b/lib/Xm/RCMenu.c +@@ -85,6 +85,9 @@ static char *rcsid = "$TOG: RCMenu.c /main/25 1999/05/24 18:06:57 samborn $"; + #include "TraversalI.h" + #include "UniqueEvnI.h" + #include "VendorSI.h" ++#ifdef FIX_1565 ++#include ++#endif + + #define FIX_1535 + +@@ -943,6 +946,13 @@ _XmMenuFocus( + XmMenuState mst = _XmGetMenuState((Widget)w); + Window tmpWindow; + int tmpRevert; ++#ifdef FIX_1565 ++ Widget shell; ++ ++ shell = w; ++ while (! XtIsSubclass(shell, shellWidgetClass)) ++ shell = XtParent(shell); ++#endif + + if (_time == CurrentTime) + _time = XtLastTimestampProcessed(XtDisplay(w)); +@@ -983,6 +993,11 @@ _XmMenuFocus( + shell.popped_up)) + **/ + { ++#ifdef FIX_1565 ++ if (XtIsSubclass(shell, xmGrabShellWidgetClass) || XtIsSubclass(shell, xmMenuShellWidgetClass)) ++ XmForceGrabKeyboard(w, _time); ++ else ++#endif + SetInputFocus(XtDisplay(w), mst->RC_menuFocus.oldFocus, + mst->RC_menuFocus.oldRevert, + mst->RC_menuFocus.oldTime); +@@ -996,6 +1011,11 @@ _XmMenuFocus( + */ + else + { ++#ifdef FIX_1565 ++ if (XtIsSubclass(shell, xmGrabShellWidgetClass) || XtIsSubclass(shell, xmMenuShellWidgetClass)) ++ XmForceGrabKeyboard(w, _time); ++ else ++#endif + SetInputFocus(XtDisplay(w), mst->RC_menuFocus.oldFocus, + mst->RC_menuFocus.oldRevert, + mst->RC_menuFocus.oldTime); +@@ -1014,6 +1034,11 @@ _XmMenuFocus( + RC_menuFocus.oldFocus); + mst->RC_menuFocus.oldTime = _time - 1; + ++#ifdef FIX_1565 ++ if (XtIsSubclass(shell, xmGrabShellWidgetClass) || XtIsSubclass(shell, xmMenuShellWidgetClass)) ++ XmForceGrabKeyboard(w, _time); ++ else ++#endif + SetInputFocus(XtDisplay(w), XtWindow(w), mst->RC_menuFocus.oldRevert, + mst->RC_menuFocus.oldTime); + +@@ -1027,6 +1052,11 @@ _XmMenuFocus( + XGetInputFocus(XtDisplay(w), &tmpWindow, &tmpRevert); + if (tmpWindow != XtWindow(w)) + { ++#ifdef FIX_1565 ++ if (XtIsSubclass(shell, xmGrabShellWidgetClass) || XtIsSubclass(shell, xmMenuShellWidgetClass)) ++ XmForceGrabKeyboard(w, _time); ++ else ++#endif + SetInputFocus(XtDisplay(w), XtWindow(w), tmpRevert, _time); + + mst->RC_menuFocus.oldRevert = tmpRevert; +@@ -1048,6 +1078,11 @@ _XmMenuFocus( + + break; + case XmMENU_MIDDLE: ++#ifdef FIX_1565 ++ if (XtIsSubclass(shell, xmGrabShellWidgetClass) || XtIsSubclass(shell, xmMenuShellWidgetClass)) ++ XmForceGrabKeyboard(w, _time); ++ else ++#endif + SetInputFocus(XtDisplay(w), XtWindow(w), + mst->RC_menuFocus.oldRevert, + mst->RC_menuFocus.oldTime); +@@ -1062,6 +1097,11 @@ _XmMenuFocus( + if ((tmpWindow != XtWindow(w)) && + (_time > mst->RC_menuFocus.oldTime)) + { ++#ifdef FIX_1565 ++ if (XtIsSubclass(shell, xmGrabShellWidgetClass) || XtIsSubclass(shell, xmMenuShellWidgetClass)) ++ XmForceGrabKeyboard(w, _time); ++ else ++#endif + SetInputFocus(XtDisplay(w), XtWindow(w), tmpRevert, _time); + + mst->RC_menuFocus.oldRevert = tmpRevert; +diff --git a/lib/Xm/Xm.c b/lib/Xm/Xm.c +index 3dfd794..45d48b6 100644 +--- a/lib/Xm/Xm.c ++++ b/lib/Xm/Xm.c +@@ -40,6 +40,10 @@ + #ifdef FIX_345 + #include + #endif ++#ifdef FIX_1565 ++#include ++#include ++#endif + + + /************************************************************************** +@@ -530,3 +534,173 @@ _XmAssignInsensitiveColor(Widget w) + return p; + } + #endif ++ ++#ifdef FIX_1565 ++ ++typedef struct _GrabData GrabData; ++struct _GrabData { ++ Widget w; ++ GrabData *next; ++}; ++ ++static void _XmSendFocusEvent(Widget child, int type); ++static void _XmStartDispatcher(Display *display); ++static Boolean _XmEventDispatcher(XEvent *event); ++static void UnmapHandler(Widget w, XtPointer client_data, XEvent *event, Boolean *cont); ++static Boolean _UngrabKeyboard(Widget w); ++ ++static GrabData *grabw_top = NULL; ++static int xm_dispatcher_on = 0; ++static XtEventDispatchProc saved_dispatcher_proc = NULL; ++static XtEventDispatchProc xt_dispatcher_proc = NULL; ++ ++/* ++ XmForceGrabKeyboard function is defined to be a substitutor of XSetInputFocus calls ++ for popup and pulldown menus that should grab keyboard focus yet main window at the ++ same time should visually stay in focus for window manager. This resolves focus flip ++ issue when popup or pulldown menu is raised. ~ochern ++ */ ++void XmForceGrabKeyboard(Widget w, Time time) ++{ ++ GrabData *grabw; ++ ++ if (!w) ++ return; ++ ++ while (! XtIsSubclass(w, shellWidgetClass)) ++ w = XtParent(w); ++ ++ if (! (XtIsSubclass(w, xmGrabShellWidgetClass) || XtIsSubclass(w, xmMenuShellWidgetClass))) ++ return; ++ ++ _XmStartDispatcher(XtDisplay(w)); ++ ++ _UngrabKeyboard(w); ++ ++ grabw = (GrabData *) XtMalloc(sizeof(GrabData)); ++ grabw->w = w; ++ _XmProcessLock(); ++ grabw->next = grabw_top; ++ grabw_top = grabw; ++ _XmProcessUnlock(); ++ ++ XtInsertEventHandler(w, StructureNotifyMask, False, UnmapHandler, NULL, XtListHead); ++ ++ _XmSendFocusEvent(w, FocusIn); ++ ++ /* Following the XSetInputFocus behaviour we force sending FocusOut (see XGrabKeyboard(3)) ++ event to a previous keyboard holder */ ++ XtGrabKeyboard(w, True, GrabModeAsync, GrabModeAsync, time); ++} ++ ++static void _XmStartDispatcher(Display *display) ++{ ++ if (!display) ++ return; ++ ++ _XmProcessLock(); ++ ++ if (xm_dispatcher_on) { ++ _XmProcessUnlock(); ++ return; ++ } ++ ++ saved_dispatcher_proc = XtSetEventDispatcher(display, KeyPress, _XmEventDispatcher); ++ if (! xt_dispatcher_proc) ++ xt_dispatcher_proc = saved_dispatcher_proc; ++ XtSetEventDispatcher(display, KeyRelease, _XmEventDispatcher); ++ xm_dispatcher_on = 1; ++ ++ _XmProcessUnlock(); ++} ++ ++static Boolean _XmEventDispatcher(XEvent *event) ++{ ++ _XmProcessLock(); ++ if (grabw_top) { ++ if (event->type == KeyPress || event->type == KeyRelease) ++ event->xany.window = XtWindow(grabw_top->w); ++ } ++ _XmProcessUnlock(); ++ ++ if (saved_dispatcher_proc) { ++ return (*saved_dispatcher_proc)(event); ++ } else if (xt_dispatcher_proc) { ++ return (*xt_dispatcher_proc)(event); ++ } else { ++ if (grabw_top) ++ XtSetEventDispatcher(XtDisplay(grabw_top->w), event->type, NULL); ++ return XtDispatchEvent(event); ++ } ++} ++ ++static void UnmapHandler(Widget w, XtPointer client_data, XEvent *event, Boolean *cont) ++{ ++ if (event->type == UnmapNotify) ++ _UngrabKeyboard(w); ++ if (! grabw_top) { ++ XtSetEventDispatcher(XtDisplay(w), KeyPress, saved_dispatcher_proc); ++ XtSetEventDispatcher(XtDisplay(w), KeyRelease, saved_dispatcher_proc); ++ xm_dispatcher_on = 0; ++ } ++ ++ /* we do not call XtUngrabKeyboard since X server automatically performs an ++ UngrabKeyboard request if the event window for an active keyboard grab becomes ++ not viewable. ~ochern */ ++} ++ ++static Boolean _UngrabKeyboard(Widget w) ++{ ++ GrabData *grabw, *grabw_prev; ++ ++ _XmProcessLock(); ++ if (! grabw_top) { ++ _XmProcessUnlock(); ++ return False; ++ } ++ ++ grabw = grabw_top; ++ grabw_prev = NULL; ++ while(grabw && grabw->w != w) { ++ grabw_prev = grabw; ++ grabw = grabw->next; ++ } ++ if (grabw) { ++ if (grabw_prev) ++ grabw_prev->next = grabw->next; ++ else ++ grabw_top = grabw->next; ++ XtFree((char*) grabw); ++ ++ _XmProcessUnlock(); ++ return True; ++ } ++ ++ _XmProcessUnlock(); ++ return False; ++} ++ ++static void _XmSendFocusEvent(Widget child, int type) ++{ ++ child = XtIsWidget(child) ? child : _XtWindowedAncestor(child); ++ if (XtIsSensitive(child) && !child->core.being_destroyed ++ && XtIsRealized(child) && (XtBuildEventMask(child) & FocusChangeMask)) ++ { ++ XFocusChangeEvent event; ++ Display* dpy = XtDisplay (child); ++ ++ event.type = type; ++ event.serial = LastKnownRequestProcessed(dpy); ++ event.send_event = True; ++ event.display = dpy; ++ event.window = XtWindow(child); ++ event.mode = NotifyNormal; ++ event.detail = NotifyAncestor; ++ if (XFilterEvent((XEvent*)&event, XtWindow(child))) ++ return; ++ XtDispatchEventToWidget(child, (XEvent*)&event); ++ } ++} ++ ++#endif ++ +diff --git a/lib/Xm/XmI.h b/lib/Xm/XmI.h +index b4420d3..c2b819e 100644 +--- a/lib/Xm/XmI.h ++++ b/lib/Xm/XmI.h +@@ -242,7 +242,9 @@ extern Boolean _XmIsISO10646(Display *dpy, + extern XChar2b* _XmUtf8ToUcs2(char *draw_text, + size_t seg_len, + size_t *ret_str_len); +- ++#ifdef FIX_1565 ++extern void XmForceGrabKeyboard(Widget w, Time time); ++#endif + + /******** End Private Function Declarations ********/ + diff --git a/motif-2.3.5-motifzone_1654.patch b/motif-2.3.5-motifzone_1654.patch new file mode 100644 index 0000000..2d5a21e --- /dev/null +++ b/motif-2.3.5-motifzone_1654.patch @@ -0,0 +1,39 @@ +commit 33e0b7fd58ec8ce9fd23d3a66a91e9b4b7c2b928 +Author: Oleksiy Chernyavskyy +Date: Fri Jun 10 23:15:00 2016 +0300 + + bug 1654 fix + +diff --git a/lib/Xm/LabelG.c b/lib/Xm/LabelG.c +index b674041..726b095 100644 +--- a/lib/Xm/LabelG.c ++++ b/lib/Xm/LabelG.c +@@ -35,6 +35,7 @@ static char rcsid[] = "$TOG: LabelG.c /main/24 1999/01/26 15:31:18 mgreess $" + #include + #endif + #define FIX_1517 ++#define FIX_1654 + + #include + #include +@@ -2352,12 +2353,20 @@ LRectangle *background_box) + if (LabG_StringRect(lw).width < availW - marginal_width) + width = LabG_StringRect(lw).width; + else ++#ifdef FIX_1654 ++ width = availW - marginal_width; ++#else + width = availW - marginal_width - x; ++#endif + + if (LabG_StringRect(lw).height < availH - marginal_height) + height = LabG_StringRect(lw).height; + else ++#ifdef FIX_1654 ++ height = availH - marginal_height; ++#else + height = availH - marginal_height - y; ++#endif + + XFillRectangle(XtDisplay(lw), XtWindow(lw), LabG_BackgroundGC(lw), + x, y, width, height); diff --git a/motif.spec b/motif.spec index 5a167c2..68ac9ff 100644 --- a/motif.spec +++ b/motif.spec @@ -1,7 +1,7 @@ Summary: Run-time libraries and programs Name: motif Version: 2.3.4 -Release: 25%{?dist} +Release: 26%{?dist} License: LGPLv2+ Source: http://downloads.sf.net/motif/motif-%{version}-src.tgz Source1: xmbind @@ -29,6 +29,13 @@ 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 +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 +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 @@ -70,6 +77,12 @@ 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 +%patch52 -p1 -b .revert-of-motifzone_1565 +%patch53 -p1 -b .motifzone_1660 +%patch54 -p1 -b .motifzone_1612 %build ./autogen.sh @@ -119,6 +132,9 @@ rm -f %{buildroot}%{_libdir}/*.la %{_libdir}/lib*.a %changelog +* Thu May 12 2022 Mika Penttila - 2.3.4-26 +- Added patches from rhel-7 + * Thu Feb 03 2022 Adam Jackson - 2.3.4-25 - Fix invoking autogen/configure so the default CFLAGS actually get applied Resolves: rhbz#2044881 diff --git a/motifzone_1612.patch b/motifzone_1612.patch new file mode 100644 index 0000000..bdea0ef --- /dev/null +++ b/motifzone_1612.patch @@ -0,0 +1,104 @@ +From 6aff3a819cb69235594124d7b252d1ee8c04f2b0 Mon Sep 17 00:00:00 2001 +From: Mykola Vshyvkov +Date: Wed, 21 Aug 2013 11:49:00 +0300 +Subject: [PATCH] Fixed bug #1612 (Label size computed wrong within a Form). + +--- + lib/Xm/Form.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 56 insertions(+), 2 deletions(-) + +diff --git a/lib/Xm/Form.c b/lib/Xm/Form.c +index 74140af8..b95a7b1a 100644 +--- a/lib/Xm/Form.c ++++ b/lib/Xm/Form.c +@@ -50,6 +50,7 @@ static char rcsid[] = "$TOG: Form.c /main/19 1998/03/25 12:24:56 csn $" + #include "GMUtilsI.h" + + #define FIX_1299 ++#define FIX_1612 + + #define MESSAGE1 _XmMMsgForm_0000 + #define MESSAGE5 _XmMMsgForm_0002 +@@ -285,6 +286,12 @@ static int GetFormOffset( + XmFormWidget fw, + int which, + XmFormAttachment a) ; ++#ifdef FIX_1612 ++static Boolean IsWidgetAttachedOneHorizontalSide( ++ Widget w); ++static Boolean IsWidgetAttachedOneVerticalSide( ++ Widget w); ++#endif + + /******** End Static Function Declarations ********/ + +@@ -1083,13 +1090,21 @@ GeometryManager( + } else { + /* the size the Form wants for the kid request is bigger than + its current or proposed size, return No to the kid */ +- + /* backup the original Form size first */ + fw->core.width = orig_form_width ; + fw->core.height = orig_form_height; +- + /* we haden't changed anything else, just return No */ + reply = XtGeometryNo; ++ ++#ifdef FIX_1612 ++ if (((IsWidgetAttachedOneHorizontalSide(w)) && ++ (desired->request_mode & CWWidth)) || ++ ((IsWidgetAttachedOneVerticalSide(w)) && ++ (desired->request_mode & CWHeight))) ++ { PlaceChildren (fw, w, desired); ++ reply = XtGeometryYes; ++ } ++#endif + } + } else { + /* ok, we got a Yes form the Form's parent, let's relayout +@@ -3477,3 +3492,42 @@ XmCreateFormDialog( + return XmeCreateClassDialog (xmFormWidgetClass, + parent, name, arglist, argcount) ; + } ++ ++ ++ ++#ifdef FIX_1612 ++/************************************************************************ ++ * ++ * IsWidgetAttachedOneHorizontalSide ++ * Checking the attachments of widget in horizontal direction. ++ * Returns True if only one (left or right) side of widget is attached ++ * ++ ************************************************************************/ ++static Boolean IsWidgetAttachedOneHorizontalSide(Widget w) ++ { if (w != NULL) ++ { XmFormConstraint c = GetFormConstraint(w); ++ if (((c->att[LEFT].type == XmATTACH_NONE) && ++ (c->att[RIGHT].type != XmATTACH_NONE)) || ++ ((c->att[LEFT].type != XmATTACH_NONE) && ++ (c->att[RIGHT].type == XmATTACH_NONE))) ++ return True; ++ ++ } ++ return False; ++ } ++ ++ ++static Boolean IsWidgetAttachedOneVerticalSide(Widget w) ++ { if (w != NULL) ++ { XmFormConstraint c = GetFormConstraint(w); ++ if (((c->att[TOP].type == XmATTACH_NONE) && ++ (c->att[BOTTOM].type != XmATTACH_NONE)) || ++ ((c->att[TOP].type != XmATTACH_NONE) && ++ (c->att[BOTTOM].type == XmATTACH_NONE))) ++ return True; ++ ++ } ++ return False; ++ } ++ ++#endif +-- +2.14.3 + diff --git a/motifzone_1660.patch b/motifzone_1660.patch new file mode 100644 index 0000000..c6d9b7c --- /dev/null +++ b/motifzone_1660.patch @@ -0,0 +1,27 @@ +From e5c51cda449ea3544fddcdb84c6809757477035b Mon Sep 17 00:00:00 2001 +From: Oleksiy Chernyavskyy +Date: Tue, 22 Aug 2017 03:27:36 +0300 +Subject: [PATCH] Fixed bug 1660 + +--- + lib/Xm/TextF.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/Xm/TextF.c b/lib/Xm/TextF.c +index 3323d2bd..f66076da 100644 +--- a/lib/Xm/TextF.c ++++ b/lib/Xm/TextF.c +@@ -1768,8 +1768,8 @@ PaintCursor(XmTextFieldWidget tf) + } + if (cursor_width > 0 && cursor_height > 0) + XCopyArea(XtDisplay(tf), tf->text.ibeam_off, XtWindow(tf), +- tf->text.save_gc, 0, 0, cursor_width, +- cursor_height, x, y); ++ tf->text.save_gc, src_x, 0, cursor_width, ++ cursor_height, x, y); + } + } + } +-- +2.13.5 + diff --git a/openmotif-2.3.1-rhbz_997241.patch b/openmotif-2.3.1-rhbz_997241.patch new file mode 100644 index 0000000..6a2183f --- /dev/null +++ b/openmotif-2.3.1-rhbz_997241.patch @@ -0,0 +1,11 @@ +--- openmotif-2.3.1-old/clients/mwm/WmWinConf.c 2002-01-11 02:25:38.000000000 +0530 ++++ openmotif-2.3.1-old/clients/mwm/WmWinConf.c 2013-08-23 12:47:45.000000000 +0530 +@@ -1512,7 +1512,7 @@ DrawSegments (Display *dpy, Window win, + *************************************<->***********************************/ + void MoveOutline (int x, int y, unsigned int width, unsigned int height) + { +- if (wmGD.freezeOnConfig) ++ if (wmGD.freezeOnConfig || !wmGD.pActiveSD->moveOpaque) + { + DrawOutline (x, y, width, height); + } diff --git a/revert-of-motifzone_1565.patch b/revert-of-motifzone_1565.patch new file mode 100644 index 0000000..1e6cc29 --- /dev/null +++ b/revert-of-motifzone_1565.patch @@ -0,0 +1,427 @@ +From 18de86345d5e455b815fe0395d2992b9a2f1195f Mon Sep 17 00:00:00 2001 +From: Oleksiy Chernyavskyy +Date: Tue, 28 Mar 2017 01:11:59 +0300 +Subject: [PATCH] removed bugfix 1565. See details on + http://bugs.motifzone.net/show_bug.cgi?id=1565 + +--- + lib/Xm/ComboBox.c | 8 --- + lib/Xm/DropDown.c | 7 --- + lib/Xm/GrabShell.c | 15 +---- + lib/Xm/GrabShellP.h | 3 - + lib/Xm/RCMenu.c | 40 ------------ + lib/Xm/Xm.c | 173 ---------------------------------------------------- + lib/Xm/XmI.h | 4 -- + 7 files changed, 2 insertions(+), 248 deletions(-) + +diff --git a/lib/Xm/ComboBox.c b/lib/Xm/ComboBox.c +index cf507da4..1472e458 100644 +--- a/lib/Xm/ComboBox.c ++++ b/lib/Xm/ComboBox.c +@@ -3164,9 +3164,6 @@ CreatePulldown(Widget parent, + Arg args[4]; + ArgList merged_args; + Cardinal n; +-#ifdef FIX_1565 +- XmGrabShellWidget grabsh; +-#endif + + n = 0; + XtSetArg(args[n], XmNlayoutDirection, LayoutM(parent)), n++; +@@ -3178,11 +3175,6 @@ CreatePulldown(Widget parent, + merged_args, n + *num_args); + XtFree((char*)merged_args); + +-#ifdef FIX_1565 +- grabsh = (XmGrabShellWidget) shell; +- grabsh->grab_shell.set_input_focus = False; +-#endif +- + return shell; + } + +diff --git a/lib/Xm/DropDown.c b/lib/Xm/DropDown.c +index 5cd15cae..37fec03f 100644 +--- a/lib/Xm/DropDown.c ++++ b/lib/Xm/DropDown.c +@@ -2027,9 +2027,6 @@ CreatePopup(Widget w, ArgList args, Cardinal num_args) + Arg *new_list, largs[10]; + Cardinal num_largs; + Widget sb; +-#ifdef FIX_1565 +- XmGrabShellWidget grabsh; +-#endif + + num_largs = 0; + XtSetArg(largs[num_largs], XmNoverrideRedirect, True); num_largs++; +@@ -2043,10 +2040,6 @@ CreatePopup(Widget w, ArgList args, Cardinal num_args) + xmGrabShellWidgetClass, w, + new_list, + num_largs + num_args); +-#ifdef FIX_1565 +- grabsh = (XmGrabShellWidget) XmDropDown_popup_shell(cbw); +- grabsh->grab_shell.set_input_focus = False; +-#endif + XtFree((char *) new_list); + + #ifdef FIX_1446 +diff --git a/lib/Xm/GrabShell.c b/lib/Xm/GrabShell.c +index af13e0b7..a73f7cb9 100644 +--- a/lib/Xm/GrabShell.c ++++ b/lib/Xm/GrabShell.c +@@ -284,9 +284,6 @@ Initialize(Widget req, /* unused */ + /* CR 9920: Popdown may be requested before MapNotify. */ + grabsh->grab_shell.mapped = False; + +-#ifdef FIX_1565 +- grabsh->grab_shell.set_input_focus = True; +-#endif + } + + /* +@@ -399,16 +396,8 @@ MapNotifyHandler(Widget shell, XtPointer client_data, + XGetInputFocus(XtDisplay(shell), &grabshell->grab_shell.old_focus, + &grabshell->grab_shell.old_revert_to); + old_handler = XSetErrorHandler(IgnoreXErrors); +-#ifdef FIX_1565 +- if (! grabshell->grab_shell.set_input_focus) { +- XmForceGrabKeyboard(shell, time); +- } else { +-#endif +- XSetInputFocus(XtDisplay(shell), XtWindow(shell), RevertToParent, time); +- XSync(XtDisplay(shell), False); +-#ifdef FIX_1565 +- } +-#endif ++ XSetInputFocus(XtDisplay(shell), XtWindow(shell), RevertToParent, time); ++ XSync(XtDisplay(shell), False); + XSetErrorHandler(old_handler); + } + +diff --git a/lib/Xm/GrabShellP.h b/lib/Xm/GrabShellP.h +index 025f0015..e2585540 100644 +--- a/lib/Xm/GrabShellP.h ++++ b/lib/Xm/GrabShellP.h +@@ -56,9 +56,6 @@ typedef struct + Boolean mapped; + Window old_focus; + int old_revert_to; +-#ifdef FIX_1565 +- Boolean set_input_focus; +-#endif + } XmGrabShellPart; + + +diff --git a/lib/Xm/RCMenu.c b/lib/Xm/RCMenu.c +index 8b156da5..2c698d4f 100644 +--- a/lib/Xm/RCMenu.c ++++ b/lib/Xm/RCMenu.c +@@ -85,9 +85,6 @@ static char *rcsid = "$TOG: RCMenu.c /main/25 1999/05/24 18:06:57 samborn $"; + #include "TraversalI.h" + #include "UniqueEvnI.h" + #include "VendorSI.h" +-#ifdef FIX_1565 +-#include +-#endif + + #define FIX_1535 + +@@ -946,13 +943,6 @@ _XmMenuFocus( + XmMenuState mst = _XmGetMenuState((Widget)w); + Window tmpWindow; + int tmpRevert; +-#ifdef FIX_1565 +- Widget shell; +- +- shell = w; +- while (! XtIsSubclass(shell, shellWidgetClass)) +- shell = XtParent(shell); +-#endif + + if (_time == CurrentTime) + _time = XtLastTimestampProcessed(XtDisplay(w)); +@@ -993,11 +983,6 @@ _XmMenuFocus( + shell.popped_up)) + **/ + { +-#ifdef FIX_1565 +- if (XtIsSubclass(shell, xmGrabShellWidgetClass) || XtIsSubclass(shell, xmMenuShellWidgetClass)) +- XmForceGrabKeyboard(w, _time); +- else +-#endif + SetInputFocus(XtDisplay(w), mst->RC_menuFocus.oldFocus, + mst->RC_menuFocus.oldRevert, + mst->RC_menuFocus.oldTime); +@@ -1011,11 +996,6 @@ _XmMenuFocus( + */ + else + { +-#ifdef FIX_1565 +- if (XtIsSubclass(shell, xmGrabShellWidgetClass) || XtIsSubclass(shell, xmMenuShellWidgetClass)) +- XmForceGrabKeyboard(w, _time); +- else +-#endif + SetInputFocus(XtDisplay(w), mst->RC_menuFocus.oldFocus, + mst->RC_menuFocus.oldRevert, + mst->RC_menuFocus.oldTime); +@@ -1034,11 +1014,6 @@ _XmMenuFocus( + RC_menuFocus.oldFocus); + mst->RC_menuFocus.oldTime = _time - 1; + +-#ifdef FIX_1565 +- if (XtIsSubclass(shell, xmGrabShellWidgetClass) || XtIsSubclass(shell, xmMenuShellWidgetClass)) +- XmForceGrabKeyboard(w, _time); +- else +-#endif + SetInputFocus(XtDisplay(w), XtWindow(w), mst->RC_menuFocus.oldRevert, + mst->RC_menuFocus.oldTime); + +@@ -1052,11 +1027,6 @@ _XmMenuFocus( + XGetInputFocus(XtDisplay(w), &tmpWindow, &tmpRevert); + if (tmpWindow != XtWindow(w)) + { +-#ifdef FIX_1565 +- if (XtIsSubclass(shell, xmGrabShellWidgetClass) || XtIsSubclass(shell, xmMenuShellWidgetClass)) +- XmForceGrabKeyboard(w, _time); +- else +-#endif + SetInputFocus(XtDisplay(w), XtWindow(w), tmpRevert, _time); + + mst->RC_menuFocus.oldRevert = tmpRevert; +@@ -1078,11 +1048,6 @@ _XmMenuFocus( + + break; + case XmMENU_MIDDLE: +-#ifdef FIX_1565 +- if (XtIsSubclass(shell, xmGrabShellWidgetClass) || XtIsSubclass(shell, xmMenuShellWidgetClass)) +- XmForceGrabKeyboard(w, _time); +- else +-#endif + SetInputFocus(XtDisplay(w), XtWindow(w), + mst->RC_menuFocus.oldRevert, + mst->RC_menuFocus.oldTime); +@@ -1097,11 +1062,6 @@ _XmMenuFocus( + if ((tmpWindow != XtWindow(w)) && + (_time > mst->RC_menuFocus.oldTime)) + { +-#ifdef FIX_1565 +- if (XtIsSubclass(shell, xmGrabShellWidgetClass) || XtIsSubclass(shell, xmMenuShellWidgetClass)) +- XmForceGrabKeyboard(w, _time); +- else +-#endif + SetInputFocus(XtDisplay(w), XtWindow(w), tmpRevert, _time); + + mst->RC_menuFocus.oldRevert = tmpRevert; +diff --git a/lib/Xm/Xm.c b/lib/Xm/Xm.c +index 45d48b61..657f9041 100644 +--- a/lib/Xm/Xm.c ++++ b/lib/Xm/Xm.c +@@ -40,10 +40,6 @@ + #ifdef FIX_345 + #include + #endif +-#ifdef FIX_1565 +-#include +-#include +-#endif + + + /************************************************************************** +@@ -535,172 +531,3 @@ _XmAssignInsensitiveColor(Widget w) + } + #endif + +-#ifdef FIX_1565 +- +-typedef struct _GrabData GrabData; +-struct _GrabData { +- Widget w; +- GrabData *next; +-}; +- +-static void _XmSendFocusEvent(Widget child, int type); +-static void _XmStartDispatcher(Display *display); +-static Boolean _XmEventDispatcher(XEvent *event); +-static void UnmapHandler(Widget w, XtPointer client_data, XEvent *event, Boolean *cont); +-static Boolean _UngrabKeyboard(Widget w); +- +-static GrabData *grabw_top = NULL; +-static int xm_dispatcher_on = 0; +-static XtEventDispatchProc saved_dispatcher_proc = NULL; +-static XtEventDispatchProc xt_dispatcher_proc = NULL; +- +-/* +- XmForceGrabKeyboard function is defined to be a substitutor of XSetInputFocus calls +- for popup and pulldown menus that should grab keyboard focus yet main window at the +- same time should visually stay in focus for window manager. This resolves focus flip +- issue when popup or pulldown menu is raised. ~ochern +- */ +-void XmForceGrabKeyboard(Widget w, Time time) +-{ +- GrabData *grabw; +- +- if (!w) +- return; +- +- while (! XtIsSubclass(w, shellWidgetClass)) +- w = XtParent(w); +- +- if (! (XtIsSubclass(w, xmGrabShellWidgetClass) || XtIsSubclass(w, xmMenuShellWidgetClass))) +- return; +- +- _XmStartDispatcher(XtDisplay(w)); +- +- _UngrabKeyboard(w); +- +- grabw = (GrabData *) XtMalloc(sizeof(GrabData)); +- grabw->w = w; +- _XmProcessLock(); +- grabw->next = grabw_top; +- grabw_top = grabw; +- _XmProcessUnlock(); +- +- XtInsertEventHandler(w, StructureNotifyMask, False, UnmapHandler, NULL, XtListHead); +- +- _XmSendFocusEvent(w, FocusIn); +- +- /* Following the XSetInputFocus behaviour we force sending FocusOut (see XGrabKeyboard(3)) +- event to a previous keyboard holder */ +- XtGrabKeyboard(w, True, GrabModeAsync, GrabModeAsync, time); +-} +- +-static void _XmStartDispatcher(Display *display) +-{ +- if (!display) +- return; +- +- _XmProcessLock(); +- +- if (xm_dispatcher_on) { +- _XmProcessUnlock(); +- return; +- } +- +- saved_dispatcher_proc = XtSetEventDispatcher(display, KeyPress, _XmEventDispatcher); +- if (! xt_dispatcher_proc) +- xt_dispatcher_proc = saved_dispatcher_proc; +- XtSetEventDispatcher(display, KeyRelease, _XmEventDispatcher); +- xm_dispatcher_on = 1; +- +- _XmProcessUnlock(); +-} +- +-static Boolean _XmEventDispatcher(XEvent *event) +-{ +- _XmProcessLock(); +- if (grabw_top) { +- if (event->type == KeyPress || event->type == KeyRelease) +- event->xany.window = XtWindow(grabw_top->w); +- } +- _XmProcessUnlock(); +- +- if (saved_dispatcher_proc) { +- return (*saved_dispatcher_proc)(event); +- } else if (xt_dispatcher_proc) { +- return (*xt_dispatcher_proc)(event); +- } else { +- if (grabw_top) +- XtSetEventDispatcher(XtDisplay(grabw_top->w), event->type, NULL); +- return XtDispatchEvent(event); +- } +-} +- +-static void UnmapHandler(Widget w, XtPointer client_data, XEvent *event, Boolean *cont) +-{ +- if (event->type == UnmapNotify) +- _UngrabKeyboard(w); +- if (! grabw_top) { +- XtSetEventDispatcher(XtDisplay(w), KeyPress, saved_dispatcher_proc); +- XtSetEventDispatcher(XtDisplay(w), KeyRelease, saved_dispatcher_proc); +- xm_dispatcher_on = 0; +- } +- +- /* we do not call XtUngrabKeyboard since X server automatically performs an +- UngrabKeyboard request if the event window for an active keyboard grab becomes +- not viewable. ~ochern */ +-} +- +-static Boolean _UngrabKeyboard(Widget w) +-{ +- GrabData *grabw, *grabw_prev; +- +- _XmProcessLock(); +- if (! grabw_top) { +- _XmProcessUnlock(); +- return False; +- } +- +- grabw = grabw_top; +- grabw_prev = NULL; +- while(grabw && grabw->w != w) { +- grabw_prev = grabw; +- grabw = grabw->next; +- } +- if (grabw) { +- if (grabw_prev) +- grabw_prev->next = grabw->next; +- else +- grabw_top = grabw->next; +- XtFree((char*) grabw); +- +- _XmProcessUnlock(); +- return True; +- } +- +- _XmProcessUnlock(); +- return False; +-} +- +-static void _XmSendFocusEvent(Widget child, int type) +-{ +- child = XtIsWidget(child) ? child : _XtWindowedAncestor(child); +- if (XtIsSensitive(child) && !child->core.being_destroyed +- && XtIsRealized(child) && (XtBuildEventMask(child) & FocusChangeMask)) +- { +- XFocusChangeEvent event; +- Display* dpy = XtDisplay (child); +- +- event.type = type; +- event.serial = LastKnownRequestProcessed(dpy); +- event.send_event = True; +- event.display = dpy; +- event.window = XtWindow(child); +- event.mode = NotifyNormal; +- event.detail = NotifyAncestor; +- if (XFilterEvent((XEvent*)&event, XtWindow(child))) +- return; +- XtDispatchEventToWidget(child, (XEvent*)&event); +- } +-} +- +-#endif +- +diff --git a/lib/Xm/XmI.h b/lib/Xm/XmI.h +index ef6165c5..769e5f0a 100644 +--- a/lib/Xm/XmI.h ++++ b/lib/Xm/XmI.h +@@ -237,9 +237,6 @@ extern Boolean _XmIsISO10646(Display *dpy, + extern XChar2b* _XmUtf8ToUcs2(char *draw_text, + size_t seg_len, + size_t *ret_str_len); +-#ifdef FIX_1565 +-extern void XmForceGrabKeyboard(Widget w, Time time); +-#endif + + /******** End Private Function Declarations ********/ + +@@ -294,7 +291,6 @@ extern Pixel _XmAssignInsensitiveColor(Widget w); + #define FIX_1501 + #define FIX_1521 + #define FIX_1505 +-#define FIX_1565 + + #endif /* _XmI_h */ + /* DON'T ADD ANYTHING AFTER THIS #endif */ +-- +2.13.5 +