Merge branch 'focus-modal-windows' into 'main'

win32: Focus modal windows when clicking on unfocused parent

See merge request GNOME/gtk!6051
This commit is contained in:
Luca Bacci 2023-06-12 13:55:45 +00:00
commit cf980cdefb

View File

@ -2734,6 +2734,10 @@ gdk_event_translate (MSG *msg,
if (GDK_IS_DRAG_SURFACE (window) ||
_gdk_modal_blocked (window))
{
/* Focus the modal window */
GdkSurface *modal_window = _gdk_modal_current ();
if (modal_window != NULL)
SetFocus (GDK_SURFACE_HWND (modal_window));
*ret_valp = MA_NOACTIVATE;
return_val = TRUE;
}
@ -2744,6 +2748,10 @@ gdk_event_translate (MSG *msg,
if (GDK_IS_DRAG_SURFACE (window) ||
_gdk_modal_blocked (window))
{
/* Focus the modal window */
GdkSurface *modal_window = _gdk_modal_current ();
if (modal_window != NULL)
SetFocus (GDK_SURFACE_HWND (modal_window));
*ret_valp = PA_NOACTIVATE;
return_val = TRUE;
}