rpms/lesstif/F-7 lesstif-0.95.0-XxxxProperty-64bit.patch, NONE, 1.1 lesstif-0.95.0-attach-bottom-self.patch, NONE, 1.1 lesstif-0.95.0-xtungrab-warning.patch, NONE, 1.1 mwm.desktop, NONE, 1.1 lesstif-0.95.0-cutpaste64.patch, 1.1, NONE lesstif-64.patch, 1.1, NONE

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Sun Sep 2 20:49:15 UTC 2007


Author: jwrdegoede

Update of /cvs/extras/rpms/lesstif/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5616

Added Files:
	lesstif-0.95.0-XxxxProperty-64bit.patch 
	lesstif-0.95.0-attach-bottom-self.patch 
	lesstif-0.95.0-xtungrab-warning.patch mwm.desktop 
Removed Files:
	lesstif-0.95.0-cutpaste64.patch lesstif-64.patch 
Log Message:
* Thu Aug 30 2007 Hans de Goede <j.w.r.degoede at hhs.nl> 0.95.0-18
- Fix cut and paste from / to lesstif apps on 64 bits machines (bz 243508)
- Fix accelkeys which use more then one modifier (bz 214018)


lesstif-0.95.0-XxxxProperty-64bit.patch:

--- NEW FILE lesstif-0.95.0-XxxxProperty-64bit.patch ---
diff -up lesstif-0.95.0/lib/Xm-2.1/CutPaste.c.cutpaste64 lesstif-0.95.0/lib/Xm-2.1/CutPaste.c
--- lesstif-0.95.0/lib/Xm-2.1/CutPaste.c.cutpaste64	2004-08-28 21:22:43.000000000 +0200
+++ lesstif-0.95.0/lib/Xm-2.1/CutPaste.c	2007-08-31 00:19:09.000000000 +0200
@@ -62,7 +62,7 @@ static void _XmClipboardDeleteMarked(Dis
 				     XmClipboard * clip);
 static void _XmClipboardDeleteFormat(Display *display, int id);
 static int _XmClipboardRegisterFormat(Display *display, char *format_name,
-				      int format_len);
+				      long format_len);
 static void _XmClipboardDeleteFormats(Display *display, Window window, int id);
 static void _XmClipboardDeleteItem(Display *display, Window window,
 				   XmClipboard * clip, unsigned item);
@@ -241,7 +241,7 @@
 
 
 static int
-_XmClipboardRegisterFormat(Display *display, char *format_name, int format_len)
+_XmClipboardRegisterFormat(Display *display, char *format_name, long format_len)
 {
     Atom fmt;
     int flen;
@@ -606,7 +606,17 @@ _XmClipboardGetWindowProperty(Display *d
 
 	ret_buf = (unsigned *)XtRealloc((char *)ret_buf,
 					alloc_size + alloc_incr + 1);
-	memcpy(&ret_buf[offset], prop, alloc_incr);
+        /* Fixup X*Property long == 32 bits confusion if needed */
+        if (actual_format == 32 && sizeof(long) != 4)
+        {
+            int i;
+            unsigned long *in = (unsigned long *)prop;
+            
+            for (i = 0; i < nitems; i++)
+                ret_buf[offset + i] = in[i];
+        }
+        else
+	    memcpy(&ret_buf[offset], prop, alloc_incr);
 	alloc_size += alloc_incr;
 
 	switch (actual_format)
@@ -1001,8 +1013,9 @@ _XmClipboardReplaceItem(Display *display
 {
     Window root;
     Atom item;
-    int nunits, tstart, tlen;
+    int i, nunits, tstart, tlen;
     long transferlen;
+    long *convert_buf = NULL;
 
     root = DefaultRootWindow(display);
     item = _XmClipboardGetAtomFromId(display, id);
@@ -1014,6 +1027,12 @@ _XmClipboardReplaceItem(Display *display
     case 32:
 	len >>= 2;
 	nunits = transferlen;
+	/* XChangeProperty expects a buffer of longs when receiving 32 bits
+	   data, MEUHH */
+	if (sizeof(long) != 4)
+	    convert_buf = XtMalloc(len * sizeof(long));
+        for (i = 0; i < len; i++)
+            convert_buf[i] = data[i];
 	break;
 
     case 16:
@@ -1040,7 +1059,9 @@ _XmClipboardReplaceItem(Display *display
 	}
 
 	XChangeProperty(display, root, item, item, format, mode,
-			(unsigned char *)&data[tstart], tlen);
+			convert_buf? (unsigned char *)&convert_buf[tstart] :
+                                     (unsigned char *)&data[tstart],
+                        tlen);
 
 	len -= tlen;
 	mode = PropModeAppend;
@@ -1178,7 +1178,7 @@
     }
     else
     {
-	*format = *((int *)(prop));
+	*format = *((long *)(prop));
 	ret = True;
     }
 
diff -ur lesstif-0.95.0.orig/clients/Motif-2.1/mwm/props.c lesstif-0.95.0/clients/Motif-2.1/mwm/props.c
--- lesstif-0.95.0.orig/clients/Motif-2.1/mwm/props.c	2004-08-28 21:25:46.000000000 +0200
+++ lesstif-0.95.0/clients/Motif-2.1/mwm/props.c	2007-09-01 15:54:50.000000000 +0200
@@ -92,15 +92,28 @@
 void
 PROP_SetBehavior(ScreenInfo *scr, Boolean custom)
 {
-    PropMotifWmInfo info;
+    long info[PROP_MWM_INFO_ELEMENTS];
 
-    /* set the MWM_INFO property on the Root */
+    /* set the MWM_INFO property on the Root, notice that we
+       use an array of longs here and not the PropMotifWmInfo struct,
+       this is because this struct looks like this in lesstif:
+       
+       typedef struct {
+           CARD32 flags;
+           CARD32 wmWindow;
+       } PropMotifWmInfo;
+       
+       But when setting 32 bit properties XChangeProperty expects an array of
+       longs, which it will convert to 32 bit values if need. Thus passing an
+       actual PropMotifWmInfo struct will mess things up on archs where longs
+       are 64 bit. */
+    
     if (custom)
-	info.flags = MWM_INFO_STARTUP_CUSTOM;
+	info[0] = MWM_INFO_STARTUP_CUSTOM;   /* set flags "member" */
     else
-	info.flags = MWM_INFO_STARTUP_STANDARD;
+	info[0] = MWM_INFO_STARTUP_STANDARD; /* set flags "member" */
 
-    info.wmWindow = scr->root_win;
+    info[1] = scr->root_win; /* set wmWindow "member" */
 
     XChangeProperty(dpy, scr->root_win, XA_MWM_INFO, XA_MWM_INFO,
 		    32, PropModeReplace,
@@ -129,7 +142,18 @@
     int actual_format, ret;
     Atom actual_type;
     unsigned long nitems, bytesafter;
-    PropMotifWmInfo *info;
+    /* We use a long pointer here and not a PropMotifWmInfo pointer,
+       this is because this type looks like this in lesstif:
+       
+       typedef struct {
+           CARD32 flags;
+           CARD32 wmWindow;
+       } PropMotifWmInfo;
+       
+       But when getting 32 bit properties XGetWindowProperty returns an array
+       of longs. Thus interpreting the returned data as PropMotifWmInfo will
+       mess things up on archs where longs are 64 bit. */
+    unsigned long *info;
 
     if (XGetWindowProperty(dpy, scr->root_win, XA_MWM_INFO, 0L,
 			   PROP_MOTIF_WM_INFO_ELEMENTS, False,
@@ -138,7 +162,7 @@
 			   (unsigned char **)&info) == Success)
     {
 	if (nitems > 0 && info)
-	    ret = info->flags;
+	    ret = info[0]; /* Return flags "member" */
 	else
 	    ret = 0;
 	XFree((char *)info);
@@ -284,7 +308,21 @@
     {
 
 	if (nitems >= PROP_MOTIF_WM_HINTS_ELEMENTS)
+	{
+	    /* Fixup X*Property long == 32 bits confusion if needed */
+	    if (sizeof(long) != 4)
+	    {
+	        long *prop_hints = (long *)win->mwm_hints;
+	        win->mwm_hints = XtMalloc(sizeof(MwmHints));
+	        win->mwm_hints->flags       = prop_hints[0];
+	        win->mwm_hints->functions   = prop_hints[1];
+	        win->mwm_hints->decorations = prop_hints[2];
+	        win->mwm_hints->input_mode  = prop_hints[3];
+	        win->mwm_hints->status      = prop_hints[4];
+	        XFree(prop_hints);
+	    }
 	    return;
+        }
 
 	XFree((char *)win->mwm_hints);
     }

lesstif-0.95.0-attach-bottom-self.patch:

--- NEW FILE lesstif-0.95.0-attach-bottom-self.patch ---
diff -up lesstif-0.95.0/lib/Xm-2.1/Form.c~ lesstif-0.95.0/lib/Xm-2.1/Form.c
--- lesstif-0.95.0/lib/Xm-2.1/Form.c~	2007-09-01 20:24:58.000000000 +0200
+++ lesstif-0.95.0/lib/Xm-2.1/Form.c	2007-09-01 20:24:58.000000000 +0200
@@ -2538,7 +2538,7 @@ _XmFormLayout(Widget f, Widget cw, XtWid
 		_XmWarning(child, "bottom ATTACH_SELF %s %d"
 			   " no test coverage", __FILE__, __LINE__);
 #endif
-		SETH(XtHeight(child) - XtY(child));	/* FIX ME */
+		SETH(XtHeight(child));
 		FCP_Atta(con, BOTTOM).percent = (FCP_Y(con) + FCP_H(con) +
 					       _XmGetOffset(child, BOTTOM)) *
 		    Form_FractionBase(f) / fh;

lesstif-0.95.0-xtungrab-warning.patch:

--- NEW FILE lesstif-0.95.0-xtungrab-warning.patch ---
diff -up lesstif-0.95.0/lib/Xm-2.1/RowColumn.c~ lesstif-0.95.0/lib/Xm-2.1/RowColumn.c
--- lesstif-0.95.0/lib/Xm-2.1/RowColumn.c~	2007-09-02 22:03:10.000000000 +0200
+++ lesstif-0.95.0/lib/Xm-2.1/RowColumn.c	2007-09-02 22:06:16.000000000 +0200
@@ -1014,6 +1014,10 @@ initialize(Widget request, Widget new_w,
 
 }
 
+static void xtWarnCB(String message)
+{
+}
+
 static void
 destroy(Widget w)
 {
@@ -1033,14 +1039,19 @@ destroy(Widget w)
 
          if (realpar != NULL)
          {
+             XtErrorHandler old_handler;
              XtRemoveEventHandler(realpar,
                                   ButtonPressMask|ButtonReleaseMask,
                                   False, _XmPopupButtonPressHandler,
                                   (XtPointer)w );
-	     /* Fix a grab problem -- dwilliss */
-	     fprintf(stderr, "XtUngrabButton(%s,%u,%u)\n",
-			     XtName(realpar), RC_PostButton(w), RC_PostModifiers(w));
+             /* Yes this may not be necessary, shut up Xt see:
+                http://sourceforge.net/tracker/index.php?func=detail&aid=1217326&group_id=8596&atid=108596 */
+             old_handler = XtAppSetWarningHandler(
+                                        XtWidgetToApplicationContext(realpar),
+                                        xtWarnCB);
 	     XtUngrabButton(realpar, RC_PostButton(w), RC_PostModifiers(w));
+	     XtAppSetWarningHandler(XtWidgetToApplicationContext(realpar),
+	                            old_handler);
          }
      }
 


--- NEW FILE mwm.desktop ---
[Desktop Entry]
Encoding=UTF-8
Name=Mwm
Comment=Lesstif Motif window manager clone based on fvwm
Exec=mwm
Terminal=False
TryExec=mwm

[Window Manager]
SessionManaged=true



--- lesstif-0.95.0-cutpaste64.patch DELETED ---


--- lesstif-64.patch DELETED ---




More information about the scm-commits mailing list