Blame SOURCES/motifzone_1612.patch

59a63e
From 6aff3a819cb69235594124d7b252d1ee8c04f2b0 Mon Sep 17 00:00:00 2001
59a63e
From: Mykola Vshyvkov <mvshyvk@softserveinc.com>
59a63e
Date: Wed, 21 Aug 2013 11:49:00 +0300
59a63e
Subject: [PATCH] Fixed bug #1612 (Label size computed wrong within a Form).
59a63e
59a63e
---
59a63e
 lib/Xm/Form.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
59a63e
 1 file changed, 56 insertions(+), 2 deletions(-)
59a63e
59a63e
diff --git a/lib/Xm/Form.c b/lib/Xm/Form.c
59a63e
index 74140af8..b95a7b1a 100644
59a63e
--- a/lib/Xm/Form.c
59a63e
+++ b/lib/Xm/Form.c
59a63e
@@ -50,6 +50,7 @@ static char rcsid[] = "$TOG: Form.c /main/19 1998/03/25 12:24:56 csn $"
59a63e
 #include "GMUtilsI.h"
59a63e
 
59a63e
 #define FIX_1299
59a63e
+#define FIX_1612
59a63e
 
59a63e
 #define MESSAGE1	_XmMMsgForm_0000
59a63e
 #define MESSAGE5	_XmMMsgForm_0002
59a63e
@@ -285,6 +286,12 @@ static int GetFormOffset(
59a63e
                         XmFormWidget fw,
59a63e
                         int which,
59a63e
                         XmFormAttachment a) ;
59a63e
+#ifdef FIX_1612                        
59a63e
+static Boolean IsWidgetAttachedOneHorizontalSide(
59a63e
+                        Widget w);
59a63e
+static Boolean IsWidgetAttachedOneVerticalSide(
59a63e
+                        Widget w);
59a63e
+#endif
59a63e
 
59a63e
 /********    End Static Function Declarations    ********/
59a63e
 
59a63e
@@ -1083,13 +1090,21 @@ GeometryManager(
59a63e
 	    } else {
59a63e
 		/* the size the Form wants for the kid request is bigger than 
59a63e
 		   its current or proposed size, return No to the kid */
59a63e
-		
59a63e
 		/* backup the original Form size first */
59a63e
 		fw->core.width = orig_form_width  ;
59a63e
 		fw->core.height = orig_form_height;
59a63e
-		
59a63e
 		/* we haden't changed anything else, just return No */
59a63e
 		reply = XtGeometryNo;
59a63e
+		
59a63e
+#ifdef FIX_1612
59a63e
+                if (((IsWidgetAttachedOneHorizontalSide(w)) && 
59a63e
+                     (desired->request_mode & CWWidth)) ||
59a63e
+                    ((IsWidgetAttachedOneVerticalSide(w)) && 
59a63e
+                     (desired->request_mode & CWHeight)))
59a63e
+		  { PlaceChildren (fw, w, desired);
59a63e
+		    reply = XtGeometryYes; 
59a63e
+		  }
59a63e
+#endif
59a63e
 	    }
59a63e
 	} else {
59a63e
 	    /* ok, we got a Yes form the Form's parent, let's relayout
59a63e
@@ -3477,3 +3492,42 @@ XmCreateFormDialog(
59a63e
    return XmeCreateClassDialog (xmFormWidgetClass,
59a63e
 				parent, name, arglist, argcount) ;
59a63e
 }
59a63e
+
59a63e
+
59a63e
+
59a63e
+#ifdef FIX_1612
59a63e
+/************************************************************************
59a63e
+ *
59a63e
+ *  IsWidgetAttachedOneHorizontalSide
59a63e
+ *	Checking the attachments of widget in horizontal direction.
59a63e
+ *  Returns True if only one (left or right) side of widget is attached
59a63e
+ *
59a63e
+ ************************************************************************/
59a63e
+static Boolean IsWidgetAttachedOneHorizontalSide(Widget w)
59a63e
+  { if (w != NULL)
59a63e
+      { XmFormConstraint c = GetFormConstraint(w);
59a63e
+        if (((c->att[LEFT].type == XmATTACH_NONE) && 
59a63e
+             (c->att[RIGHT].type != XmATTACH_NONE)) ||
59a63e
+            ((c->att[LEFT].type != XmATTACH_NONE) && 
59a63e
+             (c->att[RIGHT].type == XmATTACH_NONE)))
59a63e
+          return True;
59a63e
+          
59a63e
+      }
59a63e
+    return False;
59a63e
+  }    
59a63e
+
59a63e
+  
59a63e
+static Boolean IsWidgetAttachedOneVerticalSide(Widget w)
59a63e
+  { if (w != NULL)
59a63e
+      { XmFormConstraint c = GetFormConstraint(w);
59a63e
+        if (((c->att[TOP].type == XmATTACH_NONE) && 
59a63e
+             (c->att[BOTTOM].type != XmATTACH_NONE)) ||
59a63e
+            ((c->att[TOP].type != XmATTACH_NONE) && 
59a63e
+             (c->att[BOTTOM].type == XmATTACH_NONE)))
59a63e
+          return True;
59a63e
+          
59a63e
+      }
59a63e
+    return False;
59a63e
+  }    
59a63e
+  
59a63e
+#endif
59a63e
-- 
59a63e
2.14.3
59a63e