Blame SOURCES/motifzone_1612.patch

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