From 4099068c5dbbd728a199f4776dbdbf9794955264 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Mon, 6 Sep 2021 00:54:02 +0300 Subject: [PATCH] Fixed bug that made the "modern search box" display incorrectly --- ExplorerPatcher/dllmain.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index d9d1a1e..8511004 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -4257,15 +4257,20 @@ LRESULT CJupiterWindow_StaticCoreWindowSubclassProcHook( FreeLibrary(hModule); if (!dwStatus) { - BOOL bIsAtBottom = FALSE, bIsAtRight = FALSE; - POINT pt = GetDefaultWinXPosition(TRUE, &bIsAtBottom, &bIsAtRight); RECT rc; GetWindowRect(hWnd, &rc); - LPWINDOWPOS wp = lParam; - wp->x = pt.x - (bIsAtRight ? (rc.right - rc.left) : 0); - wp->y = pt.y - (bIsAtBottom ? (rc.bottom - rc.top) : 0); - wp->flags &= ~SWP_NOMOVE; - return 0; + if (rc.top > 10) // this differentiates between the search + // interface (Win+Q) and the search box in + // Explorer + { + BOOL bIsAtBottom = FALSE, bIsAtRight = FALSE; + POINT pt = GetDefaultWinXPosition(TRUE, &bIsAtBottom, &bIsAtRight); + LPWINDOWPOS wp = lParam; + wp->x = pt.x - (bIsAtRight ? (rc.right - rc.left) : 0); + wp->y = pt.y - (bIsAtBottom ? (rc.bottom - rc.top) : 0); + wp->flags &= ~SWP_NOMOVE; + return 0; + } } } }