[100118] trunk/dports/x11/wine-crossover/files/dlls-user32-winpos.c.patch

jmr at macports.org jmr at macports.org
Wed Nov 28 21:30:41 PST 2012


Revision: 100118
          https://trac.macports.org/changeset/100118
Author:   jmr at macports.org
Date:     2012-11-28 21:30:41 -0800 (Wed, 28 Nov 2012)
Log Message:
-----------
wine-crossover: add forgotten part of patch

Modified Paths:
--------------
    trunk/dports/x11/wine-crossover/files/dlls-user32-winpos.c.patch

Modified: trunk/dports/x11/wine-crossover/files/dlls-user32-winpos.c.patch
===================================================================
--- trunk/dports/x11/wine-crossover/files/dlls-user32-winpos.c.patch	2012-11-29 04:36:30 UTC (rev 100117)
+++ trunk/dports/x11/wine-crossover/files/dlls-user32-winpos.c.patch	2012-11-29 05:30:41 UTC (rev 100118)
@@ -80,3 +80,114 @@
  /***********************************************************************
   *		IsIconic (USER32.@)
   */
+From: Alexandre Julliard <julliard at winehq.org>
+Date: Wed, 14 Nov 2012 15:26:13 +0000 (+0100)
+Subject: user32: Properly set last error in MapWindowPoints.
+X-Git-Tag: wine-1.5.18~240
+X-Git-Url: http://source.winehq.org/git
+
+user32: Properly set last error in MapWindowPoints.
+---
+
+diff --git dlls/user32/winpos.c.orig dlls/user32/winpos.c
+index eda5b78..c620df9 100644
+--- dlls/user32/winpos.c
++++ dlls/user32/winpos.c
+@@ -422,11 +422,11 @@ HWND WINAPI ChildWindowFromPointEx( HWND hwndParent, POINT pt, UINT uFlags)
+  * Calculate the offset between the origin of the two windows. Used
+  * to implement MapWindowPoints.
+  */
+-static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored )
++static BOOL WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored, POINT *ret_offset )
+ {
+     WND * wndPtr;
+     POINT offset;
+-    BOOL mirror_from, mirror_to;
++    BOOL mirror_from, mirror_to, ret;
+     HWND hwnd;
+ 
+     offset.x = offset.y = 0;
+@@ -435,7 +435,11 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored )
+     /* Translate source window origin to screen coords */
+     if (hwndFrom)
+     {
+-        if (!(wndPtr = WIN_GetPtr( hwndFrom ))) return offset;
++        if (!(wndPtr = WIN_GetPtr( hwndFrom )))
++        {
++            SetLastError( ERROR_INVALID_WINDOW_HANDLE );
++            return FALSE;
++        }
+         if (wndPtr == WND_OTHER_PROCESS) goto other_process;
+         if (wndPtr != WND_DESKTOP)
+         {
+@@ -466,7 +470,11 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored )
+     /* Translate origin to destination window coords */
+     if (hwndTo)
+     {
+-        if (!(wndPtr = WIN_GetPtr( hwndTo ))) return offset;
++        if (!(wndPtr = WIN_GetPtr( hwndTo )))
++        {
++            SetLastError( ERROR_INVALID_WINDOW_HANDLE );
++            return FALSE;
++        }
+         if (wndPtr == WND_OTHER_PROCESS) goto other_process;
+         if (wndPtr != WND_DESKTOP)
+         {
+@@ -496,35 +504,37 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored )
+ 
+     *mirrored = mirror_from ^ mirror_to;
+     if (mirror_from) offset.x = -offset.x;
+-    return offset;
++    *ret_offset = offset;
++    return TRUE;
+ 
+  other_process:  /* one of the parents may belong to another process, do it the hard way */
+-    offset.x = offset.y = 0;
+     SERVER_START_REQ( get_windows_offset )
+     {
+         req->from = wine_server_user_handle( hwndFrom );
+         req->to   = wine_server_user_handle( hwndTo );
+-        if (!wine_server_call( req ))
++        if ((ret = !wine_server_call_err( req )))
+         {
+-            offset.x = reply->x;
+-            offset.y = reply->y;
++            ret_offset->x = reply->x;
++            ret_offset->y = reply->y;
+             *mirrored = reply->mirror;
+         }
+     }
+     SERVER_END_REQ;
+-    return offset;
++    return ret;
+ }
+ 
+ /* map coordinates of a window region */
+ void map_window_region( HWND from, HWND to, HRGN hrgn )
+ {
+     BOOL mirrored;
+-    POINT offset = WINPOS_GetWinOffset( from, to, &mirrored );
++    POINT offset;
+     UINT i, size;
+     RGNDATA *data;
+     HRGN new_rgn;
+     RECT *rect;
+ 
++    if (!WINPOS_GetWinOffset( from, to, &mirrored, &offset )) return;
++
+     if (!mirrored)
+     {
+         OffsetRgn( hrgn, offset.x, offset.y );
+@@ -557,9 +567,11 @@ void map_window_region( HWND from, HWND to, HRGN hrgn )
+ INT WINAPI MapWindowPoints( HWND hwndFrom, HWND hwndTo, LPPOINT lppt, UINT count )
+ {
+     BOOL mirrored;
+-    POINT offset = WINPOS_GetWinOffset( hwndFrom, hwndTo, &mirrored );
++    POINT offset;
+     UINT i;
+ 
++    if (!WINPOS_GetWinOffset( hwndFrom, hwndTo, &mirrored, &offset )) return 0;
++
+     for (i = 0; i < count; i++)
+     {
+         lppt[i].x += offset.x;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20121128/0662c4f8/attachment.html>


More information about the macports-changes mailing list