Blame SOURCES/motifzone_1612.patch

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