Skip to content

Commit

Permalink
Reverted change at OnDelayedMove() in d25ae27:
Browse files Browse the repository at this point in the history
  • Loading branch information
spx268 committed Feb 12, 2013
1 parent d25ae27 commit f48c7f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
25 changes: 5 additions & 20 deletions Library/MeterWindow.cpp
Expand Up @@ -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;
Expand All @@ -3534,11 +3525,8 @@ bool CMeterWindow::MoveWindowIfAppropriate()
if (x != m_ScreenX || y != m_ScreenY)
{
MoveWindow(x, y);
return true;
}
}

return false;
}

/*
Expand Down Expand Up @@ -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;
}
Expand Down
1 change: 0 additions & 1 deletion Library/MeterWindow.h
Expand Up @@ -326,7 +326,6 @@ class CMeterWindow : public CGroup
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();
Expand Down

0 comments on commit f48c7f9

Please sign in to comment.