problem evaluating window resize hints under 64 bit

Oliver Schmidt <[email protected]>
Newsgroups gmane.os.cygwin.xfree
Message-ID <[email protected]>
The current cygwin x server 1.15.1-2 under 64-bit cygwin seems to have a problem correctly evaluating the window resize 
hints.

In hw/xwin/winmultiwindowwndproc.c the function ValidateSizing calls winMultiWindowGetWMNormalHints and gets wrong 
values in sizeHints.width_inc and sizeHints.height_inc.

In function winMultiWindowGetWMNormalHints in file hw/xwin/winmultiwindowclass.c you can see that a memcpy occurs from 
prop->data with sizeof(WinXSizeHints).

As it turns out, everything is correct if you modify the typedef of WinXSizeHints in hw/xwin/winmultiwindowclass.h so 
that long type becomes int:

--- a/cygwin/hw/xwin/winmultiwindowclass.h
+++ b/cygwin/hw/xwin/winmultiwindowclass.h
@@ -63,7 +63,7 @@ typedef struct {
   * used with WM_NORMAL_HINTS.
   */
  typedef struct {
-    long flags;                 /* marks which fields in this structure are defined */
+    int flags;                 /* marks which fields in this structure are defined */
      int x, y;                   /* obsolete for new window mgrs, but clients */
      int width, height;          /* should set so old wm's don't mess up */

I can only guess why this works: in the X11 message protocol all int and long types are mapped to 32 bit integers. It 
seems that the memcpy in winMultiWindowGetWMNormalHints has source data that has memory layout as in the X11 message 
protocol.

Best regards,
Oliver

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.