diff --git a/CollapseLauncher/XAMLs/MainApp/MainPage.xaml.cs b/CollapseLauncher/XAMLs/MainApp/MainPage.xaml.cs index 43fc255ca..aedeb49ff 100644 --- a/CollapseLauncher/XAMLs/MainApp/MainPage.xaml.cs +++ b/CollapseLauncher/XAMLs/MainApp/MainPage.xaml.cs @@ -285,6 +285,9 @@ private void ChangeTitleDragAreaInvoker_TitleBarEvent(object sender, ChangeTitle MainWindow.SetDragArea(DragAreaMode_Normal); break; } + + // Recalculate non-client area size + MainWindow.EnableNonClientArea(); } #endregion diff --git a/CollapseLauncher/XAMLs/MainApp/MainWindow.xaml.cs b/CollapseLauncher/XAMLs/MainApp/MainWindow.xaml.cs index a0a06752e..097a61640 100644 --- a/CollapseLauncher/XAMLs/MainApp/MainWindow.xaml.cs +++ b/CollapseLauncher/XAMLs/MainApp/MainWindow.xaml.cs @@ -172,14 +172,14 @@ public void InitializeWindowSettings() m_oldWndProc = SetWindowLongPtr(m_windowHandle, GWLP_WNDPROC, pWndProc); } - public void EnableNonClientArea() + public static void EnableNonClientArea() { var incps = InputNonClientPointerSource.GetForWindowId(m_windowID); var safeArea = new RectInt32[] { new(m_appWindow.Size.Width - (int)((144 + 12) * m_appDPIScale), 0, (int)((144 + 12) * m_appDPIScale), (int)(48 * m_appDPIScale)) }; incps.SetRegionRects(NonClientRegionKind.Passthrough, safeArea); } - public void DisableNonClientArea() + public static void DisableNonClientArea() { var incps = InputNonClientPointerSource.GetForWindowId(m_windowID); var safeArea = new RectInt32[] { new(0, 0, m_appWindow.Size.Width, (int)(48 * m_appDPIScale)) }; diff --git a/CollapseLauncher/XAMLs/StartUp/StartupLanguageSelect.xaml.cs b/CollapseLauncher/XAMLs/StartUp/StartupLanguageSelect.xaml.cs index 67fe0cd36..371e34086 100644 --- a/CollapseLauncher/XAMLs/StartUp/StartupLanguageSelect.xaml.cs +++ b/CollapseLauncher/XAMLs/StartUp/StartupLanguageSelect.xaml.cs @@ -98,13 +98,13 @@ private void SelectLang_OnDropDownOpened(object sender, object e) { // The dropdown panel collides with non-client area, making the first item not clickable. // Use this to disable whole non-client area temporarily. - (m_window as MainWindow).DisableNonClientArea(); + MainWindow.DisableNonClientArea(); } private void SelectLang_OnDropDownClosed(object sender, object e) { // And restore the nc area to normal state. - (m_window as MainWindow).EnableNonClientArea(); + MainWindow.EnableNonClientArea(); } private IEnumerable LangList