From f48c7f9e01b8a73742de7bfba6b666cd54a0cd14 Mon Sep 17 00:00:00 2001 From: spx Date: Tue, 12 Feb 2013 23:19:17 +0900 Subject: [PATCH] Reverted change at OnDelayedMove() in d25ae27: http://rainmeter.net/forum/viewtopic.php?p=83860 --- Library/MeterWindow.cpp | 25 +++++-------------------- Library/MeterWindow.h | 1 - 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index 822cbc91..4f8b8d61 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -3515,15 +3515,6 @@ void CMeterWindow::SetKeepOnScreen(bool b) m_KeepOnScreen = b; WriteOptions(OPTION_KEEPONSCREEN); - MoveWindowIfAppropriate(); -} - -/* -** Helper function for setting KeepOnScreen -** -*/ -bool CMeterWindow::MoveWindowIfAppropriate() -{ if (m_KeepOnScreen) { int x = m_ScreenX; @@ -3534,11 +3525,8 @@ bool CMeterWindow::MoveWindowIfAppropriate() if (x != m_ScreenX || y != m_ScreenY) { MoveWindow(x, y); - return true; } } - - return false; } /* @@ -4651,20 +4639,17 @@ LRESULT CMeterWindow::OnDelayedRefresh(UINT uMsg, WPARAM wParam, LPARAM lParam) } /* -** Handles delayed move +** Handles delayed move. +** Do not save the position in this handler for the sake of preventing move by temporal resolution/workarea change. ** */ LRESULT CMeterWindow::OnDelayedMove(UINT uMsg, WPARAM wParam, LPARAM lParam) { m_Parser.ResetMonitorVariables(this); - // Move the window to correct position - ResizeWindow(true); - - if (!MoveWindowIfAppropriate()) - { - ScreenToWindow(); - } + // Move the window temporarily + ResizeWindow(false); + SetWindowPos(m_Window, NULL, m_ScreenX, m_ScreenY, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); return 0; } diff --git a/Library/MeterWindow.h b/Library/MeterWindow.h index 6c5aa481..8fa6ad00 100644 --- a/Library/MeterWindow.h +++ b/Library/MeterWindow.h @@ -326,7 +326,6 @@ private: void HandleButtons(POINT pos, BUTTONPROC proc, bool execute = true); void SetClickThrough(bool b); void SetKeepOnScreen(bool b); - bool MoveWindowIfAppropriate(); void SetWindowDraggable(bool b); void SetSavePosition(bool b); void SavePositionIfAppropriate();