Rebase against 4ec67b7a6447dfc4af8c03c141c600b41b90ef53.

This commit is contained in:
Zebediah Figura
2022-04-26 16:52:01 -05:00
parent 91cb025138
commit 87212e802d
10 changed files with 39 additions and 612 deletions

View File

@@ -1,4 +1,4 @@
From 308420aac52197c2add1e472f509b109a17db961 Mon Sep 17 00:00:00 2001
From c336f99371aaf087b85257de1087b475452f2f84 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= <gabrielopcode@gmail.com>
Date: Mon, 22 Jul 2019 15:29:25 +0300
Subject: [PATCH] user32/focus: Prevent a recursive loop with the activation
@@ -15,26 +15,13 @@ actually depend on this behavior, so it is needed.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46274
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
---
dlls/user32/focus.c | 1 -
dlls/user32/tests/msg.c | 2 +-
dlls/win32u/input.c | 40 ++++++++++++++++++++++++------------
dlls/win32u/input.c | 41 ++++++++++++++++++++++++------------
dlls/win32u/ntuser_private.h | 1 +
4 files changed, 29 insertions(+), 15 deletions(-)
3 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c
index ff41cf716a1..a044133ab40 100644
--- a/dlls/user32/focus.c
+++ b/dlls/user32/focus.c
@@ -31,7 +31,6 @@
#include "user_private.h"
#include "wine/server.h"
-
/*******************************************************************
* FOCUS_MouseActivate
*
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index f939e91764c..af4fee6b3fc 100644
index c0a74d8edbe..585ff299142 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -5571,7 +5571,7 @@ static void test_messages(void)
@@ -47,10 +34,10 @@ index f939e91764c..af4fee6b3fc 100644
if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_MINIMIZE)
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c
index 328f270fb1f..ade8c313423 100644
index 28fc5a918c8..b8fd5622468 100644
--- a/dlls/win32u/input.c
+++ b/dlls/win32u/input.c
@@ -1287,7 +1287,7 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
@@ -1547,7 +1547,7 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
{
HWND previous = get_active_window();
BOOL ret;
@@ -59,7 +46,7 @@ index 328f270fb1f..ade8c313423 100644
CBTACTIVATESTRUCT cbt;
if (previous == hwnd)
@@ -1296,16 +1296,24 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
@@ -1556,16 +1556,24 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
return TRUE;
}
@@ -93,7 +80,7 @@ index 328f270fb1f..ade8c313423 100644
}
SERVER_START_REQ( set_active_window )
@@ -1325,7 +1333,11 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
@@ -1585,7 +1593,11 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
if (send_message( hwnd, WM_QUERYNEWPALETTE, 0, 0 ))
send_message_timeout( HWND_BROADCAST, WM_PALETTEISCHANGING, (WPARAM)hwnd, 0,
SMTO_ABORTIFHUNG, 2000, NULL, FALSE );
@@ -106,7 +93,7 @@ index 328f270fb1f..ade8c313423 100644
}
old_thread = previous ? get_window_thread( previous, NULL ) : 0;
@@ -1357,7 +1369,7 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
@@ -1617,7 +1629,7 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
}
}
@@ -115,7 +102,13 @@ index 328f270fb1f..ade8c313423 100644
{
send_message( hwnd, WM_NCACTIVATE, hwnd == NtUserGetForegroundWindow(), (LPARAM)previous );
send_message( hwnd, WM_ACTIVATE,
@@ -1382,7 +1394,9 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
@@ -1637,12 +1649,15 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
/* Do not change focus if the window is no more active */
if (hwnd == info.hwndActive)
{
+ /* this line exists to keep this patch from applying in the wrong place */
if (!info.hwndFocus || !hwnd || NtUserGetAncestor( info.hwndFocus, GA_ROOT ) != hwnd)
set_focus_window( hwnd );
}
}
@@ -127,7 +120,7 @@ index 328f270fb1f..ade8c313423 100644
/**********************************************************************
diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h
index 6afe3955787..9994b56bac2 100644
index fe9d7e18bc9..e852a0d5aa0 100644
--- a/dlls/win32u/ntuser_private.h
+++ b/dlls/win32u/ntuser_private.h
@@ -121,6 +121,7 @@ typedef struct tagWND
@@ -139,5 +132,5 @@ index 6afe3955787..9994b56bac2 100644
#define WND_OTHER_PROCESS ((WND *)1) /* returned by WIN_GetPtr on unknown window handles */
#define WND_DESKTOP ((WND *)2) /* returned by WIN_GetPtr on the desktop window */
--
2.35.1
2.34.1