winex11: Get rid of direct accesses to the window structure in the drag&drop code.
This commit is contained in:
parent
4844672781
commit
68fa3524f8
|
@ -44,7 +44,6 @@
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
#include "wingdi.h"
|
#include "wingdi.h"
|
||||||
|
|
||||||
#include "win.h"
|
|
||||||
#include "x11drv.h"
|
#include "x11drv.h"
|
||||||
|
|
||||||
/* avoid conflict with field names in included win32 headers */
|
/* avoid conflict with field names in included win32 headers */
|
||||||
|
@ -728,6 +727,7 @@ static HWND find_drop_window( HWND hQueryWnd, LPPOINT lpPt )
|
||||||
*/
|
*/
|
||||||
static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
|
static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
|
||||||
{
|
{
|
||||||
|
struct x11drv_win_data *data;
|
||||||
unsigned long data_length;
|
unsigned long data_length;
|
||||||
unsigned long aux_long;
|
unsigned long aux_long;
|
||||||
unsigned char* p_data = NULL;
|
unsigned char* p_data = NULL;
|
||||||
|
@ -735,7 +735,6 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
|
||||||
int x, y, dummy;
|
int x, y, dummy;
|
||||||
BOOL bAccept;
|
BOOL bAccept;
|
||||||
Window win, w_aux_root, w_aux_child;
|
Window win, w_aux_root, w_aux_child;
|
||||||
WND* pWnd;
|
|
||||||
HWND hScope = hWnd;
|
HWND hScope = hWnd;
|
||||||
|
|
||||||
win = X11DRV_get_whole_window(hWnd);
|
win = X11DRV_get_whole_window(hWnd);
|
||||||
|
@ -746,14 +745,14 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
|
||||||
y += virtual_screen_rect.top;
|
y += virtual_screen_rect.top;
|
||||||
wine_tsx11_unlock();
|
wine_tsx11_unlock();
|
||||||
|
|
||||||
pWnd = WIN_GetPtr(hWnd);
|
if (!(data = X11DRV_get_win_data( hWnd ))) return;
|
||||||
|
|
||||||
/* find out drop point and drop window */
|
/* find out drop point and drop window */
|
||||||
if( x < 0 || y < 0 ||
|
if( x < 0 || y < 0 ||
|
||||||
x > (pWnd->rectWindow.right - pWnd->rectWindow.left) ||
|
x > (data->whole_rect.right - data->whole_rect.left) ||
|
||||||
y > (pWnd->rectWindow.bottom - pWnd->rectWindow.top) )
|
y > (data->whole_rect.bottom - data->whole_rect.top) )
|
||||||
{
|
{
|
||||||
bAccept = pWnd->dwExStyle & WS_EX_ACCEPTFILES;
|
bAccept = GetWindowLongW( hWnd, GWL_EXSTYLE ) & WS_EX_ACCEPTFILES;
|
||||||
x = 0;
|
x = 0;
|
||||||
y = 0;
|
y = 0;
|
||||||
}
|
}
|
||||||
|
@ -773,7 +772,6 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
|
||||||
bAccept = FALSE;
|
bAccept = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WIN_ReleasePtr(pWnd);
|
|
||||||
|
|
||||||
if (!bAccept) return;
|
if (!bAccept) return;
|
||||||
|
|
||||||
|
@ -807,17 +805,11 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
|
||||||
|
|
||||||
if( lpDrop )
|
if( lpDrop )
|
||||||
{
|
{
|
||||||
WND *pDropWnd = WIN_GetPtr( hScope );
|
|
||||||
lpDrop->pFiles = sizeof(DROPFILES);
|
lpDrop->pFiles = sizeof(DROPFILES);
|
||||||
lpDrop->pt.x = x;
|
lpDrop->pt.x = x;
|
||||||
lpDrop->pt.y = y;
|
lpDrop->pt.y = y;
|
||||||
lpDrop->fNC =
|
lpDrop->fNC = FALSE;
|
||||||
( x < (pDropWnd->rectClient.left - pDropWnd->rectWindow.left) ||
|
|
||||||
y < (pDropWnd->rectClient.top - pDropWnd->rectWindow.top) ||
|
|
||||||
x > (pDropWnd->rectClient.right - pDropWnd->rectWindow.left) ||
|
|
||||||
y > (pDropWnd->rectClient.bottom - pDropWnd->rectWindow.top) );
|
|
||||||
lpDrop->fWide = FALSE;
|
lpDrop->fWide = FALSE;
|
||||||
WIN_ReleasePtr(pDropWnd);
|
|
||||||
p_drop = (char *)(lpDrop + 1);
|
p_drop = (char *)(lpDrop + 1);
|
||||||
p = (char *)p_data;
|
p = (char *)p_data;
|
||||||
while(*p)
|
while(*p)
|
||||||
|
@ -846,6 +838,7 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
|
||||||
*/
|
*/
|
||||||
static void EVENT_DropURLs( HWND hWnd, XClientMessageEvent *event )
|
static void EVENT_DropURLs( HWND hWnd, XClientMessageEvent *event )
|
||||||
{
|
{
|
||||||
|
struct x11drv_win_data *win_data;
|
||||||
unsigned long data_length;
|
unsigned long data_length;
|
||||||
unsigned long aux_long, drop_len = 0;
|
unsigned long aux_long, drop_len = 0;
|
||||||
unsigned char *p_data = NULL; /* property data */
|
unsigned char *p_data = NULL; /* property data */
|
||||||
|
@ -904,19 +897,18 @@ static void EVENT_DropURLs( HWND hWnd, XClientMessageEvent *event )
|
||||||
hDrop = GlobalAlloc( GMEM_SHARE, drop_len );
|
hDrop = GlobalAlloc( GMEM_SHARE, drop_len );
|
||||||
lpDrop = (DROPFILES *) GlobalLock( hDrop );
|
lpDrop = (DROPFILES *) GlobalLock( hDrop );
|
||||||
|
|
||||||
if( lpDrop ) {
|
if( lpDrop && (win_data = X11DRV_get_win_data( hWnd )))
|
||||||
WND *pDropWnd = WIN_GetPtr( hWnd );
|
{
|
||||||
lpDrop->pFiles = sizeof(DROPFILES);
|
lpDrop->pFiles = sizeof(DROPFILES);
|
||||||
lpDrop->pt.x = x;
|
lpDrop->pt.x = x;
|
||||||
lpDrop->pt.y = y;
|
lpDrop->pt.y = y;
|
||||||
lpDrop->fNC =
|
lpDrop->fNC =
|
||||||
( x < (pDropWnd->rectClient.left - pDropWnd->rectWindow.left) ||
|
( x < (win_data->client_rect.left - win_data->whole_rect.left) ||
|
||||||
y < (pDropWnd->rectClient.top - pDropWnd->rectWindow.top) ||
|
y < (win_data->client_rect.top - win_data->whole_rect.top) ||
|
||||||
x > (pDropWnd->rectClient.right - pDropWnd->rectWindow.left) ||
|
x > (win_data->client_rect.right - win_data->whole_rect.left) ||
|
||||||
y > (pDropWnd->rectClient.bottom - pDropWnd->rectWindow.top) );
|
y > (win_data->client_rect.bottom - win_data->whole_rect.top) );
|
||||||
lpDrop->fWide = FALSE;
|
lpDrop->fWide = FALSE;
|
||||||
p_drop = (char*)(lpDrop + 1);
|
p_drop = (char*)(lpDrop + 1);
|
||||||
WIN_ReleasePtr(pDropWnd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create message content */
|
/* create message content */
|
||||||
|
|
Loading…
Reference in New Issue