public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
From: Jon TURNEY <jon.turney@dronecode.org.uk>
To: cygwin-xfree@cygwin.com
Cc: oschmidt-mailinglists@gmx.de
Subject: Re: problem evaluating window resize hints under 64 bit
Date: Thu, 19 Jun 2014 21:44:00 -0000	[thread overview]
Message-ID: <53A359B2.2050407@dronecode.org.uk> (raw)
In-Reply-To: <53A2D616.4020605@gmx.de>

On 19/06/2014 13:22, Oliver Schmidt wrote:
> 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 */

Thanks for pointing this out and the patch.

The same problem also occurs with WM_HINTS a few lines above.

> 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.

Yes.  For historical reasons, 'long' is used for the CARD32 type in the 
libX11 API (which this structure has been copied from), but because that 
has a different size on x86 and x86_64, so libX11 marshalls that into a 
32-bit quantity before storing it into the window property.

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
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/


      reply	other threads:[~2014-06-19 21:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-19 12:22 Oliver Schmidt
2014-06-19 21:44 ` Jon TURNEY [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53A359B2.2050407@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-xfree@cygwin.com \
    --cc=oschmidt-mailinglists@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).