Added DisableDrag=1/0 to lock skins into position.

Added DisableRDP=1/0 to disable redraw during RDP session (thanks to FUR10N for the code).
Minor changes to the installer and Rainstaller.
This commit is contained in:
Birunthan Mohanathas 2010-11-24 15:34:07 +00:00
parent 72da30c565
commit 1f3a04e54e
5 changed files with 46 additions and 6 deletions

View File

@ -2486,7 +2486,12 @@ void CMeterWindow::Update(bool nodraw)
m_ResetRegion = true;
}
Redraw();
// If our option is to disable when in an RDP session, then check if in an RDP session.
// Only redraw if we are not in a remote session
if (!Rainmeter->GetDisableRDP() || !GetSystemMetrics(SM_REMOTESESSION))
{
Redraw();
}
}
// Start/stop the transition timer if necessary
@ -3492,7 +3497,7 @@ LRESULT CMeterWindow::OnExitSizeMove(UINT uMsg, WPARAM wParam, LPARAM lParam)
*/
LRESULT CMeterWindow::OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (m_WindowDraggable)
if (m_WindowDraggable && !Rainmeter->GetDisableDrag())
{
POINT pos;
pos.x = (SHORT)LOWORD(lParam);

View File

@ -1186,13 +1186,17 @@ CRainmeter::CRainmeter()
{
m_MenuActive = false;
m_DisableRDP = false;
m_DisableDrag = false;
m_Logging = false;
m_DesktopWorkAreaChanged = false;
m_DesktopWorkAreaType = false;
m_DisableVersionCheck = FALSE;
m_NewVersion = FALSE;
m_DisableVersionCheck = false;
m_NewVersion = false;
m_Instance = NULL;
m_CurrentParser = NULL;
@ -2730,6 +2734,8 @@ void CRainmeter::ReadGeneralSettings(const std::wstring& iniFile)
// Read Logging settings
m_Logging = 0!=parser.ReadInt(L"Rainmeter", L"Logging", 0);
m_DisableDrag = 0!=parser.ReadInt(L"Rainmeter", L"DisableDrag", 0);
m_DisableRDP = 0!=parser.ReadInt(L"Rainmeter", L"DisableRDP", 0);
c_Debug = 0!=parser.ReadInt(L"Rainmeter", L"Debug", 0);
if (m_Logging)
@ -3239,8 +3245,14 @@ void CRainmeter::ShowContextMenu(POINT pos, CMeterWindow* meterWindow)
{
AppendMenu(configMenu, MF_SEPARATOR, 0, NULL);
AppendMenu(configMenu, 0, ID_CONTEXT_OPENSKINSFOLDER, L"Open Skins\' Folder");
AppendMenu(configMenu, 0, ID_CONTEXT_DISABLEDRAG, L"Disable Drag");
AppendMenu(configMenu, 0, ID_CONTEXT_MANAGESKINS, L"Manage Skins...");
if (m_DisableDrag)
{
CheckMenuItem(configMenu, ID_CONTEXT_DISABLEDRAG, MF_BYCOMMAND | MF_CHECKED);
}
InsertMenu(subMenu, 3, MF_BYPOSITION | MF_POPUP, (UINT_PTR)configMenu, L"Configs");
}
@ -3500,7 +3512,11 @@ HMENU CRainmeter::CreateSkinMenu(CMeterWindow* meterWindow, int index, HMENU con
CheckMenuItem(settingsMenu, ID_CONTEXT_SKINMENU_REMEMBERPOSITION, MF_BYCOMMAND | MF_CHECKED);
}
if (meterWindow->GetWindowDraggable())
if (m_DisableDrag)
{
EnableMenuItem(settingsMenu, ID_CONTEXT_SKINMENU_DRAGGABLE, MF_BYCOMMAND | MF_GRAYED);
}
else if (meterWindow->GetWindowDraggable())
{
CheckMenuItem(settingsMenu, ID_CONTEXT_SKINMENU_DRAGGABLE, MF_BYCOMMAND | MF_CHECKED);
}
@ -3747,6 +3763,12 @@ void CRainmeter::SetDebug(bool debug)
WritePrivateProfileString(L"Rainmeter", L"Debug", debug ? L"1" : L"0", m_IniFile.c_str());
}
void CRainmeter::SetDisableDrag(bool drag)
{
m_DisableDrag = drag;
WritePrivateProfileString(L"Rainmeter", L"DisableDrag", dragging ? L"1" : L"0", m_IniFile.c_str());
}
void CRainmeter::TestSettingsFile(bool bDefaultIniLocation)
{
WritePrivateProfileString(L"Rainmeter", L"WriteTest", L"TRUE", m_IniFile.c_str());

View File

@ -135,7 +135,6 @@ public:
std::wstring message;
};
CRainmeter();
~CRainmeter();
@ -196,6 +195,11 @@ public:
void StopLogging();
void DeleteLogFile();
bool GetDisableRDP() { return m_DisableRDP; }
bool GetDisableDrag() { return m_DisableDrag; }
void SetDisableDrag(bool drag);
void AddAboutLogInfo(const LOG_INFO& logInfo);
const std::list<LOG_INFO>& GetAboutLogData() { return m_LogData; }
@ -279,6 +283,10 @@ private:
bool m_MenuActive;
bool m_DisableRDP;
bool m_DisableDrag;
bool m_Logging;
std::list<LOG_INFO> m_LogData;

View File

@ -449,6 +449,10 @@ LRESULT CALLBACK CTrayWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
{
Rainmeter->SetDebug(!CRainmeter::GetDebug());
}
else if(wParam == ID_CONTEXT_DISABLEDRAG)
{
Rainmeter->SetDisableDrag(!Rainmeter->GetDisableDrag());
}
else if(wParam == ID_CONTEXT_EDITCONFIG)
{
std::wstring command = Rainmeter->GetConfigEditor();

View File

@ -18,6 +18,7 @@
#define IDC_DISABLE_VERSION_CHECK 1008
#define ID_CONTEXT_REFRESH 4001
#define ID_CONTEXT_QUIT 4002
#define ID_CONTEXT_DISABLEDRAG 4003
#define ID_CONTEXT_ABOUT 4004
#define ID_CONTEXT_DOWNLOADS 4005
#define ID_CONTEXT_CONFIGS_DEFAULT 4006