winex11: Directly use win32u in more places.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2022-05-01 23:49:53 +02:00 committed by Alexandre Julliard
parent 7769c8e9df
commit 4af9ac6733
6 changed files with 25 additions and 19 deletions

View File

@ -2292,8 +2292,8 @@ void X11DRV_UpdateClipboard(void)
if (GetCurrentThreadId() == clipboard_thread_id) return;
now = NtGetTickCount();
if ((int)(now - last_update) <= SELECTION_UPDATE_DELAY) return;
if (SendMessageTimeoutW( GetClipboardOwner(), WM_X11DRV_UPDATE_CLIPBOARD, 0, 0,
SMTO_ABORTIFHUNG, 5000, &ret ) && ret)
if (send_message_timeout( NtUserGetClipboardOwner(), WM_X11DRV_UPDATE_CLIPBOARD, 0, 0,
SMTO_ABORTIFHUNG, 5000, &ret ) && ret)
last_update = now;
}

View File

@ -192,9 +192,10 @@ static LONG X11DRV_desktop_set_current_mode( ULONG_PTR id, DEVMODEW *mode )
static void query_desktop_work_area( RECT *rc_work )
{
static const WCHAR trayW[] = {'S','h','e','l','l','_','T','r','a','y','W','n','d',0};
static const WCHAR trayW[] = {'S','h','e','l','l','_','T','r','a','y','W','n','d'};
UNICODE_STRING str = { sizeof(trayW), sizeof(trayW), (WCHAR *)trayW };
RECT rect;
HWND hwnd = FindWindowW( trayW, NULL );
HWND hwnd = NtUserFindWindowEx( 0, 0, &str, NULL, 0 );
if (!hwnd || !NtUserIsWindowVisible( hwnd )) return;
if (!NtUserGetWindowRect( hwnd, &rect )) return;

View File

@ -665,10 +665,11 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event )
HMENU hSysMenu;
if (NtUserGetClassLongW( hwnd, GCL_STYLE ) & CS_NOCLOSE) return;
hSysMenu = GetSystemMenu(hwnd, FALSE);
hSysMenu = NtUserGetSystemMenu( hwnd, FALSE );
if (hSysMenu)
{
UINT state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND);
UINT state = NtUserThunkedMenuItemInfo( hSysMenu, SC_CLOSE, MF_BYCOMMAND,
NtUserGetMenuState, NULL, NULL );
if (state == 0xFFFFFFFF || (state & (MF_DISABLED | MF_GRAYED)))
return;
}

View File

@ -406,7 +406,7 @@ static BOOL grab_clipping_window( const RECT *clip )
if (data->xi2_state != xi_enabled)
{
WARN( "XInput2 not supported, refusing to clip to %s\n", wine_dbgstr_rect(clip) );
DestroyWindow( msg_hwnd );
NtUserDestroyWindow( msg_hwnd );
NtUserClipCursor( NULL );
return TRUE;
}
@ -432,7 +432,7 @@ static BOOL grab_clipping_window( const RECT *clip )
if (!clipping_cursor)
{
disable_xinput2();
DestroyWindow( msg_hwnd );
NtUserDestroyWindow( msg_hwnd );
return FALSE;
}
clip_rect = *clip;
@ -1697,9 +1697,9 @@ void move_resize_window( HWND hwnd, int dir )
while (NtUserPeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
{
if (!CallMsgFilterW( &msg, MSGF_SIZE ))
if (!NtUserCallMsgFilter( &msg, MSGF_SIZE ))
{
TranslateMessage( &msg );
NtUserTranslateMessage( &msg, 0 );
NtUserDispatchMessage( &msg );
}
}

View File

@ -2007,13 +2007,16 @@ HWND create_foreign_window( Display *display, Window xwin )
if (!class_registered)
{
UNICODE_STRING class_name, version = { 0 };
WNDCLASSEXW class;
memset( &class, 0, sizeof(class) );
class.cbSize = sizeof(class);
class.lpfnWndProc = foreign_window_proc;
class.lpszClassName = classW;
if (!RegisterClassExW( &class ) && GetLastError() != ERROR_CLASS_ALREADY_EXISTS)
RtlInitUnicodeString( &class_name, classW );
if (!NtUserRegisterClassExWOW( &class, &class_name, &version, NULL, 0, 0, NULL ) &&
GetLastError() != ERROR_CLASS_ALREADY_EXISTS)
{
ERR( "Could not register foreign window class\n" );
return FALSE;
@ -2052,7 +2055,7 @@ HWND create_foreign_window( Display *display, Window xwin )
if (!(data = alloc_win_data( display, hwnd )))
{
DestroyWindow( hwnd );
NtUserDestroyWindow( hwnd );
return 0;
}
SetRect( &data->window_rect, pos.x, pos.y, pos.x + attr.width, pos.y + attr.height );
@ -2681,12 +2684,13 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags,
/* check if the window icon should be hidden (i.e. moved off-screen) */
static BOOL hide_icon( struct x11drv_win_data *data )
{
static const WCHAR trayW[] = {'S','h','e','l','l','_','T','r','a','y','W','n','d',0};
static const WCHAR trayW[] = {'S','h','e','l','l','_','T','r','a','y','W','n','d'};
UNICODE_STRING str = { sizeof(trayW), sizeof(trayW), (WCHAR *)trayW };
if (data->managed) return TRUE;
/* hide icons in desktop mode when the taskbar is active */
if (!is_virtual_desktop()) return FALSE;
return NtUserIsWindowVisible( FindWindowW( trayW, NULL ));
return NtUserIsWindowVisible( NtUserFindWindowEx( 0, 0, &str, NULL, 0 ));
}
/***********************************************************************

View File

@ -536,8 +536,8 @@ NTSTATUS x11drv_tablet_load_info( void *hwnd )
gSysContext.lcSensZ = 65536;
gSysContext.lcSysSensX= 65536;
gSysContext.lcSysSensY= 65536;
gSysContext.lcSysExtX = GetSystemMetrics(SM_CXVIRTUALSCREEN);
gSysContext.lcSysExtY = GetSystemMetrics(SM_CYVIRTUALSCREEN);
gSysContext.lcSysExtX = NtUserGetSystemMetrics( SM_CXVIRTUALSCREEN );
gSysContext.lcSysExtY = NtUserGetSystemMetrics( SM_CYVIRTUALSCREEN );
/* initialize cursors */
disable_system_cursors();
@ -905,7 +905,7 @@ static BOOL motion_event( HWND hwnd, XEvent *event )
gMsgPacket.pkNormalPressure = motion->axis_data[2];
gMsgPacket.pkButtons = get_button_state(curnum);
gMsgPacket.pkChanged = get_changed_state(&gMsgPacket);
SendMessageW(hwndTabletDefault,WT_PACKET,gMsgPacket.pkSerialNumber,(LPARAM)hwnd);
send_message( hwndTabletDefault, WT_PACKET, gMsgPacket.pkSerialNumber, (LPARAM)hwnd );
last_packet = gMsgPacket;
return TRUE;
}
@ -944,7 +944,7 @@ static BOOL button_event( HWND hwnd, XEvent *event )
}
gMsgPacket.pkButtons = get_button_state(curnum);
gMsgPacket.pkChanged = get_changed_state(&gMsgPacket);
SendMessageW(hwndTabletDefault,WT_PACKET,gMsgPacket.pkSerialNumber,(LPARAM)hwnd);
send_message( hwndTabletDefault, WT_PACKET, gMsgPacket.pkSerialNumber, (LPARAM)hwnd );
last_packet = gMsgPacket;
return TRUE;
}
@ -996,7 +996,7 @@ static BOOL proximity_event( HWND hwnd, XEvent *event )
*/
proximity_info = MAKELPARAM((event->type == proximity_in_type),
(event->type == proximity_in_type) || (event->type == proximity_out_type));
SendMessageW(hwndTabletDefault, WT_PROXIMITY, (WPARAM)hwnd, proximity_info);
send_message( hwndTabletDefault, WT_PROXIMITY, (WPARAM)hwnd, proximity_info );
return TRUE;
}