winex11: Move the window resizing support to mouse.c.
This commit is contained in:
parent
002f85a275
commit
abfed909b2
|
@ -1326,6 +1326,48 @@ BOOL CDECL X11DRV_ClipCursor( LPCRECT clip )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* move_resize_window
|
||||||
|
*/
|
||||||
|
void move_resize_window( Display *display, struct x11drv_win_data *data, int dir )
|
||||||
|
{
|
||||||
|
DWORD pt;
|
||||||
|
int x, y, button = 0;
|
||||||
|
XEvent xev;
|
||||||
|
|
||||||
|
pt = GetMessagePos();
|
||||||
|
x = (short)LOWORD( pt );
|
||||||
|
y = (short)HIWORD( pt );
|
||||||
|
|
||||||
|
if (GetKeyState( VK_LBUTTON ) & 0x8000) button = 1;
|
||||||
|
else if (GetKeyState( VK_MBUTTON ) & 0x8000) button = 2;
|
||||||
|
else if (GetKeyState( VK_RBUTTON ) & 0x8000) button = 3;
|
||||||
|
|
||||||
|
TRACE( "hwnd %p/%lx, x %d, y %d, dir %d, button %d\n",
|
||||||
|
data->hwnd, data->whole_window, x, y, dir, button );
|
||||||
|
|
||||||
|
xev.xclient.type = ClientMessage;
|
||||||
|
xev.xclient.window = data->whole_window;
|
||||||
|
xev.xclient.message_type = x11drv_atom(_NET_WM_MOVERESIZE);
|
||||||
|
xev.xclient.serial = 0;
|
||||||
|
xev.xclient.display = display;
|
||||||
|
xev.xclient.send_event = True;
|
||||||
|
xev.xclient.format = 32;
|
||||||
|
xev.xclient.data.l[0] = x - virtual_screen_rect.left; /* x coord */
|
||||||
|
xev.xclient.data.l[1] = y - virtual_screen_rect.top; /* y coord */
|
||||||
|
xev.xclient.data.l[2] = dir; /* direction */
|
||||||
|
xev.xclient.data.l[3] = button; /* button */
|
||||||
|
xev.xclient.data.l[4] = 0; /* unused */
|
||||||
|
|
||||||
|
/* need to ungrab the pointer that may have been automatically grabbed
|
||||||
|
* with a ButtonPress event */
|
||||||
|
wine_tsx11_lock();
|
||||||
|
XUngrabPointer( display, CurrentTime );
|
||||||
|
XSendEvent(display, root_window, False, SubstructureNotifyMask | SubstructureRedirectMask, &xev);
|
||||||
|
wine_tsx11_unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* X11DRV_ButtonPress
|
* X11DRV_ButtonPress
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2779,9 +2779,7 @@ static BOOL is_netwm_supported( Display *display, Atom atom )
|
||||||
LRESULT CDECL X11DRV_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam )
|
LRESULT CDECL X11DRV_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam )
|
||||||
{
|
{
|
||||||
WPARAM hittest = wparam & 0x0f;
|
WPARAM hittest = wparam & 0x0f;
|
||||||
DWORD dwPoint;
|
int dir;
|
||||||
int x, y, dir;
|
|
||||||
XEvent xev;
|
|
||||||
Display *display = thread_display();
|
Display *display = thread_display();
|
||||||
struct x11drv_win_data *data;
|
struct x11drv_win_data *data;
|
||||||
|
|
||||||
|
@ -2833,30 +2831,6 @@ LRESULT CDECL X11DRV_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam )
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
dwPoint = GetMessagePos();
|
move_resize_window( display, data, dir );
|
||||||
x = (short)LOWORD(dwPoint);
|
|
||||||
y = (short)HIWORD(dwPoint);
|
|
||||||
|
|
||||||
TRACE("hwnd %p, x %d, y %d, dir %d\n", hwnd, x, y, dir);
|
|
||||||
|
|
||||||
xev.xclient.type = ClientMessage;
|
|
||||||
xev.xclient.window = X11DRV_get_whole_window(hwnd);
|
|
||||||
xev.xclient.message_type = x11drv_atom(_NET_WM_MOVERESIZE);
|
|
||||||
xev.xclient.serial = 0;
|
|
||||||
xev.xclient.display = display;
|
|
||||||
xev.xclient.send_event = True;
|
|
||||||
xev.xclient.format = 32;
|
|
||||||
xev.xclient.data.l[0] = x - virtual_screen_rect.left; /* x coord */
|
|
||||||
xev.xclient.data.l[1] = y - virtual_screen_rect.top; /* y coord */
|
|
||||||
xev.xclient.data.l[2] = dir; /* direction */
|
|
||||||
xev.xclient.data.l[3] = 1; /* button */
|
|
||||||
xev.xclient.data.l[4] = 0; /* unused */
|
|
||||||
|
|
||||||
/* need to ungrab the pointer that may have been automatically grabbed
|
|
||||||
* with a ButtonPress event */
|
|
||||||
wine_tsx11_lock();
|
|
||||||
XUngrabPointer( display, CurrentTime );
|
|
||||||
XSendEvent(display, root_window, False, SubstructureNotifyMask | SubstructureRedirectMask, &xev);
|
|
||||||
wine_tsx11_unlock();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -674,6 +674,7 @@ extern LRESULT clip_cursor_notify( HWND hwnd, HWND new_clip_hwnd ) DECLSPEC_HIDD
|
||||||
extern void ungrab_clipping_window(void) DECLSPEC_HIDDEN;
|
extern void ungrab_clipping_window(void) DECLSPEC_HIDDEN;
|
||||||
extern void reset_clipping_window(void) DECLSPEC_HIDDEN;
|
extern void reset_clipping_window(void) DECLSPEC_HIDDEN;
|
||||||
extern BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) DECLSPEC_HIDDEN;
|
extern BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) DECLSPEC_HIDDEN;
|
||||||
|
extern void move_resize_window( Display *display, struct x11drv_win_data *data, int dir ) DECLSPEC_HIDDEN;
|
||||||
extern void X11DRV_InitKeyboard( Display *display ) DECLSPEC_HIDDEN;
|
extern void X11DRV_InitKeyboard( Display *display ) DECLSPEC_HIDDEN;
|
||||||
extern DWORD CDECL X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout,
|
extern DWORD CDECL X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout,
|
||||||
DWORD mask, DWORD flags ) DECLSPEC_HIDDEN;
|
DWORD mask, DWORD flags ) DECLSPEC_HIDDEN;
|
||||||
|
|
Loading…
Reference in New Issue