fix(touch): raise the soft keyboard only for a tap on the visible focused EditLine
A chat line keeps the IME focus under a hidden board (interfacemodule __HideWindows for an NPC dialog, the focus handed back by UnlockWindow/DeactivateWindow), and IsPointInsideFocusedWindow only checked its own show flag and rect, so taps on the NPC dialog or the minimap buttons opened the keyboard. Require the whole parent chain to render and the picked window to be the focused one or its child. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
78d14776b8
commit
5c8d583b31
@@ -612,7 +612,16 @@ bool IsPointInsideFocusedWindow(int x, int y)
|
||||
{
|
||||
if (!g_window_manager) return false;
|
||||
UI::CWindow* pWin = g_window_manager->GetActivateWindow();
|
||||
return pWin && pWin->IsShow() && pWin->IsIn(x - g_window_manager->GetScreenOffsetX(), y);
|
||||
if (!pWin || !pWin->IsRendering())
|
||||
return false;
|
||||
// The focus can outlive the EditLine's use: UnlockWindow after an NPC dialog and DeactivateWindow
|
||||
// hand it back to a chat line whose board is hidden (capture on again), and the full-screen
|
||||
// GameWindow can hold it. Only a tap that picks the focused window itself (or its child) is one on it.
|
||||
for (UI::CWindow* pPicked = g_window_manager->PickWindow(x - g_window_manager->GetScreenOffsetX(), y);
|
||||
pPicked; pPicked = pPicked->GetParent())
|
||||
if (pPicked == pWin)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsPointInsideActiveUI(int x, int y)
|
||||
|
||||
Reference in New Issue
Block a user