Blame SOURCES/motifzone_1612.patch

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