Blame SOURCES/motifzone_1612.patch

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