winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2024
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
613 discussions
Start a n
N
ew thread
Alexandros Frantzis : server: Implement key auto-repeat request.
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: 37e7038c5c314527dc242cdbe5e8a70000fdfe98 URL:
https://gitlab.winehq.org/wine/wine/-/commit/37e7038c5c314527dc242cdbe5e8a7…
Author: Alexandros Frantzis <alexandros.frantzis(a)collabora.com> Date: Mon May 27 12:48:52 2024 +0300 server: Implement key auto-repeat request. --- include/wine/server_protocol.h | 21 +++++++++++++- server/protocol.def | 10 +++++++ server/queue.c | 62 ++++++++++++++++++++++++++++++++++++++++-- server/request.h | 8 ++++++ server/trace.c | 15 ++++++++++ server/user.h | 11 ++++++++ server/winstation.c | 2 ++ 7 files changed, 126 insertions(+), 3 deletions(-)
1
0
0
0
Alexandros Frantzis : server: Check message target process for raw input device flags.
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: f95a44665f13264b3fa0406eb3d45ba85a0c685a URL:
https://gitlab.winehq.org/wine/wine/-/commit/f95a44665f13264b3fa0406eb3d45b…
Author: Alexandros Frantzis <alexandros.frantzis(a)collabora.com> Date: Tue Jun 4 15:24:24 2024 +0300 server: Check message target process for raw input device flags. --- server/queue.c | 56 ++++++++++++++++++-------------------------------------- 1 file changed, 18 insertions(+), 38 deletions(-) diff --git a/server/queue.c b/server/queue.c index 55300f107bc..0bd714a92c1 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1528,27 +1528,6 @@ static void update_input_key_state( struct desktop *desktop, unsigned char *keys } } -/* update the desktop key state according to a mouse message flags */ -static void update_desktop_mouse_state( struct desktop *desktop, unsigned int flags, lparam_t wparam ) -{ - if (flags & MOUSEEVENTF_LEFTDOWN) - update_input_key_state( desktop, desktop->keystate, WM_LBUTTONDOWN, wparam ); - if (flags & MOUSEEVENTF_LEFTUP) - update_input_key_state( desktop, desktop->keystate, WM_LBUTTONUP, wparam ); - if (flags & MOUSEEVENTF_RIGHTDOWN) - update_input_key_state( desktop, desktop->keystate, WM_RBUTTONDOWN, wparam ); - if (flags & MOUSEEVENTF_RIGHTUP) - update_input_key_state( desktop, desktop->keystate, WM_RBUTTONUP, wparam ); - if (flags & MOUSEEVENTF_MIDDLEDOWN) - update_input_key_state( desktop, desktop->keystate, WM_MBUTTONDOWN, wparam ); - if (flags & MOUSEEVENTF_MIDDLEUP) - update_input_key_state( desktop, desktop->keystate, WM_MBUTTONUP, wparam ); - if (flags & MOUSEEVENTF_XDOWN) - update_input_key_state( desktop, desktop->keystate, WM_XBUTTONDOWN, wparam ); - if (flags & MOUSEEVENTF_XUP) - update_input_key_state( desktop, desktop->keystate, WM_XBUTTONUP, wparam ); -} - /* release the hardware message currently being processed by the given thread */ static void release_hardware_message( struct msg_queue *queue, unsigned int hw_id ) { @@ -1677,6 +1656,19 @@ static void prepend_cursor_history( int x, int y, unsigned int time, lparam_t in pos->info = info; } +static unsigned int get_rawinput_device_flags( struct process *process, struct message *msg ) +{ + switch (get_hardware_msg_bit( msg->msg )) + { + case QS_KEY: + return process->rawinput_kbd ? process->rawinput_kbd->flags : 0; + case QS_MOUSEMOVE: + case QS_MOUSEBUTTON: + return process->rawinput_mouse ? process->rawinput_mouse->flags : 0; + } + return 0; +} + /* queue a hardware message into a given thread input */ static void queue_hardware_message( struct desktop *desktop, struct message *msg, int always_queue ) { @@ -1685,6 +1677,7 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg struct thread_input *input; struct hardware_msg_data *msg_data = msg->data; unsigned int msg_code; + int flags; update_input_key_state( desktop, desktop->keystate, msg->msg, msg->wparam ); last_input_time = get_tick_count(); @@ -1723,12 +1716,14 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg else input = desktop->foreground_input; win = find_hardware_message_window( desktop, input, msg, &msg_code, &thread ); - if (!win || !thread) + flags = thread ? get_rawinput_device_flags( thread->process, msg ) : 0; + if (!win || !thread || (flags & RIDEV_NOLEGACY)) { - if (input) update_input_key_state( input->desktop, input->keystate, msg->msg, msg->wparam ); + if (input && !(flags & RIDEV_NOLEGACY)) update_input_key_state( input->desktop, input->keystate, msg->msg, msg->wparam ); free_message( msg ); return; } + input = thread->queue->input; if (win != msg->win) always_queue = 1; @@ -1987,7 +1982,6 @@ static void dispatch_rawinput_message( struct desktop *desktop, struct rawinput_ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, const hw_input_t *input, unsigned int origin, struct msg_queue *sender ) { - const struct rawinput_device *device; struct hardware_msg_data *msg_data; struct rawinput_message raw_msg; struct message *msg; @@ -2056,13 +2050,6 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons release_object( foreground ); } - if ((device = current->process->rawinput_mouse) && (device->flags & RIDEV_NOLEGACY)) - { - if (flags & MOUSEEVENTF_MOVE) update_desktop_cursor_pos( desktop, win, x, y ); - update_desktop_mouse_state( desktop, flags, wparam ); - return 0; - } - for (i = 0; i < ARRAY_SIZE( messages ); i++) { if (!messages[i]) continue; @@ -2097,7 +2084,6 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c unsigned int origin, struct msg_queue *sender ) { struct hw_msg_source source = { IMDT_KEYBOARD, origin }; - const struct rawinput_device *device; struct hardware_msg_data *msg_data; struct message *msg; struct thread *foreground; @@ -2213,12 +2199,6 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c release_object( foreground ); } - if ((device = current->process->rawinput_kbd) && (device->flags & RIDEV_NOLEGACY)) - { - update_input_key_state( desktop, desktop->keystate, message_code, vkey ); - return 0; - } - if (!(msg = alloc_hardware_message( input->kbd.info, source, time, 0 ))) return 0; msg_data = msg->data;
1
0
0
0
Alexandros Frantzis : server: Pass desktop to get_first_global_hook.
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: bf1da68aaaca32eccff80ff77bbd5382aaa07901 URL:
https://gitlab.winehq.org/wine/wine/-/commit/bf1da68aaaca32eccff80ff77bbd53…
Author: Alexandros Frantzis <alexandros.frantzis(a)collabora.com> Date: Wed May 29 10:34:54 2024 +0300 server: Pass desktop to get_first_global_hook. --- server/hook.c | 4 ++-- server/queue.c | 2 +- server/user.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/hook.c b/server/hook.c index 5abdf39ad37..c22e3748b8b 100644 --- a/server/hook.c +++ b/server/hook.c @@ -372,10 +372,10 @@ unsigned int get_active_hooks(void) } /* return the thread that owns the first global hook */ -struct thread *get_first_global_hook( int id ) +struct thread *get_first_global_hook( struct desktop *desktop, int id ) { struct hook *hook; - struct hook_table *global_hooks = get_global_hooks( current ); + struct hook_table *global_hooks = desktop->global_hooks; if (!global_hooks) return NULL; if (!(hook = get_first_valid_hook( global_hooks, id - WH_MINHOOK, EVENT_MIN, 0, 0, 0 ))) return NULL; diff --git a/server/queue.c b/server/queue.c index 7a1a8b6ece6..55300f107bc 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1751,7 +1751,7 @@ static int send_hook_ll_message( struct desktop *desktop, struct message *hardwa struct message *msg; timeout_t timeout = 2000 * -10000; /* FIXME: load from registry */ - if (!(hook_thread = get_first_global_hook( id ))) return 0; + if (!(hook_thread = get_first_global_hook( desktop, id ))) return 0; if (!(queue = hook_thread->queue)) return 0; if (is_queue_hung( queue )) return 0; diff --git a/server/user.h b/server/user.h index 703a55d5009..3b080356251 100644 --- a/server/user.h +++ b/server/user.h @@ -103,7 +103,7 @@ extern void cleanup_clipboard_thread( struct thread *thread ); extern void remove_thread_hooks( struct thread *thread ); extern unsigned int get_active_hooks(void); -extern struct thread *get_first_global_hook( int id ); +extern struct thread *get_first_global_hook( struct desktop *desktop, int id ); /* queue functions */
1
0
0
0
Rémi Bernon : win32u: Parameterize get_monitor_info dpi.
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: f80204011322f4652133057e2217af5cf4f1f98a URL:
https://gitlab.winehq.org/wine/wine/-/commit/f80204011322f4652133057e2217af…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 3 20:27:46 2024 +0200 win32u: Parameterize get_monitor_info dpi. --- dlls/win32u/defwnd.c | 2 +- dlls/win32u/input.c | 2 +- dlls/win32u/menu.c | 2 +- dlls/win32u/sysparams.c | 5 ++--- dlls/win32u/win32u_private.h | 2 +- dlls/win32u/window.c | 10 +++++----- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index 95ad9481958..f549f922fd7 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -826,7 +826,7 @@ static void sys_command_size_move( HWND hwnd, WPARAM wparam ) mon = newmon; info.cbSize = sizeof(info); - if (mon && get_monitor_info( mon, &info )) + if (mon && get_monitor_info( mon, &info, get_thread_dpi() )) { pt.x = max( pt.x, info.rcWork.left ); pt.x = min( pt.x, info.rcWork.right - 1 ); diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 05d8eb05d12..5b25086cb6f 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2520,7 +2520,7 @@ BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) if (!reset && clipping_cursor && thread_info->clipping_cursor) return FALSE; /* already clipping */ if (!(monitor = NtUserMonitorFromWindow( hwnd, MONITOR_DEFAULTTONEAREST ))) return FALSE; - if (!NtUserGetMonitorInfo( monitor, &monitor_info )) return FALSE; + if (!get_monitor_info( monitor, &monitor_info, 0 )) return FALSE; if (!grab_fullscreen) { RECT virtual_rect = NtUserGetVirtualScreenRect(); diff --git a/dlls/win32u/menu.c b/dlls/win32u/menu.c index 05eb5445395..8a3f1350004 100644 --- a/dlls/win32u/menu.c +++ b/dlls/win32u/menu.c @@ -3068,7 +3068,7 @@ static BOOL show_popup( HWND owner, HMENU hmenu, UINT id, UINT flags, pt.y = y; monitor = monitor_from_point( pt, MONITOR_DEFAULTTONEAREST, get_thread_dpi() ); info.cbSize = sizeof(info); - get_monitor_info( monitor, &info ); + get_monitor_info( monitor, &info, get_thread_dpi() ); max_height = info.rcWork.bottom - info.rcWork.top; if (menu->cyMax) max_height = min( max_height, menu->cyMax ); diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 23b03d858a3..e465ec66af3 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -3594,10 +3594,9 @@ BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc return ret; } -BOOL get_monitor_info( HMONITOR handle, MONITORINFO *info ) +BOOL get_monitor_info( HMONITOR handle, MONITORINFO *info, UINT dpi ) { struct monitor *monitor; - UINT dpi = get_thread_dpi(); if (info->cbSize != sizeof(MONITORINFOEXW) && info->cbSize != sizeof(MONITORINFO)) return FALSE; @@ -6484,7 +6483,7 @@ ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code return get_menu_info( UlongToHandle(arg1), (MENUINFO *)arg2 ); case NtUserCallTwoParam_GetMonitorInfo: - return get_monitor_info( UlongToHandle(arg1), (MONITORINFO *)arg2 ); + return get_monitor_info( UlongToHandle(arg1), (MONITORINFO *)arg2, get_thread_dpi() ); case NtUserCallTwoParam_GetSystemMetricsForDpi: return get_system_metrics_for_dpi( arg1, arg2 ); diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 43cdda55e2c..96517ef081a 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -163,7 +163,7 @@ extern LONG get_char_dimensions( HDC hdc, TEXTMETRICW *metric, int *height ); extern INT get_display_depth( UNICODE_STRING *name ); extern RECT get_display_rect( const WCHAR *display ); extern UINT get_monitor_dpi( HMONITOR monitor ); -extern BOOL get_monitor_info( HMONITOR handle, MONITORINFO *info ); +extern BOOL get_monitor_info( HMONITOR handle, MONITORINFO *info, UINT dpi ); extern UINT get_win_monitor_dpi( HWND hwnd ); extern RECT get_primary_monitor_rect( UINT dpi ); extern DWORD get_process_layout(void); diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index eed4b914331..8ca49afcd87 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -2355,7 +2355,7 @@ static BOOL get_work_rect( HWND hwnd, RECT *rect ) if (!monitor) return FALSE; mon_info.cbSize = sizeof(mon_info); - get_monitor_info( monitor, &mon_info ); + get_monitor_info( monitor, &mon_info, get_thread_dpi() ); *rect = mon_info.rcMonitor; style = get_window_long( hwnd, GWL_STYLE ); @@ -2508,7 +2508,7 @@ static void make_rect_onscreen( RECT *rect ) HMONITOR monitor = monitor_from_rect( rect, MONITOR_DEFAULTTONEAREST, get_thread_dpi() ); info.cbSize = sizeof(info); - if (!monitor || !get_monitor_info( monitor, &info )) return; + if (!monitor || !get_monitor_info( monitor, &info, get_thread_dpi() )) return; /* FIXME: map coordinates from rcWork to rcMonitor */ if (rect->right <= info.rcWork.left) { @@ -4019,7 +4019,7 @@ static POINT get_minimized_pos( HWND hwnd, POINT pt ) HMONITOR monitor = monitor_from_window( hwnd, MONITOR_DEFAULTTOPRIMARY, get_thread_dpi() ); mon_info.cbSize = sizeof( mon_info ); - get_monitor_info( monitor, &mon_info ); + get_monitor_info( monitor, &mon_info, get_thread_dpi() ); parent_rect = mon_info.rcWork; } else get_client_rect( parent, &parent_rect, get_thread_dpi() ); @@ -4203,7 +4203,7 @@ static UINT arrange_iconic_windows( HWND parent ) HMONITOR monitor = monitor_from_window( 0, MONITOR_DEFAULTTOPRIMARY, get_thread_dpi() ); mon_info.cbSize = sizeof( mon_info ); - get_monitor_info( monitor, &mon_info ); + get_monitor_info( monitor, &mon_info, get_thread_dpi() ); parent_rect = mon_info.rcWork; } else get_client_rect( parent, &parent_rect, get_thread_dpi() ); @@ -5035,7 +5035,7 @@ static void fix_cs_coordinates( CREATESTRUCTW *cs, INT *sw ) monitor = monitor_from_window( cs->hwndParent, MONITOR_DEFAULTTOPRIMARY, get_thread_dpi() ); mon_info.cbSize = sizeof(mon_info); - get_monitor_info( monitor, &mon_info ); + get_monitor_info( monitor, &mon_info, get_thread_dpi() ); if (is_default_coord( cs->x )) {
1
0
0
0
Rémi Bernon : win32u: Parameterize get_clip_cursor dpi.
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: fd7fcc995edeb2fdccb986ff39cdd136bb376ebb URL:
https://gitlab.winehq.org/wine/wine/-/commit/fd7fcc995edeb2fdccb986ff39cdd1…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 3 20:14:50 2024 +0200 win32u: Parameterize get_clip_cursor dpi. --- dlls/win32u/input.c | 7 +++---- dlls/win32u/sysparams.c | 2 +- dlls/win32u/win32u_private.h | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index a58a8369559..05d8eb05d12 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2553,9 +2553,8 @@ BOOL WINAPI NtUserGetPointerInfoList( UINT32 id, POINTER_INPUT_TYPE type, UINT_P return FALSE; } -BOOL get_clip_cursor( RECT *rect ) +BOOL get_clip_cursor( RECT *rect, UINT dpi ) { - UINT dpi; BOOL ret; if (!rect) return FALSE; @@ -2568,7 +2567,7 @@ BOOL get_clip_cursor( RECT *rect ) } SERVER_END_REQ; - if (ret && (dpi = get_thread_dpi())) + if (ret) { HMONITOR monitor = monitor_from_rect( rect, MONITOR_DEFAULTTOPRIMARY, 0 ); *rect = map_dpi_rect( *rect, get_monitor_dpi( monitor ), dpi ); @@ -2596,7 +2595,7 @@ BOOL process_wine_clipcursor( HWND hwnd, UINT flags, BOOL reset ) if (!grab_pointer) return TRUE; /* we are clipping if the clip rectangle is smaller than the screen */ - get_clip_cursor( &rect ); + get_clip_cursor( &rect, 0 ); intersect_rect( &rect, &rect, &virtual_rect ); if (EqualRect( &rect, &virtual_rect )) empty = TRUE; if (empty && !(flags & SET_CURSOR_FSCLIP)) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 56410cbf48c..23b03d858a3 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -6404,7 +6404,7 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ) return enum_clipboard_formats( arg ); case NtUserCallOneParam_GetClipCursor: - return get_clip_cursor( (RECT *)arg ); + return get_clip_cursor( (RECT *)arg, get_thread_dpi() ); case NtUserCallOneParam_GetCursorPos: return get_cursor_pos( (POINT *)arg ); diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 8cc4d1beed3..43cdda55e2c 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -103,7 +103,7 @@ extern BOOL set_caret_pos( int x, int y ); extern BOOL set_foreground_window( HWND hwnd, BOOL mouse ); extern void toggle_caret( HWND hwnd ); extern void update_mouse_tracking_info( HWND hwnd ); -extern BOOL get_clip_cursor( RECT *rect ); +extern BOOL get_clip_cursor( RECT *rect, UINT dpi ); extern BOOL process_wine_clipcursor( HWND hwnd, UINT flags, BOOL reset ); extern BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ); extern USHORT map_scan_to_kbd_vkey( USHORT scan, HKL layout );
1
0
0
0
Rémi Bernon : win32u: Use get_monitor_rect in more places.
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: f57d5305035049e8d738ee7b757b1030bc06a3c7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f57d5305035049e8d738ee7b757b10…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 3 20:07:02 2024 +0200 win32u: Use get_monitor_rect in more places. --- dlls/win32u/sysparams.c | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 006c8820b7b..56410cbf48c 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -2102,9 +2102,10 @@ UINT get_monitor_dpi( HMONITOR monitor ) return system_dpi; } -static RECT get_monitor_rect( struct monitor *monitor, UINT dpi ) +static RECT get_monitor_rect( struct monitor *monitor, BOOL work, UINT dpi ) { - return map_dpi_rect( monitor->rc_monitor, get_monitor_dpi( monitor->handle ), dpi ); + RECT rect = work ? monitor->rc_work : monitor->rc_monitor; + return map_dpi_rect( rect, get_monitor_dpi( monitor->handle ), dpi ); } /********************************************************************** @@ -2285,13 +2286,14 @@ RECT get_virtual_screen_rect( UINT dpi ) LIST_FOR_EACH_ENTRY( monitor, &monitors, struct monitor, entry ) { + RECT monitor_rect; if (!is_monitor_active( monitor ) || monitor->is_clone) continue; - union_rect( &rect, &rect, &monitor->rc_monitor ); + monitor_rect = get_monitor_rect( monitor, FALSE, dpi ); + union_rect( &rect, &rect, &monitor_rect ); } unlock_display_devices(); - if (dpi) rect = map_dpi_rect( rect, system_dpi, dpi ); return rect; } @@ -2308,7 +2310,7 @@ static BOOL is_window_rect_full_screen( const RECT *rect, UINT dpi ) if (!is_monitor_active( monitor ) || monitor->is_clone) continue; - monrect = get_monitor_rect( monitor, dpi ); + monrect = get_monitor_rect( monitor, FALSE, dpi ); if (rect->left <= monrect.left && rect->right >= monrect.right && rect->top <= monrect.top && rect->bottom >= monrect.bottom) { @@ -2338,7 +2340,7 @@ RECT get_display_rect( const WCHAR *display ) struct monitor *monitor; UNICODE_STRING name; RECT rect = {0}; - UINT index; + UINT index, dpi = get_thread_dpi(); RtlInitUnicodeString( &name, display ); if (!(index = get_display_index( &name ))) return rect; @@ -2347,12 +2349,12 @@ RECT get_display_rect( const WCHAR *display ) LIST_FOR_EACH_ENTRY( monitor, &monitors, struct monitor, entry ) { if (!monitor->source || monitor->source->id + 1 != index) continue; - rect = monitor->rc_monitor; + rect = get_monitor_rect( monitor, FALSE, dpi ); break; } unlock_display_devices(); - return map_dpi_rect( rect, system_dpi, get_thread_dpi() ); + return rect; } RECT get_primary_monitor_rect( UINT dpi ) @@ -2365,12 +2367,12 @@ RECT get_primary_monitor_rect( UINT dpi ) LIST_FOR_EACH_ENTRY( monitor, &monitors, struct monitor, entry ) { if (!is_monitor_primary( monitor )) continue; - rect = monitor->rc_monitor; + rect = get_monitor_rect( monitor, FALSE, dpi ); break; } unlock_display_devices(); - return map_dpi_rect( rect, system_dpi, dpi ); + return rect; } /********************************************************************** @@ -3505,7 +3507,7 @@ static BOOL should_enumerate_monitor( struct monitor *monitor, const POINT *orig if (!is_monitor_active( monitor )) return FALSE; if (monitor->is_clone) return FALSE; - *rect = get_monitor_rect( monitor, get_thread_dpi() ); + *rect = get_monitor_rect( monitor, FALSE, get_thread_dpi() ); OffsetRect( rect, -origin->x, -origin->y ); return intersect_rect( rect, rect, limit ); } @@ -3595,7 +3597,7 @@ BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc BOOL get_monitor_info( HMONITOR handle, MONITORINFO *info ) { struct monitor *monitor; - UINT dpi_from, dpi_to; + UINT dpi = get_thread_dpi(); if (info->cbSize != sizeof(MONITORINFOEXW) && info->cbSize != sizeof(MONITORINFO)) return FALSE; @@ -3606,9 +3608,8 @@ BOOL get_monitor_info( HMONITOR handle, MONITORINFO *info ) if (monitor->handle != handle) continue; if (!is_monitor_active( monitor )) continue; - /* FIXME: map dpi */ - info->rcMonitor = monitor->rc_monitor; - info->rcWork = monitor->rc_work; + info->rcMonitor = get_monitor_rect( monitor, FALSE, dpi ); + info->rcWork = get_monitor_rect( monitor, TRUE, dpi ); info->dwFlags = is_monitor_primary( monitor ) ? MONITORINFOF_PRIMARY : 0; if (info->cbSize >= sizeof(MONITORINFOEXW)) { @@ -3619,12 +3620,6 @@ BOOL get_monitor_info( HMONITOR handle, MONITORINFO *info ) } unlock_display_devices(); - if ((dpi_to = get_thread_dpi())) - { - dpi_from = get_monitor_dpi( handle ); - info->rcMonitor = map_dpi_rect( info->rcMonitor, dpi_from, dpi_to ); - info->rcWork = map_dpi_rect( info->rcWork, dpi_from, dpi_to ); - } TRACE( "flags %04x, monitor %s, work %s\n", (int)info->dwFlags, wine_dbgstr_rect(&info->rcMonitor), wine_dbgstr_rect(&info->rcWork)); return TRUE; @@ -3658,7 +3653,7 @@ HMONITOR monitor_from_rect( const RECT *rect, UINT flags, UINT dpi ) if (!is_monitor_active( monitor ) || monitor->is_clone) continue; - monitor_rect = get_monitor_rect( monitor, system_dpi ); + monitor_rect = get_monitor_rect( monitor, FALSE, system_dpi ); if (intersect_rect( &intersect, &monitor_rect, &r )) { /* check for larger intersecting area */ @@ -5244,6 +5239,8 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w } case SPI_GETWORKAREA: { + UINT dpi = get_thread_dpi(); + if (!ptr) return FALSE; spi_idx = SPI_SETWORKAREA_IDX; @@ -5256,14 +5253,14 @@ BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT w LIST_FOR_EACH_ENTRY( monitor, &monitors, struct monitor, entry ) { if (!is_monitor_primary( monitor )) continue; - work_area = monitor->rc_work; + work_area = get_monitor_rect( monitor, TRUE, dpi ); break; } unlock_display_devices(); spi_loaded[spi_idx] = TRUE; } - *(RECT *)ptr = map_dpi_rect( work_area, system_dpi, get_thread_dpi() ); + *(RECT *)ptr = work_area; ret = TRUE; TRACE("work area %s\n", wine_dbgstr_rect( &work_area )); break;
1
0
0
0
Rémi Bernon : winex11: Force the DPI context when restoring cursor clipping.
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: 949a3b891bdf16851b67ffe7fa1267bacb0382d3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/949a3b891bdf16851b67ffe7fa1267…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 3 20:20:33 2024 +0200 winex11: Force the DPI context when restoring cursor clipping. Avoiding any lossy conversion. --- dlls/winex11.drv/event.c | 4 ++-- dlls/winex11.drv/mouse.c | 11 +++++------ dlls/winex11.drv/x11drv.h | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 88863e62dd1..095820596de 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -772,7 +772,7 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev ) if (event->detail == NotifyPointer) return FALSE; /* when focusing in the virtual desktop window, re-apply the cursor clipping rect */ - if (is_virtual_desktop() && hwnd == NtUserGetDesktopWindow()) retry_grab_clipping_window(); + if (is_virtual_desktop() && hwnd == NtUserGetDesktopWindow()) reapply_cursor_clipping(); if (hwnd == NtUserGetDesktopWindow()) return FALSE; x11drv_thread_data()->keymapnotify_hwnd = hwnd; @@ -780,7 +780,7 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev ) /* when keyboard grab is released, re-apply the cursor clipping rect */ was_grabbed = keyboard_grabbed; keyboard_grabbed = event->mode == NotifyGrab || event->mode == NotifyWhileGrabbed; - if (was_grabbed > keyboard_grabbed) retry_grab_clipping_window(); + if (was_grabbed > keyboard_grabbed) reapply_cursor_clipping(); /* ignore wm specific NotifyUngrab / NotifyGrab events w.r.t focus */ if (event->mode == NotifyGrab || event->mode == NotifyUngrab) return FALSE; diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 1196986424d..dce3c888170 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -458,15 +458,14 @@ void ungrab_clipping_window(void) } /*********************************************************************** - * retry_grab_clipping_window - * - * Restore the current clip rectangle. + * reapply_cursor_clipping */ -void retry_grab_clipping_window(void) +void reapply_cursor_clipping(void) { RECT rect; - NtUserGetClipCursor( &rect ); - NtUserClipCursor( &rect ); + UINT context = NtUserSetThreadDpiAwarenessContext( NTUSER_DPI_PER_MONITOR_AWARE ); + if (NtUserGetClipCursor( &rect )) NtUserClipCursor( &rect ); + NtUserSetThreadDpiAwarenessContext( context ); } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index a221198ffbc..be76dd2609e 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -674,7 +674,7 @@ extern UINT get_win_monitor_dpi( HWND hwnd ); extern BOOL is_current_process_focused(void); extern void X11DRV_SetFocus( HWND hwnd ); extern void set_window_cursor( Window window, HCURSOR handle ); -extern void retry_grab_clipping_window(void); +extern void reapply_cursor_clipping(void); extern void ungrab_clipping_window(void); extern void move_resize_window( HWND hwnd, int dir ); extern void X11DRV_InitKeyboard( Display *display );
1
0
0
0
Rémi Bernon : winewayland: Force the DPI context when restoring cursor clipping.
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: 3d351fddeb9a04b24a81528eaca1ea2d8499042e URL:
https://gitlab.winehq.org/wine/wine/-/commit/3d351fddeb9a04b24a81528eaca1ea…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 3 20:20:33 2024 +0200 winewayland: Force the DPI context when restoring cursor clipping. Avoiding any lossy conversion. --- dlls/winewayland.drv/wayland_pointer.c | 11 +++++++++-- dlls/winewayland.drv/window.c | 12 +++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/dlls/winewayland.drv/wayland_pointer.c b/dlls/winewayland.drv/wayland_pointer.c index df76a4e9954..1d8acaeabd2 100644 --- a/dlls/winewayland.drv/wayland_pointer.c +++ b/dlls/winewayland.drv/wayland_pointer.c @@ -659,12 +659,19 @@ clear_cursor: } } +static void reapply_cursor_clipping(void) +{ + RECT rect; + UINT context = NtUserSetThreadDpiAwarenessContext(NTUSER_DPI_PER_MONITOR_AWARE); + if (NtUserGetClipCursor(&rect)) NtUserClipCursor(&rect); + NtUserSetThreadDpiAwarenessContext(context); +} + static void wayland_set_cursor(HWND hwnd, HCURSOR hcursor, BOOL use_hcursor) { struct wayland_pointer *pointer = &process_wayland.pointer; struct wayland_surface *surface; double scale; - RECT clip; BOOL reapply_clip = FALSE; if ((surface = wayland_surface_lock_hwnd(hwnd))) @@ -697,7 +704,7 @@ static void wayland_set_cursor(HWND hwnd, HCURSOR hcursor, BOOL use_hcursor) /* Reapply cursor clip since cursor visibility affects pointer constraint * behavior. */ - if (reapply_clip && NtUserGetClipCursor(&clip)) NtUserClipCursor(&clip); + if (reapply_clip) reapply_cursor_clipping(); } /********************************************************************** diff --git a/dlls/winewayland.drv/window.c b/dlls/winewayland.drv/window.c index cd8ca76b679..73bee46cc35 100644 --- a/dlls/winewayland.drv/window.c +++ b/dlls/winewayland.drv/window.c @@ -199,12 +199,19 @@ static void wayland_win_data_get_config(struct wayland_win_data *data, conf->managed = data->managed; } +static void reapply_cursor_clipping(void) +{ + RECT rect; + UINT context = NtUserSetThreadDpiAwarenessContext(NTUSER_DPI_PER_MONITOR_AWARE); + if (NtUserGetClipCursor(&rect )) NtUserClipCursor(&rect); + NtUserSetThreadDpiAwarenessContext(context); +} + static void wayland_win_data_update_wayland_surface(struct wayland_win_data *data) { struct wayland_surface *surface = data->wayland_surface; HWND parent = NtUserGetAncestor(data->hwnd, GA_PARENT); BOOL visible, xdg_visible; - RECT clip; WCHAR text[1024]; TRACE("hwnd=%p\n", data->hwnd); @@ -255,8 +262,7 @@ static void wayland_win_data_update_wayland_surface(struct wayland_win_data *dat /* Size/position changes affect the effective pointer constraint, so update * it as needed. */ - if (data->hwnd == NtUserGetForegroundWindow() && NtUserGetClipCursor(&clip)) - NtUserClipCursor(&clip); + if (data->hwnd == NtUserGetForegroundWindow()) reapply_cursor_clipping(); out: TRACE("hwnd=%p surface=%p=>%p\n", data->hwnd, data->wayland_surface, surface);
1
0
0
0
Alistair Leslie-Hughes : odbccp32: Stop handle leak on error paths.
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: dec2e818c0227d5373fae0a9da133b7a71a0b3b8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/dec2e818c0227d5373fae0a9da133b…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Fri Jun 7 21:14:13 2024 +1000 odbccp32: Stop handle leak on error paths. --- dlls/odbccp32/odbccp32.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/odbccp32/odbccp32.c b/dlls/odbccp32/odbccp32.c index 62e35e85f75..95bfb90781e 100644 --- a/dlls/odbccp32/odbccp32.c +++ b/dlls/odbccp32/odbccp32.c @@ -1003,6 +1003,7 @@ static void write_registry_values(const WCHAR *regkey, const WCHAR *driver, cons value = malloc(len * sizeof(WCHAR)); if(!value) { + RegCloseKey(hkeydriver); ERR("Out of memory\n"); return; } @@ -1015,6 +1016,7 @@ static void write_registry_values(const WCHAR *regkey, const WCHAR *driver, cons value = calloc(1, (lstrlenW(divider)+1) * sizeof(WCHAR)); if(!value) { + RegCloseKey(hkeydriver); ERR("Out of memory\n"); return; }
1
0
0
0
Alistair Leslie-Hughes : odbccp32: Check if a full path was supplied for Driver/Setup/Translator entries.
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: be87c0838159898e361fb77710a3c1bf4c7b7c84 URL:
https://gitlab.winehq.org/wine/wine/-/commit/be87c0838159898e361fb77710a3c1…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Fri Jun 7 21:13:39 2024 +1000 odbccp32: Check if a full path was supplied for Driver/Setup/Translator entries. --- dlls/odbccp32/odbccp32.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/dlls/odbccp32/odbccp32.c b/dlls/odbccp32/odbccp32.c index 90875121438..62e35e85f75 100644 --- a/dlls/odbccp32/odbccp32.c +++ b/dlls/odbccp32/odbccp32.c @@ -997,16 +997,28 @@ static void write_registry_values(const WCHAR *regkey, const WCHAR *driver, cons if(lstrcmpiW(driverW, entry) == 0 || lstrcmpiW(setupW, entry) == 0 || lstrcmpiW(translator, entry) == 0) { - len = lstrlenW(path) + lstrlenW(slash) + lstrlenW(divider) + 1; - value = malloc(len * sizeof(WCHAR)); - if(!value) + if(GetFileAttributesW(divider) == INVALID_FILE_ATTRIBUTES) { - ERR("Out of memory\n"); - return; + len = lstrlenW(path) + lstrlenW(slash) + lstrlenW(divider) + 1; + value = malloc(len * sizeof(WCHAR)); + if(!value) + { + ERR("Out of memory\n"); + return; + } + + lstrcpyW(value, path); + lstrcatW(value, slash); + } + else + { + value = calloc(1, (lstrlenW(divider)+1) * sizeof(WCHAR)); + if(!value) + { + ERR("Out of memory\n"); + return; + } } - - lstrcpyW(value, path); - lstrcatW(value, slash); lstrcatW(value, divider); } else
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
...
62
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Results per page:
10
25
50
100
200