From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12469 invoked by alias); 19 Jun 2014 21:44:23 -0000 Mailing-List: contact cygwin-xfree-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-xfree-owner@cygwin.com Reply-To: cygwin-xfree@cygwin.com Mail-Followup-To: cygwin-xfree@cygwin.com Received: (qmail 12460 invoked by uid 89); 19 Jun 2014 21:44:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: smtpout02.bt.lon5.cpcloud.co.uk Received: from smtpout02.bt.lon5.cpcloud.co.uk (HELO smtpout02.bt.lon5.cpcloud.co.uk) (65.20.0.122) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Jun 2014 21:44:21 +0000 X-CTCH-RefID: str=0001.0A090204.53A359B3.008C,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-Junkmail-Premium-Raw: score=8/97,refid=2.7.2:2014.6.19.185119:17:8.317,ip=,rules=__MOZILLA_MSGID, __HAS_MSGID, __SANE_MSGID, __HAS_FROM, __HAS_REPLYTO, __USER_AGENT, __MOZILLA_USER_AGENT, __MIME_VERSION, __TO_MALFORMED_2, __TO_NO_NAME, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __SUBJ_ALPHA_END, __IN_REP_TO, __CT, __CT_TEXT_PLAIN, __CTE, __SUBJ_ALPHA_NEGATE, __FORWARDED_MSG, BODY_SIZE_1900_1999, BODYTEXTP_SIZE_3000_LESS, __MIME_TEXT_ONLY, HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, BODY_SIZE_2000_LESS, REPLYTO_FROM_DIFF_ADDY, BODY_SIZE_7000_LESS, NO_URI_FOUND X-CTCH-Spam: Unknown Received: from [192.168.1.93] (86.179.19.114) by smtpout02.bt.lon5.cpcloud.co.uk (8.6.100.99.10223) (authenticated as jonturney@btinternet.com) id 539F93A9002014EE; Thu, 19 Jun 2014 22:44:19 +0100 Message-ID: <53A359B2.2050407@dronecode.org.uk> Date: Thu, 19 Jun 2014 21:44:00 -0000 From: Jon TURNEY Reply-To: cygwin-xfree@cygwin.com User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: cygwin-xfree@cygwin.com CC: oschmidt-mailinglists@gmx.de Subject: Re: problem evaluating window resize hints under 64 bit References: <53A2D616.4020605@gmx.de> In-Reply-To: <53A2D616.4020605@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2014-06/txt/msg00020.txt.bz2 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/