Blame SOURCES/motifzone_1612.patch

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