summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2025-05-12 17:25:26 +0300
committerGeorge Hazan <george.hazan@gmail.com>2025-05-12 17:25:26 +0300
commitc9c2324e4f13e66c75d886f94dbacac1e28b191f (patch)
tree5dca20847ea0506c79547f7f5dede0fce765889f
parentb0862a1dcc840b14b988b64a410bfc9076e624d3 (diff)
fixes #5009 ("Pin to desktop" option doesn't work in all modern Windows)
-rw-r--r--include/m_clist.h7
-rw-r--r--include/m_clistint.h3
-rw-r--r--libs/win32/mir_app.libbin309846 -> 309632 bytes
-rw-r--r--libs/win64/mir_app.libbin310008 -> 309812 bytes
-rw-r--r--plugins/Clist_modern/clist_modern.vcxproj1
-rw-r--r--plugins/Clist_modern/clist_modern.vcxproj.filters3
-rw-r--r--plugins/Clist_modern/res/resource.rc1
-rw-r--r--plugins/Clist_modern/src/cluiframes.cpp35
-rw-r--r--plugins/Clist_modern/src/init.cpp1
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp28
-rw-r--r--plugins/Clist_modern/src/modern_clistmod.cpp23
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp58
-rw-r--r--plugins/Clist_modern/src/modern_commonprototypes.h3
-rw-r--r--plugins/Clist_modern/src/modern_defsettings.h1
-rw-r--r--plugins/Clist_modern/src/modern_docking.cpp337
-rw-r--r--plugins/Clist_modern/src/modern_global_structure.h1
-rw-r--r--plugins/Clist_modern/src/modern_static_clui.h2
-rw-r--r--plugins/Clist_modern/src/modern_utils.cpp24
-rw-r--r--plugins/Clist_modern/src/resource.h1
-rw-r--r--plugins/Clist_nicer/clist_nicer.vcxproj1
-rw-r--r--plugins/Clist_nicer/clist_nicer.vcxproj.filters3
-rw-r--r--plugins/Clist_nicer/res/resource.rc1
-rw-r--r--plugins/Clist_nicer/src/Docking.cpp289
-rw-r--r--plugins/Clist_nicer/src/clc.h3
-rw-r--r--plugins/Clist_nicer/src/clistopts.cpp3
-rw-r--r--plugins/Clist_nicer/src/clui.cpp31
-rw-r--r--plugins/Clist_nicer/src/cluiframes.cpp5
-rw-r--r--plugins/Clist_nicer/src/init.cpp2
-rw-r--r--plugins/Clist_nicer/src/resource.h1
-rw-r--r--plugins/StatusManager/src/ss_main.cpp2
-rw-r--r--src/core/stdclist/res/resource.rc2
-rw-r--r--src/core/stdclist/src/cluiopts.cpp13
-rw-r--r--src/core/stdclist/src/resource.h1
-rw-r--r--src/mir_app/mir_app.vcxproj1
-rw-r--r--src/mir_app/mir_app.vcxproj.filters3
-rw-r--r--src/mir_app/src/Docking.cpp363
-rw-r--r--src/mir_app/src/clc.h3
-rw-r--r--src/mir_app/src/clistcore.cpp2
-rw-r--r--src/mir_app/src/clistmod.cpp3
-rw-r--r--src/mir_app/src/clui.cpp46
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
42 files changed, 87 insertions, 1222 deletions
diff --git a/include/m_clist.h b/include/m_clist.h
index 9a2f489787..01579e34ed 100644
--- a/include/m_clist.h
+++ b/include/m_clist.h
@@ -275,13 +275,6 @@ EXTERN_C MIR_APP_DLL(BOOL) Clist_MenuProcessCommand(int menu_id, int flags, MCON
EXTERN_C MIR_APP_DLL(BOOL) Clist_MenuProcessHotkey(unsigned hotkey);
/////////////////////////////////////////////////////////////////////////////////////////
-// determines whether the contact list is docked
-// wParam = lParam = 0
-// returns nonzero if the contact list is docked, of 0 if it is not
-
-EXTERN_C MIR_APP_DLL(BOOL) Clist_IsDocked(void);
-
-/////////////////////////////////////////////////////////////////////////////////////////
// Clist-related buttons management
/////////////////////////////////////////////////////////////////////////////////////////
// toggles the use groups mode of the contact list
diff --git a/include/m_clistint.h b/include/m_clistint.h
index be90203efa..a6e006f434 100644
--- a/include/m_clistint.h
+++ b/include/m_clistint.h
@@ -399,9 +399,6 @@ struct CLIST_INTERFACE
int (*pfnCompareContacts)(const ClcContact *contact1, const ClcContact *contact2);
int (*pfnSetHideOffline)(int newValue); // TRUE, FALSE or -1 to revert the current setting
- /* docking.c */
- int (*pfnDocking_ProcessWindowMessage)(WPARAM wParam, LPARAM lParam);
-
/*************************************************************************************
* version 2 - events processing
*************************************************************************************/
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib
index 5b3934c1ea..e75db034bf 100644
--- a/libs/win32/mir_app.lib
+++ b/libs/win32/mir_app.lib
Binary files differ
diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib
index 12b3e11ae3..83daa19217 100644
--- a/libs/win64/mir_app.lib
+++ b/libs/win64/mir_app.lib
Binary files differ
diff --git a/plugins/Clist_modern/clist_modern.vcxproj b/plugins/Clist_modern/clist_modern.vcxproj
index e6025e0e85..7490406f15 100644
--- a/plugins/Clist_modern/clist_modern.vcxproj
+++ b/plugins/Clist_modern/clist_modern.vcxproj
@@ -48,7 +48,6 @@
<ClCompile Include="src\modern_clui.cpp" />
<ClCompile Include="src\modern_cluiservices.cpp" />
<ClCompile Include="src\modern_contact.cpp" />
- <ClCompile Include="src\modern_docking.cpp" />
<ClCompile Include="src\modern_gdiplus.cpp" />
<ClCompile Include="src\modern_global.cpp" />
<ClCompile Include="src\modern_image_array.cpp" />
diff --git a/plugins/Clist_modern/clist_modern.vcxproj.filters b/plugins/Clist_modern/clist_modern.vcxproj.filters
index e16c49886b..305bf19814 100644
--- a/plugins/Clist_modern/clist_modern.vcxproj.filters
+++ b/plugins/Clist_modern/clist_modern.vcxproj.filters
@@ -68,9 +68,6 @@
<ClCompile Include="src\modern_contact.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\modern_docking.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\modern_gdiplus.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/plugins/Clist_modern/res/resource.rc b/plugins/Clist_modern/res/resource.rc
index fca73ca0c9..929295b400 100644
--- a/plugins/Clist_modern/res/resource.rc
+++ b/plugins/Clist_modern/res/resource.rc
@@ -451,7 +451,6 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
GROUPBOX "Appearance",IDC_STWINDOWGROUP,4,11,115,37
CONTROL "Always on top",IDC_ONTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,21,102,8
- CONTROL "Pin to desktop",IDC_ONDESKTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,33,102,8
GROUPBOX "Client area margins",IDC_FRAME_META2,124,64,179,45
EDITTEXT IDC_LEFTMARGIN,152,82,33,12,ES_NUMBER
CONTROL "",IDC_LEFTMARGINSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,174,83,11,12
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp
index 746247f164..b980f7b9cf 100644
--- a/plugins/Clist_modern/src/cluiframes.cpp
+++ b/plugins/Clist_modern/src/cluiframes.cpp
@@ -138,17 +138,10 @@ int SetAlpha(uint8_t Alpha)
HWND hwnd = F.OwnerWindow;
long l = GetWindowLongPtr(hwnd, GWL_EXSTYLE);
if (!(l & WS_EX_LAYERED)) {
- HWND parent = nullptr;
- if (g_CluiData.fOnDesktop) {
- HWND hProgMan = FindWindow(L"Progman", nullptr);
- if (IsWindow(hProgMan))
- parent = hProgMan;
- }
-
CLUI_ShowWindowMod(hwnd, SW_HIDE);
SetParent(hwnd, nullptr);
SetWindowLongPtr(hwnd, GWL_EXSTYLE, l | WS_EX_LAYERED);
- SetParent(hwnd, parent);
+ SetParent(hwnd, nullptr);
if (l&WS_VISIBLE) CLUI_ShowWindowMod(hwnd, SW_SHOW);
}
SetLayeredWindowAttributes(hwnd, g_CluiData.dwKeyColor, Alpha, LWA_ALPHA | LWA_COLORKEY);
@@ -174,21 +167,14 @@ int CLUIFrames_ActivateSubContainers(BOOL active)
{
for (int i = 0; i < g_nFramesCount; i++) {
FRAMEWND &F = g_pfwFrames[i];
- if (active && !F.floating && F.OwnerWindow != (HWND)nullptr && F.OwnerWindow != (HWND)-2 && F.visible && !F.needhide) {
- if (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
- SetWindowPos(F.OwnerWindow, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- SetWindowPos(F.OwnerWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- }
- else SetWindowPos(F.OwnerWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE);
- }
+ if (active && !F.floating && F.OwnerWindow != (HWND)nullptr && F.OwnerWindow != (HWND)-2 && F.visible && !F.needhide)
+ SetWindowPos(F.OwnerWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE);
}
return 0;
}
int CLUIFrames_SetParentForContainers(HWND parent)
{
- g_CluiData.fOnDesktop = (parent && parent != g_clistApi.hwndContactList);
-
for (int i = 0; i < g_nFramesCount; i++) {
FRAMEWND &F = g_pfwFrames[i];
if (!F.floating && F.OwnerWindow != (HWND)nullptr && F.OwnerWindow != (HWND)-2 && F.visible && !F.needhide) {
@@ -218,11 +204,7 @@ int CLUIFrames_OnShowHide(int mode)
if (mode != SW_HIDE) {
SetWindowPos(F.OwnerWindow, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- if (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
- SetWindowPos(F.OwnerWindow, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- SetWindowPos(F.OwnerWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- }
- else SetWindowPos(F.OwnerWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE);
+ SetWindowPos(F.OwnerWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE);
}
}
@@ -1348,9 +1330,6 @@ static int _us_DoCollapseFrame(WPARAM wParam, LPARAM lParam)
if (FrameId >= 0 && FrameId < g_nFramesCount) {
// do not collapse/uncollapse client/locked/invisible frames
if (g_pfwFrames[FrameId].align == alClient && !(g_pfwFrames[FrameId].Locked || (!g_pfwFrames[FrameId].visible) || g_pfwFrames[FrameId].floating)) {
- if (Clist_IsDocked())
- return 0;
-
if (g_CluiData.fDocked || !g_CluiData.fAutoSize) {
RECT rc;
GetWindowRect(g_clistApi.hwndContactList, &rc);
@@ -2988,12 +2967,6 @@ static HWND CreateSubContainerWindow(HWND parent, int x, int y, int width, int h
{
HWND hwnd = CreateWindowEx(WS_EX_LAYERED, CLUIFrameSubContainerClassName, L"SubContainerWindow", WS_POPUP | (!g_CluiData.fLayered ? WS_BORDER : 0), x, y, width, height, parent, nullptr, g_plugin.getInst(), nullptr);
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~(WS_CAPTION | WS_BORDER));
- if (g_CluiData.fOnDesktop) {
- HWND hProgMan = FindWindow(L"Progman", nullptr);
- if (IsWindow(hProgMan))
- SetParent(hwnd, hProgMan);
- }
-
return hwnd;
}
diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp
index 799f0f12a6..16ee18c048 100644
--- a/plugins/Clist_modern/src/init.cpp
+++ b/plugins/Clist_modern/src/init.cpp
@@ -207,7 +207,6 @@ static HRESULT SubclassClistInterface()
g_clistApi.pfnProcessExternalMessages = cli_ProcessExternalMessages;
g_clistApi.pfnAddEvent = cli_AddEvent;
g_clistApi.pfnFreeEvent = cli_RemoveEvent;
- g_clistApi.pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage;
return S_OK;
}
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index 528efe806b..abb187115b 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -936,7 +936,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
} //====== End of Non-Layered Mode =====
CheckDlgButton(hwndDlg, IDC_FADEINOUT, db_get_b(0, "CLUI", "FadeInOut", SETTING_FADEIN_DEFAULT));
- CheckDlgButton(hwndDlg, IDC_ONDESKTOP, g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT));
+
SendDlgItemMessage(hwndDlg, IDC_FRAMESSPIN, UDM_SETRANGE, 0, MAKELONG(50, 0));
SendDlgItemMessage(hwndDlg, IDC_CAPTIONSSPIN, UDM_SETRANGE, 0, MAKELONG(50, 0));
SendDlgItemMessage(hwndDlg, IDC_FRAMESSPIN, UDM_SETPOS, 0, db_get_dw(0, "CLUIFrames", "GapBetweenFrames", SETTING_GAPFRAMES_DEFAULT));
@@ -1013,12 +1013,6 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
CheckDlgButton(hwndDlg, IDC_LAYERENGINE, BST_CHECKED);
}
}
- else if (LOWORD(wParam) == IDC_ONDESKTOP && IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)) {
- CheckDlgButton(hwndDlg, IDC_ONTOP, BST_UNCHECKED);
- }
- else if (LOWORD(wParam) == IDC_ONTOP && IsDlgButtonChecked(hwndDlg, IDC_ONTOP)) {
- CheckDlgButton(hwndDlg, IDC_ONDESKTOP, BST_UNCHECKED);
- }
else if (LOWORD(wParam) == IDC_TOOLWND) {
EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TOOLWND));
}
@@ -1072,7 +1066,6 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
db_unset(0, "ModernData", "EnableLayering");
}
g_CluiData.dwKeyColor = db_get_dw(0, "ModernSettings", "KeyColor", (uint32_t)SETTING_KEYCOLOR_DEFAULT);
- g_plugin.setByte("OnDesktop", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
Clist::bOnTop = IsDlgButtonChecked(hwndDlg, IDC_ONTOP);
SetWindowPos(g_clistApi.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
db_set_b(0, "CLUI", "DragToScroll", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DRAGTOSCROLL));
@@ -1095,21 +1088,11 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
g_bChangingMode = true;
- if (IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)) {
- HWND hProgMan = FindWindow(L"Progman", nullptr);
- if (IsWindow(hProgMan)) {
- SetParent(g_clistApi.hwndContactList, hProgMan);
- Sync(CLUIFrames_SetParentForContainers, (HWND)hProgMan);
- g_CluiData.fOnDesktop = true;
- }
- }
- else {
- if (GetParent(g_clistApi.hwndContactList)) {
- SetParent(g_clistApi.hwndContactList, nullptr);
- Sync(CLUIFrames_SetParentForContainers, (HWND)nullptr);
- }
- g_CluiData.fOnDesktop = false;
+ if (GetParent(g_clistApi.hwndContactList)) {
+ SetParent(g_clistApi.hwndContactList, nullptr);
+ Sync(CLUIFrames_SetParentForContainers, (HWND)nullptr);
}
+
AniAva_UpdateParent();
db_set_b(0, "CLUI", "FadeInOut", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT));
g_CluiData.fSmoothAnimation = IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT) != 0;
@@ -1124,7 +1107,6 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
Clist::bTransparent = IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT);
Clist::iAlpha = SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0);
Clist::iAutoAlpha = SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0);
- g_plugin.setByte("OnDesktop", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
ske_LoadSkinFromDB();
CLUI_UpdateLayeredMode();
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp
index 2a3e5da2ba..cba1eb9792 100644
--- a/plugins/Clist_modern/src/modern_clistmod.cpp
+++ b/plugins/Clist_modern/src/modern_clistmod.cpp
@@ -127,7 +127,6 @@ int CListMod_ContactListShutdownProc(WPARAM, LPARAM)
HRESULT PreLoadContactListModule()
{
/* Global data initialization */
- g_CluiData.fOnDesktop = false;
g_CluiData.dwKeyColor = RGB(255, 0, 255);
g_CluiData.bCurrentAlpha = 255;
@@ -180,7 +179,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY)
if (IsIconic(hWnd) || !IsWindowVisible(hWnd))
return GWVS_HIDDEN;
- if (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT) || !Clist::bBringToFront)
+ if (!Clist::bBringToFront)
return GWVS_VISIBLE;
HWND hwndFocused = GetFocus();
@@ -220,7 +219,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY)
GetWindowRect(hWnd, &rc);
RECT rcMonitor = { 0 };
- Docking_GetMonitorRectFromWindow(hWnd, &rcMonitor);
+ GetMonitorRectFromWindow(hWnd, &rcMonitor);
rc.top = rc.top < rcMonitor.top ? rcMonitor.top : rc.top;
rc.left = rc.left < rcMonitor.left ? rcMonitor.left : rc.left;
@@ -336,19 +335,13 @@ int cliShowHide(bool bAlwaysShow)
Sync(CLUIFrames_ActivateSubContainers, TRUE);
CLUI_ShowWindowMod(g_clistApi.hwndContactList, SW_RESTORE);
- if (!g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
- Sync(CLUIFrames_OnShowHide, 1); //TO BE PROXIED
- SetWindowPos(g_clistApi.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- g_bCalledFromShowHide = 1;
- if (!Clist::bOnTop)
- SetWindowPos(g_clistApi.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
- g_bCalledFromShowHide = 0;
- }
- else {
+ Sync(CLUIFrames_OnShowHide, 1); //TO BE PROXIED
+ SetWindowPos(g_clistApi.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ g_bCalledFromShowHide = 1;
+ if (!Clist::bOnTop)
SetWindowPos(g_clistApi.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
- Sync(CLUIFrames_OnShowHide, 1);
- SetForegroundWindow(g_clistApi.hwndContactList);
- }
+ g_bCalledFromShowHide = 0;
+
g_plugin.setByte("State", SETTING_STATE_NORMAL);
RECT rcWindow;
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 500f7ca2d6..ec29f6c318 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -683,15 +683,6 @@ void CLUI_ChangeWindowMode()
}
SetWindowText(g_clistApi.hwndContactList, titleText);
- // < ->
- // 1 - If visible store it and hide
- if (g_CluiData.fLayered && (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT))) {
- SetParent(g_clistApi.hwndContactList, nullptr);
- Sync(CLUIFrames_SetParentForContainers, (HWND)nullptr);
- UpdateWindow(g_clistApi.hwndContactList);
- g_CluiData.fOnDesktop = false;
- }
-
// 5 - TODO Apply Style
oldStyleEx = curStyleEx = GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE);
oldStyle = curStyle = GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE);
@@ -716,23 +707,9 @@ void CLUI_ChangeWindowMode()
else
SetMenu(g_clistApi.hwndContactList, g_clistApi.hMenuMain);
- if (g_CluiData.fLayered && (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT)))
- ske_UpdateWindowImage();
-
// 6 - Pin to desktop mode
- if (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
- HWND hProgMan = FindWindow(L"Progman", nullptr);
- if (IsWindow(hProgMan)) {
- SetParent(g_clistApi.hwndContactList, hProgMan);
- Sync(CLUIFrames_SetParentForContainers, (HWND)hProgMan);
- g_CluiData.fOnDesktop = true;
- }
- }
- else {
- SetParent(g_clistApi.hwndContactList, nullptr);
- Sync(CLUIFrames_SetParentForContainers, (HWND)nullptr);
- g_CluiData.fOnDesktop = false;
- }
+ SetParent(g_clistApi.hwndContactList, nullptr);
+ Sync(CLUIFrames_SetParentForContainers, (HWND)nullptr);
// 7 - if it was visible - show
if (storedVisMode) {
@@ -751,7 +728,7 @@ void CLUI_ChangeWindowMode()
int v = (r.bottom - r.top) > (w * 2) ? w : (r.bottom - r.top);
h = (h < v) ? h : v;
HRGN hRgn1 = CreateRoundRectRgn(0, 0, (r.right - r.left + 1), (r.bottom - r.top + 1), h, h);
- if (db_get_b(0, "CLC", "RoundCorners", SETTING_ROUNDCORNERS_DEFAULT) && !Clist_IsDocked())
+ if (db_get_b(0, "CLC", "RoundCorners", SETTING_ROUNDCORNERS_DEFAULT))
SetWindowRgn(g_clistApi.hwndContactList, hRgn1, 1);
else {
DeleteObject(hRgn1);
@@ -808,7 +785,7 @@ int CLUI_HideBehindEdge()
//Need to be moved out of screen
bShowEventStarted = 0;
//1. get work area rectangle
- Docking_GetMonitorRectFromWindow(g_clistApi.hwndContactList, &rcScreen);
+ GetMonitorRectFromWindow(g_clistApi.hwndContactList, &rcScreen);
//SystemParametersInfo(SPI_GETWORKAREA, 0, &rcScreen,FALSE);
//2. move out
int bordersize = wBehindEdgeBorderSize;
@@ -848,7 +825,7 @@ int CLUI_ShowFromBehindEdge()
// Need to be moved out of screen
// 1. get work area rectangle
RECT rcScreen;
- Docking_GetMonitorRectFromWindow(g_clistApi.hwndContactList, &rcScreen);
+ GetMonitorRectFromWindow(g_clistApi.hwndContactList, &rcScreen);
// 2. move out
RECT rcWindow;
@@ -1693,12 +1670,10 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam)
CheckFramesPos(&rc);
Sync(CLUIFrames_OnMoving, m_hWnd, &rc);
if (!IsIconic(m_hWnd)) {
- if (!Clist_IsDocked()) { // if g_CluiData.fDocked, dont remember pos (except for width)
- g_plugin.setDword("Height", (uint32_t)(rc.bottom - rc.top));
- g_plugin.setDword("x", (uint32_t)rc.left);
- g_plugin.setDword("y", (uint32_t)rc.top);
- }
+ g_plugin.setDword("Height", (uint32_t)(rc.bottom - rc.top));
g_plugin.setDword("Width", (uint32_t)(rc.right - rc.left));
+ g_plugin.setDword("x", (uint32_t)rc.left);
+ g_plugin.setDword("y", (uint32_t)rc.top);
}
}
return TRUE;
@@ -1730,14 +1705,11 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam)
}
// if g_CluiData.fDocked, dont remember pos (except for width)
- if (!Clist_IsDocked()) {
- g_plugin.setDword("Height", (uint32_t)(rc.bottom - rc.top));
- g_plugin.setDword("x", (uint32_t)rc.left);
- g_plugin.setDword("y", (uint32_t)rc.top);
- }
- else SetWindowRgn(m_hWnd, nullptr, 0);
+ g_plugin.setDword("Height", (uint32_t)(rc.bottom - rc.top));
g_plugin.setDword("Width", (uint32_t)(rc.right - rc.left));
-
+ g_plugin.setDword("x", (uint32_t)rc.left);
+ g_plugin.setDword("y", (uint32_t)rc.top);
+
if (!g_CluiData.fLayered) {
HRGN hRgn1;
RECT r;
@@ -1747,7 +1719,7 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam)
int v = (r.bottom - r.top) > (w * 2) ? w : (r.bottom - r.top);
h = (h < v) ? h : v;
hRgn1 = CreateRoundRectRgn(0, 0, (r.right - r.left + 1), (r.bottom - r.top + 1), h, h);
- if (db_get_b(0, "CLC", "RoundCorners", SETTING_ROUNDCORNERS_DEFAULT) && !Clist_IsDocked())
+ if (db_get_b(0, "CLC", "RoundCorners", SETTING_ROUNDCORNERS_DEFAULT))
SetWindowRgn(m_hWnd, hRgn1, FALSE);
else {
DeleteObject(hRgn1);
@@ -2239,8 +2211,6 @@ LRESULT CLUI::OnSysCommand(UINT msg, WPARAM wParam, LPARAM lParam)
}
DefWindowProc(m_hWnd, msg, wParam, lParam);
- if (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT))
- Sync(CLUIFrames_ActivateSubContainers, TRUE);
return FALSE;
}
@@ -2282,7 +2252,7 @@ LRESULT CLUI::OnListSizeChangeNotify(NMCLISTCONTROL *pnmc)
rcWindow = rcSizingRect;
else
GetWindowRect(m_hWnd, &rcWindow);
- if (!g_CluiData.fAutoSize || g_clistApi.hwndContactTree == nullptr || Clist_IsDocked())
+ if (!g_CluiData.fAutoSize || g_clistApi.hwndContactTree == nullptr)
return FALSE;
maxHeight = db_get_b(0, "CLUI", "MaxSizeHeight", SETTING_MAXSIZEHEIGHT_DEFAULT);
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h
index d84b89c2a3..bd108c3770 100644
--- a/plugins/Clist_modern/src/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/modern_commonprototypes.h
@@ -152,7 +152,6 @@ int SetAlpha(uint8_t Alpha);
/* others TODO: move above */
-int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam);
void DrawBackGround(HWND hwnd, HDC mhdc, HBITMAP hBmpBackground, COLORREF bkColour, uint32_t backgroundBmpUse);
HRESULT BackgroundsLoadModule();
int BackgroundsUnloadModule();
@@ -181,7 +180,7 @@ INT_PTR ToggleHideOffline(WPARAM wParam, LPARAM lParam);
INT_PTR SetUseGroups(WPARAM wParam, LPARAM lParam); //contact.c
INT_PTR ToggleSounds(WPARAM wParam, LPARAM lParam); //contact.c
void ClcOptionsChanged(); //clc.c
-void Docking_GetMonitorRectFromWindow(HWND hWnd, RECT *rc); //Docking.c
+void GetMonitorRectFromWindow(HWND hWnd, RECT *rc); //Docking.c
void DrawAvatarImageWithGDIp(HDC hDestDC, int x, int y, uint32_t width, uint32_t height, HBITMAP hbmp, int x1, int y1, uint32_t width1, uint32_t height1, uint32_t flag, uint8_t alpha); //gdiplus.cpp
void InitGdiPlus(); //gdiplus.cpp
void ShutdownGdiPlus(); //gdiplus.cpp
diff --git a/plugins/Clist_modern/src/modern_defsettings.h b/plugins/Clist_modern/src/modern_defsettings.h
index 469ae95f19..868484cf14 100644
--- a/plugins/Clist_modern/src/modern_defsettings.h
+++ b/plugins/Clist_modern/src/modern_defsettings.h
@@ -35,7 +35,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define SETTING_THINBORDER_DEFAULT 0
#define SETTING_NOBORDER_DEFAULT 0
#define SETTING_WINDOWSHADOW_DEFAULT 0
-#define SETTING_ONDESKTOP_DEFAULT 0
#define SETTING_DISABLEWORKINGSET_DEFAULT 1
#define SETTING_ALWAYSVISICON_DEFAULT 0
diff --git a/plugins/Clist_modern/src/modern_docking.cpp b/plugins/Clist_modern/src/modern_docking.cpp
deleted file mode 100644
index 55d04d6e58..0000000000
--- a/plugins/Clist_modern/src/modern_docking.cpp
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (C) 2012-25 Miranda NG team (https://miranda-ng.org),
-Copyright (c) 2000-08 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "stdafx.h"
-#include "modern_sync.h"
-
-#define WM_DOCKCALLBACK (WM_USER+121)
-#define WM_CREATEDOCKED (WM_USER+122)
-#define EDGESENSITIVITY 3
-
-#define DOCKED_NONE 0
-#define DOCKED_LEFT 1
-#define DOCKED_RIGHT 2
-
-BOOL LockSubframeMoving = 0;
-static int TempDock = 0;
-static int dock_drag_dx = 0;
-static int dock_drag_dy = 0;
-
-static void Docking_GetMonitorRectFromPoint(POINT pt, RECT *rc)
-{
- MONITORINFO monitorInfo;
- HMONITOR hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST); // always returns a valid value
- monitorInfo.cbSize = sizeof(MONITORINFO);
-
- if (GetMonitorInfo(hMonitor, &monitorInfo))
- {
- memcpy(rc, &monitorInfo.rcMonitor, sizeof(RECT));
- return;
- }
-
- // "generic" win95/NT support, also serves as failsafe
- rc->left = 0;
- rc->top = 0;
- rc->bottom = GetSystemMetrics(SM_CYSCREEN);
- rc->right = GetSystemMetrics(SM_CXSCREEN);
-}
-
-void Docking_GetMonitorRectFromWindow(HWND hWnd, RECT *rc)
-{
- POINT ptWindow;
- GetWindowRect(hWnd, rc);
- ptWindow.x = rc->left;
- ptWindow.y = rc->top;
- Docking_GetMonitorRectFromPoint(ptWindow, rc);
-}
-
-static void Docking_AdjustPosition(HWND hwnd, RECT *rcDisplay, RECT *rc)
-{
- APPBARDATA abd;
-
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = hwnd;
- abd.uEdge = g_CluiData.fDocked == DOCKED_LEFT ? ABE_LEFT : ABE_RIGHT;
- abd.rc = *rc;
- abd.rc.top = rcDisplay->top;
- abd.rc.bottom = rcDisplay->bottom;
- if (g_CluiData.fDocked == DOCKED_LEFT) {
- abd.rc.right = rcDisplay->left + abd.rc.right - abd.rc.left;
- abd.rc.left = rcDisplay->left;
- }
- else {
- abd.rc.left = rcDisplay->right - (abd.rc.right - abd.rc.left);
- abd.rc.right = rcDisplay->right;
-
- }
- SHAppBarMessage(ABM_SETPOS, &abd);
- *rc = abd.rc;
-}
-
-int Docking_IsDocked(WPARAM, LPARAM)
-{
- return g_CluiData.fDocked;
-}
-
-int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
-{
- APPBARDATA abd;
- static int draggingTitle;
- MSG *msg = (MSG*)wParam;
-
- if (msg->message == WM_DESTROY)
- g_plugin.setByte("Docked", (uint8_t)g_CluiData.fDocked);
-
- if (!g_CluiData.fDocked && msg->message != WM_CREATE && msg->message != WM_MOVING && msg->message != WM_CREATEDOCKED && msg->message != WM_MOVE && msg->message != WM_SIZE) return 0;
- switch (msg->message) {
- case WM_CREATE:
- //if (GetSystemMetrics(SM_CMONITORS)>1) return 0;
- if (g_plugin.getByte("Docked", 0) && db_get_b(0, "CLUI", "DockToSides", SETTING_DOCKTOSIDES_DEFAULT))
- {
- PostMessage(msg->hwnd, WM_CREATEDOCKED, 0, 0);
- }
- draggingTitle = 0;
- return 0;
-
- case WM_CREATEDOCKED:
- //we need to post a message just after creation to let main message function do some work
- g_CluiData.fDocked = (BOOL)g_plugin.getByte("Docked", 0);
- if (IsWindowVisible(msg->hwnd) && !IsIconic(msg->hwnd)) {
- RECT rc, rcMonitor;
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- abd.lParam = 0;
- abd.uCallbackMessage = WM_DOCKCALLBACK;
- SHAppBarMessage(ABM_NEW, &abd);
- GetWindowRect(msg->hwnd, &rc);
- Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rc);
- MoveWindow(msg->hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE);
- g_CluiData.mutexPreventDockMoving = 0;
- Sync(CLUIFrames_OnMoving, msg->hwnd, &rc);
- g_CluiData.mutexPreventDockMoving = 1;
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
- }
- break;
- case WM_CAPTURECHANGED:
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
- return 0;
- case WM_ACTIVATE:
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_ACTIVATE, &abd);
- return 0;
- case WM_SIZE:
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_REDRAW_ALL, nullptr);
- return 0;
-
- case WM_WINDOWPOSCHANGED:
- {
- if (g_CluiData.fDocked)
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
- return 0;
- }
- case WM_MOVING:
- {
- RECT rcMonitor;
- RECT rcWindow;
- RECT *rc;
- int dx = 0;
- POINT ptCursor;
- if (g_CluiData.fDocked) return 0;
-
- // GetMessagePos() is no good, position is always unsigned
- GetCursorPos(&ptCursor);
- GetWindowRect(msg->hwnd, &rcWindow);
- dock_drag_dx = rcWindow.left - ptCursor.x;
- dock_drag_dy = rcWindow.top - ptCursor.y;
- Docking_GetMonitorRectFromPoint(ptCursor, &rcMonitor);
-
- if (((ptCursor.x < rcMonitor.left + EDGESENSITIVITY)
- || (ptCursor.x >= rcMonitor.right - EDGESENSITIVITY))
- && db_get_b(0, "CLUI", "DockToSides", SETTING_DOCKTOSIDES_DEFAULT))
- {
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- abd.lParam = 0;
- abd.uCallbackMessage = WM_DOCKCALLBACK;
- SHAppBarMessage(ABM_NEW, &abd);
- if (ptCursor.x < rcMonitor.left + EDGESENSITIVITY) g_CluiData.fDocked = DOCKED_LEFT;
- else g_CluiData.fDocked = DOCKED_RIGHT;
- // TempDock = 1;
- GetWindowRect(msg->hwnd, (LPRECT)msg->lParam);
- rc = (RECT*)msg->lParam;
- if (g_CluiData.fDocked == DOCKED_RIGHT)
- dx = (rc->right > rcMonitor.right) ? rc->right - rcMonitor.right : 0;
- else
- dx = (rc->left < rcMonitor.left) ? rc->left - rcMonitor.left : 0;
- OffsetRect(rc, -dx, 0);
- Docking_AdjustPosition(msg->hwnd, (LPRECT)&rcMonitor, (LPRECT)msg->lParam);
- SendMessage(msg->hwnd, WM_SIZE, 0, 0);
- g_CluiData.mutexPreventDockMoving = 0;
- Sync(CLUIFrames_OnMoving, msg->hwnd, (LPRECT)msg->lParam);
- g_CluiData.mutexPreventDockMoving = 1;
- mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
- g_plugin.setByte("Docked", (uint8_t)g_CluiData.fDocked);
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
- return TRUE;
- }
- return 0;
- }
- case WM_EXITSIZEMOVE:
- {
- RECT rcMonitor;
- RECT rcWindow;
- if (TempDock) TempDock = 0;
- GetWindowRect(msg->hwnd, &rcWindow);
- Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rcWindow);
- *((LRESULT*)lParam) = TRUE;
- g_CluiData.mutexPreventDockMoving = 0;
- SetWindowPos(msg->hwnd, nullptr, rcWindow.left, rcWindow.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOSENDCHANGING);
- Sync(CLUIFrames_OnMoving, msg->hwnd, &rcWindow);
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);// -= -= -=
- g_CluiData.mutexPreventDockMoving = 1;
- return 1;
- }
-
- case WM_MOVE:
- {
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_ALT_DRAW, nullptr);
- return 0;
- }
- case WM_SIZING:
- {
- if (g_CluiData.fDocked) ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
- return FALSE;
- }
- case WM_SHOWWINDOW:
- {
- if (msg->lParam)
- return 0;
- if ((msg->wParam && g_CluiData.fDocked < 0) || (!msg->wParam && g_CluiData.fDocked>0))
- g_CluiData.fDocked = -g_CluiData.fDocked;
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- if (msg->wParam) {
- RECT rc, rcMonitor;
- Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
- abd.lParam = 0;
- abd.uCallbackMessage = WM_DOCKCALLBACK;
- SHAppBarMessage(ABM_NEW, &abd);
- GetWindowRect(msg->hwnd, &rc);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rc);
- MoveWindow(msg->hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, FALSE);
- Sync(CLUIFrames_OnMoving, msg->hwnd, &rc);
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);// -= -= -=
- }
- else {
- SHAppBarMessage(ABM_REMOVE, &abd);
- }
- }
- return 0;
- case WM_NCHITTEST:
- { LONG result;
- result = DefWindowProc(msg->hwnd, WM_NCHITTEST, msg->wParam, msg->lParam);
- if (result == HTSIZE || result == HTTOP || result == HTTOPLEFT || result == HTTOPRIGHT ||
- result == HTBOTTOM || result == HTBOTTOMRIGHT || result == HTBOTTOMLEFT) {
- *((LRESULT*)lParam) = HTCLIENT; return TRUE;
- }
- if (g_CluiData.fDocked == DOCKED_LEFT && result == HTLEFT) { *((LRESULT*)lParam) = HTCLIENT; return TRUE; }
- if (g_CluiData.fDocked == DOCKED_RIGHT && result == HTRIGHT) { *((LRESULT*)lParam) = HTCLIENT; return TRUE; }
-
-
- return 0;
- }
- case WM_SYSCOMMAND:
- if ((msg->wParam & 0xFFF0) != SC_MOVE) return 0;
- SetActiveWindow(msg->hwnd);
- SetCapture(msg->hwnd);
- draggingTitle = 1;
- *((LRESULT*)lParam) = 0;
- return TRUE;
- case WM_MOUSEMOVE:
-
- if (!draggingTitle) return 0;
- { RECT rc;
- POINT pt;
- GetClientRect(msg->hwnd, &rc);
- if (((g_CluiData.fDocked == DOCKED_LEFT || g_CluiData.fDocked == -DOCKED_LEFT) && (short)LOWORD(msg->lParam) > rc.right) ||
- ((g_CluiData.fDocked == DOCKED_RIGHT || g_CluiData.fDocked == -DOCKED_RIGHT) && (short)LOWORD(msg->lParam) < 0)) {
- ReleaseCapture();
- draggingTitle = 0;
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_REMOVE, &abd);
- g_CluiData.fDocked = 0;
- GetCursorPos(&pt);
- PostMessage(msg->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(pt.x, pt.y));
- SetWindowPos(msg->hwnd, nullptr, pt.x - rc.right / 2, pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2, g_plugin.getDword("Width", 0), g_plugin.getDword("Height", 0), SWP_NOZORDER);
- g_plugin.setByte("Docked", (uint8_t)g_CluiData.fDocked);
- // ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
- }
- return 1;
- }
- case WM_LBUTTONUP:
- if (draggingTitle) {
- ReleaseCapture();
- draggingTitle = 0;
- }
- return 0;
- case WM_DOCKCALLBACK:
- switch (msg->wParam) {
- case ABN_WINDOWARRANGE:
- CLUI_ShowWindowMod(msg->hwnd, msg->lParam ? SW_HIDE : SW_SHOW);
- {
-
- RECT rc, rcMonitor;
- Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
- GetWindowRect(msg->hwnd, &rc);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rc);
- Sync(CLUIFrames_OnMoving, msg->hwnd, &rc); // -= -= -=
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
-
- g_CluiData.mutexPreventDockMoving = 1;
- }
- break;
- }
- return TRUE;
- case WM_DESTROY:
- if (g_CluiData.fDocked > 0) {
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_REMOVE, &abd);
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
- }
- return 0;
- }
- return 0;
-}
diff --git a/plugins/Clist_modern/src/modern_global_structure.h b/plugins/Clist_modern/src/modern_global_structure.h
index 689d06b7de..28cd3507a8 100644
--- a/plugins/Clist_modern/src/modern_global_structure.h
+++ b/plugins/Clist_modern/src/modern_global_structure.h
@@ -44,7 +44,6 @@ struct CLUIDATA
bool bEventAreaEnabled;
bool bNotifyActive;
bool fDisableSkinEngine;
- bool fOnDesktop;
bool fSmoothAnimation;
bool fLayered;
bool fSortOfflineBottom;
diff --git a/plugins/Clist_modern/src/modern_static_clui.h b/plugins/Clist_modern/src/modern_static_clui.h
index 891dcf53f3..475d389997 100644
--- a/plugins/Clist_modern/src/modern_static_clui.h
+++ b/plugins/Clist_modern/src/modern_static_clui.h
@@ -62,7 +62,7 @@ int CListMod_HideWindow(HWND hwndContactList, int mode);
int CLUIServices_LoadModule(void);
INT_PTR CLUIServices_SortList(WPARAM wParam, LPARAM lParam);
-void Docking_GetMonitorRectFromWindow(HWND hWnd, RECT *rc);
+void GetMonitorRectFromWindow(HWND hWnd, RECT *rc);
int EventArea_Create(HWND hCluiWnd);
diff --git a/plugins/Clist_modern/src/modern_utils.cpp b/plugins/Clist_modern/src/modern_utils.cpp
index 2cea1b9a1a..2210a2c3ab 100644
--- a/plugins/Clist_modern/src/modern_utils.cpp
+++ b/plugins/Clist_modern/src/modern_utils.cpp
@@ -62,3 +62,27 @@ BOOL DestroyIcon_protect(HICON icon)
if (icon) return DestroyIcon(icon);
return FALSE;
}
+
+void GetMonitorRectFromWindow(HWND hWnd, RECT *rc)
+{
+ POINT pt;
+ GetWindowRect(hWnd, rc);
+ pt.x = rc->left;
+ pt.y = rc->top;
+
+ MONITORINFO monitorInfo;
+ HMONITOR hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST); // always returns a valid value
+ monitorInfo.cbSize = sizeof(MONITORINFO);
+
+ if (GetMonitorInfoW(hMonitor, &monitorInfo)) {
+ memcpy(rc, &monitorInfo.rcMonitor, sizeof(RECT));
+ return;
+ }
+
+ // "generic" win95/NT support, also serves as failsafe
+ rc->left = 0;
+ rc->top = 0;
+ rc->bottom = GetSystemMetrics(SM_CYSCREEN);
+ rc->right = GetSystemMetrics(SM_CXSCREEN);
+
+}
diff --git a/plugins/Clist_modern/src/resource.h b/plugins/Clist_modern/src/resource.h
index 8e46e99484..7fd519e3a3 100644
--- a/plugins/Clist_modern/src/resource.h
+++ b/plugins/Clist_modern/src/resource.h
@@ -250,7 +250,6 @@
#define IDC_HILIGHTMODE2 1659
#define IDC_HILIGHTMODE1 1660
#define IDC_HILIGHTMODE3 1661
-#define IDC_ONDESKTOP 1662
#define IDC_HILIGHTMODE4 1663
#define IDC_USECONNECTINGICON 1761
#define IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK 1761
diff --git a/plugins/Clist_nicer/clist_nicer.vcxproj b/plugins/Clist_nicer/clist_nicer.vcxproj
index ddd953463b..4aaf9f33d3 100644
--- a/plugins/Clist_nicer/clist_nicer.vcxproj
+++ b/plugins/Clist_nicer/clist_nicer.vcxproj
@@ -97,7 +97,6 @@
<ClCompile Include="src\contact.cpp" />
<ClCompile Include="src\coolsblib.cpp" />
<ClCompile Include="src\coolscroll.cpp" />
- <ClCompile Include="src\Docking.cpp" />
<ClCompile Include="src\extBackg.cpp" />
<ClCompile Include="src\groupmenu.cpp" />
<ClCompile Include="src\init.cpp" />
diff --git a/plugins/Clist_nicer/clist_nicer.vcxproj.filters b/plugins/Clist_nicer/clist_nicer.vcxproj.filters
index 1dcfb14ca5..cfbf35fa34 100644
--- a/plugins/Clist_nicer/clist_nicer.vcxproj.filters
+++ b/plugins/Clist_nicer/clist_nicer.vcxproj.filters
@@ -68,9 +68,6 @@
<ClCompile Include="src\coolscroll.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\Docking.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\extBackg.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/plugins/Clist_nicer/res/resource.rc b/plugins/Clist_nicer/res/resource.rc
index 7311258a93..5a8bc95314 100644
--- a/plugins/Clist_nicer/res/resource.rc
+++ b/plugins/Clist_nicer/res/resource.rc
@@ -209,7 +209,6 @@ BEGIN
COMBOBOX IDC_BORDERSTYLE,62,60,64,56,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
LTEXT "Title bar text:",IDC_STATIC,11,80,51,8
EDITTEXT IDC_TITLETEXT,62,79,64,12,ES_AUTOHSCROLL
- CONTROL "Pin to desktop",IDC_ONDESKTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,96,128,10
CONTROL "Show drop shadow (restart required)",IDC_DROPSHADOW,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,108,138,10
CONTROL "Hide contact list after it has been idle for",IDC_AUTOHIDE,
diff --git a/plugins/Clist_nicer/src/Docking.cpp b/plugins/Clist_nicer/src/Docking.cpp
deleted file mode 100644
index 71ba8ee99f..0000000000
--- a/plugins/Clist_nicer/src/Docking.cpp
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (C) 2012-25 Miranda NG team (https://miranda-ng.org),
-Copyright (c) 2000-03 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "stdafx.h"
-
-#define WM_DOCKCALLBACK (WM_USER+121)
-#define WM_CREATEDOCKED (WM_USER+122)
-#define EDGESENSITIVITY 3
-
-#define DOCKED_NONE 0
-#define DOCKED_LEFT 1
-#define DOCKED_RIGHT 2
-int g_iDocked;
-
-extern RECT cluiPos;
-
-static void Docking_GetMonitorRectFromPoint(POINT pt, RECT *rc)
-{
- MONITORINFO monitorInfo;
- HMONITOR hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST); // always returns a valid value
- monitorInfo.cbSize = sizeof(MONITORINFO);
-
- if (GetMonitorInfo(hMonitor, &monitorInfo)) {
- memcpy(rc, &monitorInfo.rcMonitor, sizeof(RECT));
- return;
- }
-
- // "generic" win95/NT support, also serves as failsafe
- rc->left = 0;
- rc->top = 0;
- rc->bottom = GetSystemMetrics(SM_CYSCREEN);
- rc->right = GetSystemMetrics(SM_CXSCREEN);
-}
-
-static void Docking_GetMonitorRectFromWindow(HWND hWnd, RECT *rc)
-{
- POINT ptWindow;
- GetWindowRect(hWnd, rc);
- ptWindow.x = rc->left;
- ptWindow.y = rc->top;
- Docking_GetMonitorRectFromPoint(ptWindow, rc);
-}
-
-static void Docking_AdjustPosition(HWND hwnd, RECT *rcDisplay, RECT *rc)
-{
- APPBARDATA abd;
-
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = hwnd;
- abd.uEdge = g_iDocked == DOCKED_LEFT ? ABE_LEFT : ABE_RIGHT;
- abd.rc = *rc;
- abd.rc.top = rcDisplay->top;
- abd.rc.bottom = rcDisplay->bottom;
- if (g_iDocked == DOCKED_LEFT) {
- abd.rc.right = rcDisplay->left + (abd.rc.right - abd.rc.left) - cfg::dat.bClipBorder;
- abd.rc.left = rcDisplay->left - cfg::dat.bClipBorder;
- }
- else {
- abd.rc.left = rcDisplay->right - (abd.rc.right - abd.rc.left) + cfg::dat.bClipBorder;
- abd.rc.right = rcDisplay->right + cfg::dat.bClipBorder;
- }
- SHAppBarMessage(ABM_SETPOS, &abd);
- *rc = abd.rc;
-}
-
-int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
-{
- APPBARDATA abd;
- static int draggingTitle;
- MSG *msg = (MSG *)wParam;
-
- if (msg->message == WM_DESTROY)
- g_plugin.setByte("Docked", (uint8_t)g_iDocked);
- if (!g_iDocked && msg->message != WM_CREATE && msg->message != WM_MOVING && msg->message != WM_CREATEDOCKED && msg->message != WM_MOVE)
- return 0;
-
- switch (msg->message) {
- case WM_CREATE:
- //if (GetSystemMetrics(SM_CMONITORS)>1) return 0;
- if (g_plugin.getByte("Docked", 0))
- PostMessage(msg->hwnd, WM_CREATEDOCKED, 0, 0);
- draggingTitle = 0;
- return 0;
-
- case WM_CREATEDOCKED:
- //we need to post a message just after creation to let main message function do some work
- g_iDocked = (int)(char)g_plugin.getByte("Docked", 0);
- if (IsWindowVisible(msg->hwnd) && !IsIconic(msg->hwnd)) {
- RECT rc, rcMonitor;
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- abd.lParam = 0;
- abd.uCallbackMessage = WM_DOCKCALLBACK;
- SHAppBarMessage(ABM_NEW, &abd);
- GetWindowRect(msg->hwnd, &rc);
- Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rc);
- MoveWindow(msg->hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE);
- }
- break;
-
- case WM_ACTIVATE:
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_ACTIVATE, &abd);
- return 0;
-
- case WM_WINDOWPOSCHANGED:
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_WINDOWPOSCHANGED, &abd);
- return 0;
-
- case WM_MOVING:
- {
- RECT rcMonitor;
- POINT ptCursor;
-
- // stop early
- if (GetAsyncKeyState(VK_CONTROL) & 0x8000)
- return 0;
-
- // GetMessagePos() is no good, position is always unsigned
- GetCursorPos(&ptCursor);
- Docking_GetMonitorRectFromPoint(ptCursor, &rcMonitor);
-
- if ((ptCursor.x < rcMonitor.left + EDGESENSITIVITY) || (ptCursor.x >= rcMonitor.right - EDGESENSITIVITY)) {
- if (!(GetWindowLongPtr(msg->hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW)) {
- SendMessage(msg->hwnd, CLUIINTM_REDRAW, 0, 0);
- MessageBox(nullptr, TranslateT("The contact list cannot be docked when using the default title bar and border. Use a toolwindow or borderless style instead."),
- TranslateT("Contact list docking"), MB_OK);
- return 0;
- }
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- abd.lParam = 0;
- abd.uCallbackMessage = WM_DOCKCALLBACK;
- SHAppBarMessage(ABM_NEW, &abd);
- if (ptCursor.x < rcMonitor.left + EDGESENSITIVITY)
- g_iDocked = DOCKED_LEFT;
- else
- g_iDocked = DOCKED_RIGHT;
- SendMessage(msg->hwnd, WM_LBUTTONUP, 0, MAKELPARAM(ptCursor.x, ptCursor.y));
- GetWindowRect(msg->hwnd, (LPRECT)msg->lParam);
- Docking_AdjustPosition(msg->hwnd, (LPRECT)&rcMonitor, (LPRECT)msg->lParam);
- PostMessage(msg->hwnd, CLUIINTM_REDRAW, 0, 0);
- return TRUE;
- }
- }
- return 0;
-
- case WM_MOVE:
- if (g_iDocked) {
- RECT rc, rcMonitor;
- Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
- GetWindowRect(msg->hwnd, &rc);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rc);
- MoveWindow(msg->hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE);
- return 1;
- }
- return 0;
-
- case WM_SIZING:
- {
- RECT rcMonitor;
- Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, (LPRECT)msg->lParam);
- *((LRESULT *)lParam) = TRUE;
- }
- return TRUE;
-
- case WM_SHOWWINDOW:
- if (msg->lParam)
- return 0;
- if ((msg->wParam && g_iDocked < 0) || (!msg->wParam && g_iDocked > 0))
- g_iDocked = -g_iDocked;
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- if (msg->wParam) {
- RECT rc, rcMonitor;
- Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
- abd.lParam = 0;
- abd.uCallbackMessage = WM_DOCKCALLBACK;
- SHAppBarMessage(ABM_NEW, &abd);
- GetWindowRect(msg->hwnd, &rc);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rc);
- MoveWindow(msg->hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, FALSE);
- }
- else SHAppBarMessage(ABM_REMOVE, &abd);
- return 0;
-
- case WM_NCHITTEST:
- {
- LONG result = DefWindowProc(msg->hwnd, WM_NCHITTEST, msg->wParam, msg->lParam);
- if (result == HTSIZE || result == HTTOP || result == HTTOPLEFT || result == HTTOPRIGHT || result == HTBOTTOM || result == HTBOTTOMRIGHT || result == HTBOTTOMLEFT) {
- *((LRESULT *)lParam) = HTCLIENT; return TRUE;
- }
- if (g_iDocked == DOCKED_LEFT && result == HTLEFT) {
- *((LRESULT *)lParam) = HTCLIENT; return TRUE;
- }
- if (g_iDocked == DOCKED_RIGHT && result == HTRIGHT) {
- *((LRESULT *)lParam) = HTCLIENT; return TRUE;
- }
- }
- return 0;
-
- case WM_SYSCOMMAND:
- if ((msg->wParam & 0xFFF0) != SC_MOVE)
- return 0;
- SetActiveWindow(msg->hwnd);
- SetCapture(msg->hwnd);
- draggingTitle = 1;
- *((LRESULT *)lParam) = 0;
- return TRUE;
-
- case WM_MOUSEMOVE:
- if (!draggingTitle)
- return 0; {
- RECT rc;
- POINT pt;
- GetClientRect(msg->hwnd, &rc);
- if (((g_iDocked == DOCKED_LEFT || g_iDocked == -DOCKED_LEFT) && (short)LOWORD(msg->lParam) > rc.right) || ((g_iDocked == DOCKED_RIGHT || g_iDocked == -DOCKED_RIGHT) && (short)LOWORD(msg->lParam) < 0)) {
- ReleaseCapture();
- draggingTitle = 0;
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_REMOVE, &abd);
- g_iDocked = 0;
- GetCursorPos(&pt);
- PostMessage(msg->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(pt.x, pt.y));
- SetWindowPos(msg->hwnd, nullptr, pt.x - rc.right / 2, pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2, cluiPos.right, cluiPos.bottom, SWP_NOZORDER);
- }
- }
- return 1;
-
- case WM_LBUTTONUP:
- if (draggingTitle) {
- ReleaseCapture();
- draggingTitle = 0;
- }
- return 0;
-
- case WM_DOCKCALLBACK:
- switch (msg->wParam) {
- case ABN_WINDOWARRANGE:
- ShowWindow(msg->hwnd, msg->lParam ? SW_HIDE : SW_SHOW);
- break;
- }
- return TRUE;
-
- case WM_DESTROY:
- if (g_iDocked > 0) {
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_REMOVE, &abd);
- }
- return 0;
- }
- return 0;
-}
diff --git a/plugins/Clist_nicer/src/clc.h b/plugins/Clist_nicer/src/clc.h
index 42af57eb1b..38bceff19f 100644
--- a/plugins/Clist_nicer/src/clc.h
+++ b/plugins/Clist_nicer/src/clc.h
@@ -422,9 +422,6 @@ void CluiProtocolStatusChanged(int, const char*);
void LoadSkinItemToCache(struct TExtraCache *cEntry);
-// Docking.c
-extern int g_iDocked;
-
// Buttons
#define BUTTONSETIMLICON (WM_USER+20)
diff --git a/plugins/Clist_nicer/src/clistopts.cpp b/plugins/Clist_nicer/src/clistopts.cpp
index 1b8dca6242..fdc192cd6b 100644
--- a/plugins/Clist_nicer/src/clistopts.cpp
+++ b/plugins/Clist_nicer/src/clistopts.cpp
@@ -305,7 +305,6 @@ public:
CheckDlgButton(m_hwnd, IDC_ALWAYSHIDEONTASKBAR, g_plugin.getByte("AlwaysHideOnTB", 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwnd, IDC_FADEINOUT, cfg::dat.fadeinout ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwnd, IDC_DROPSHADOW, g_plugin.getByte("WindowShadow", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(m_hwnd, IDC_ONDESKTOP, g_plugin.getByte("OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED);
chkAutoSize.SetState(cfg::dat.autosize);
@@ -446,7 +445,7 @@ public:
Clist::iAlpha = cfg::dat.alpha = SendDlgItemMessage(m_hwnd, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0);
Clist::iAutoAlpha = cfg::dat.autoalpha = SendDlgItemMessage(m_hwnd, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0);
g_plugin.setByte("WindowShadow", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_DROPSHADOW));
- g_plugin.setByte("OnDesktop", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_ONDESKTOP));
+
db_set_dw(0, "CLUI", "Frameflags", cfg::dat.dwFlags);
cfg::dat.bFullTransparent = IsDlgButtonChecked(m_hwnd, IDC_FULLTRANSPARENT) ? 1 : 0;
db_set_b(0, "CLUI", "fulltransparent", (uint8_t)cfg::dat.bFullTransparent);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index 0cff6042ec..e662e6ba63 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -576,8 +576,6 @@ static void sttProcessResize(HWND hwnd, NMCLISTCONTROL *nmc)
if (!db_get_b(0, "CLUI", "AutoSize", 0))
return;
- if (g_iDocked)
- return;
if (hFrameContactTree == 0)
return;
@@ -948,15 +946,14 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
}
if (cfg::dat.bClipBorder != 0 || cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME) {
- int docked = Clist_IsDocked();
int clip = cfg::dat.bClipBorder;
if (!g_CLUISkinnedBkColor)
FillRect(hdc, &rcClient, cfg::dat.hBrushColorKey);
if (cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME)
- rgn = CreateRoundRectRgn(clip, docked ? 0 : clip, rcClient.right - clip + 1, rcClient.bottom - (docked ? 0 : clip - 1), 8 + clip, 8 + clip);
+ rgn = CreateRoundRectRgn(clip, clip, rcClient.right - clip + 1, rcClient.bottom - (clip - 1), 8 + clip, 8 + clip);
else
- rgn = CreateRectRgn(clip, docked ? 0 : clip, rcClient.right - clip, rcClient.bottom - (docked ? 0 : clip));
+ rgn = CreateRectRgn(clip, clip, rcClient.right - clip, rcClient.bottom - clip);
SelectClipRgn(hdc, rgn);
}
@@ -1034,9 +1031,6 @@ skipbg:
break;
case WM_WINDOWPOSCHANGED:
- if (g_iDocked)
- break;
-
case WM_WINDOWPOSCHANGING:
if (g_clistApi.hwndContactList != nullptr) {
WINDOWPOS *wp = (WINDOWPOS *)lParam;
@@ -1077,8 +1071,7 @@ skipbg:
return 0;
case WM_SIZE:
- if ((wParam == 0 && lParam == 0) || g_iDocked) {
-
+ if (wParam == 0 && lParam == 0) {
if (IsZoomed(hwnd))
ShowWindow(hwnd, SW_SHOWNORMAL);
@@ -1099,22 +1092,18 @@ skipbg:
case WM_MOVE:
if (!IsIconic(hwnd)) {
GetWindowRect(hwnd, &rc);
-
- if (!g_iDocked) {
- cluiPos.bottom = (uint32_t)(rc.bottom - rc.top);
- cluiPos.left = rc.left;
- cluiPos.top = rc.top;
- }
+ cluiPos.bottom = (uint32_t)(rc.bottom - rc.top);
+ cluiPos.left = rc.left;
+ cluiPos.top = rc.top;
cluiPos.right = rc.right - rc.left;
+
if (cfg::dat.realTimeSaving) {
GetWindowRect(hwnd, &rc);
// if docked, dont remember pos (except for width)
- if (!Clist_IsDocked()) {
- g_plugin.setDword("Height", (uint32_t)(rc.bottom - rc.top));
- g_plugin.setDword("x", (uint32_t)rc.left);
- g_plugin.setDword("y", (uint32_t)rc.top);
- }
+ g_plugin.setDword("Height", (uint32_t)(rc.bottom - rc.top));
+ g_plugin.setDword("x", (uint32_t)rc.left);
+ g_plugin.setDword("y", (uint32_t)rc.top);
g_plugin.setDword("Width", (uint32_t)(rc.right - rc.left));
}
}
diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp
index 81d68a682e..9c09cec1f6 100644
--- a/plugins/Clist_nicer/src/cluiframes.cpp
+++ b/plugins/Clist_nicer/src/cluiframes.cpp
@@ -1206,13 +1206,10 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam, LPARAM)
// do not collapse/uncollapse client/locked/invisible frames
if (Frames[FrameId].align == alClient && !(Frames[FrameId].Locked || (!Frames[FrameId].visible) || Frames[FrameId].floating)) {
- RECT rc;
- if (Clist_IsDocked())
- return 0;
-
if (db_get_b(0, "CLUI", "AutoSize", 0))
return 0;
+ RECT rc;
GetWindowRect(g_clistApi.hwndContactList, &rc);
if (Frames[FrameId].collapsed == TRUE) {
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp
index 4ec2a18cc0..2012338e90 100644
--- a/plugins/Clist_nicer/src/init.cpp
+++ b/plugins/Clist_nicer/src/init.cpp
@@ -34,7 +34,6 @@ CLIST_INTERFACE coreCli;
extern HICON overlayicons[10];
-int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam);
int SetHideOffline(int iValue);
ClcContact *CreateClcContact(void);
@@ -176,7 +175,6 @@ int CMPlugin::Load()
g_clistApi.pfnCluiProtocolStatusChanged = CluiProtocolStatusChanged;
g_clistApi.pfnCompareContacts = CompareContacts;
g_clistApi.pfnCreateClcContact = CreateClcContact;
- g_clistApi.pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage;
g_clistApi.pfnGetContactHiddenStatus = CLVM_GetContactHiddenStatus;
g_clistApi.pfnGetDefaultFontSetting = GetDefaultFontSetting;
g_clistApi.pfnGetRowBottomY = RowHeight::getItemBottomY;
diff --git a/plugins/Clist_nicer/src/resource.h b/plugins/Clist_nicer/src/resource.h
index c67d6c1ceb..259646b7fc 100644
--- a/plugins/Clist_nicer/src/resource.h
+++ b/plugins/Clist_nicer/src/resource.h
@@ -193,7 +193,6 @@
#define IDC_RELOAD 1635
#define IDC_IGN_ADDPERMANENTLY 1635
#define IDC_DSP_LOADDEFAULT 1636
-#define IDC_ONDESKTOP 1657
#define IDC_WINCOLOUR 1659
#define IDC_APPLYLASTVIEWMODE 1661
#define IDC_IGNORESELFORGROUPS 1722
diff --git a/plugins/StatusManager/src/ss_main.cpp b/plugins/StatusManager/src/ss_main.cpp
index 8820699781..52d704d42e 100644
--- a/plugins/StatusManager/src/ss_main.cpp
+++ b/plugins/StatusManager/src/ss_main.cpp
@@ -388,7 +388,7 @@ int SSModuleLoaded(WPARAM, LPARAM)
WINDOWPLACEMENT wndpl = { sizeof(wndpl) };
if (GetWindowPlacement(hClist, &wndpl)) {
- if (wndpl.showCmd == SW_SHOWNORMAL && !Clist_IsDocked()) {
+ if (wndpl.showCmd == SW_SHOWNORMAL) {
RECT rc;
if (GetWindowRect(hClist, &rc)) {
int x = rc.left;
diff --git a/src/core/stdclist/res/resource.rc b/src/core/stdclist/res/resource.rc
index ce968e2919..5e6578915c 100644
--- a/src/core/stdclist/res/resource.rc
+++ b/src/core/stdclist/res/resource.rc
@@ -79,7 +79,7 @@ BEGIN
EDITTEXT IDC_TITLETEXT,63,100,72,12,ES_AUTOHSCROLL
CONTROL "Show drop shadow (restart required)",IDC_DROPSHADOW,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,117,138,10
- CONTROL "Pin to desktop",IDC_ONDESKTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,131,128,10
+
CONTROL "Hide contact list after it has been idle for",IDC_AUTOHIDE,
"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,141,18,162,10
EDITTEXT IDC_HIDETIME,151,32,30,12,ES_RIGHT | ES_NUMBER
diff --git a/src/core/stdclist/src/cluiopts.cpp b/src/core/stdclist/src/cluiopts.cpp
index 61d5baca69..46b341e853 100644
--- a/src/core/stdclist/src/cluiopts.cpp
+++ b/src/core/stdclist/src/cluiopts.cpp
@@ -48,7 +48,6 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
CheckDlgButton(hwndDlg, IDC_FADEINOUT, db_get_b(0, "CLUI", "FadeInOut", 0));
CheckDlgButton(hwndDlg, IDC_AUTOSIZE, db_get_b(0, "CLUI", "AutoSize", 0));
CheckDlgButton(hwndDlg, IDC_DROPSHADOW, g_plugin.getByte("WindowShadow", 0));
- CheckDlgButton(hwndDlg, IDC_ONDESKTOP, g_plugin.getByte("OnDesktop", 0));
CheckDlgButton(hwndDlg, IDC_DISABLEDOCKING, db_get_b(0, "CLUI", "DockToSides", 1));
SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETRANGE, 0, MAKELONG(100, 0));
SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETPOS, 0, db_get_b(0, "CLUI", "MaxSizeHeight", 75));
@@ -157,7 +156,6 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
Clist::iAlpha = SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0);
Clist::iAutoAlpha = SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0);
g_plugin.setByte("WindowShadow", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW));
- g_plugin.setByte("OnDesktop", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
db_set_b(0, "CLUI", "DockToSides", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DISABLEDOCKING));
Clist::bShowCaption = IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION);
Clist::bShowMainMenu = IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU);
@@ -186,15 +184,10 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
SetWindowPlacement(g_clistApi.hwndContactList, &p);
}
else
- SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW | WS_EX_APPWINDOW);
+ SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE,
+ GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW | WS_EX_APPWINDOW);
- if (IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)) {
- HWND hProgMan = FindWindow(L"Progman", nullptr);
- if (hProgMan)
- SetParent(g_clistApi.hwndContactList, hProgMan);
- }
- else
- SetParent(g_clistApi.hwndContactList, nullptr);
+ SetParent(g_clistApi.hwndContactList, nullptr);
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)) {
int style = GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
diff --git a/src/core/stdclist/src/resource.h b/src/core/stdclist/src/resource.h
index 6e4960668e..f925adfa1c 100644
--- a/src/core/stdclist/src/resource.h
+++ b/src/core/stdclist/src/resource.h
@@ -114,7 +114,6 @@
#define IDC_DROPSHADOW 1612
#define IDC_SHOWGRIP 1612
#define IDC_NOSCROLLBAR 1613
-#define IDC_ONDESKTOP 1657
#define IDC_DISABLEDOCKING 1658
#define IDC_WINCOLOUR 1659
#define IDC_MOVE_OFFLINE_BOTTOM 1662
diff --git a/src/mir_app/mir_app.vcxproj b/src/mir_app/mir_app.vcxproj
index 8ba67cd5d1..b9afb141b1 100644
--- a/src/mir_app/mir_app.vcxproj
+++ b/src/mir_app/mir_app.vcxproj
@@ -68,7 +68,6 @@
<ExceptionHandling>false</ExceptionHandling>
<DisableSpecificWarnings>4652;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
- <ClCompile Include="src\Docking.cpp" />
<ClCompile Include="src\ei_baseIcon.cpp" />
<ClCompile Include="src\ei_callbackIcon.cpp" />
<ClCompile Include="src\ei_defaulticons.cpp" />
diff --git a/src/mir_app/mir_app.vcxproj.filters b/src/mir_app/mir_app.vcxproj.filters
index 554aeccc7d..8a0de1ff64 100644
--- a/src/mir_app/mir_app.vcxproj.filters
+++ b/src/mir_app/mir_app.vcxproj.filters
@@ -365,9 +365,6 @@
<ClCompile Include="src\movetogroup.cpp">
<Filter>Source Files\Contact list</Filter>
</ClCompile>
- <ClCompile Include="src\Docking.cpp">
- <Filter>Source Files\Contact list</Filter>
- </ClCompile>
<ClCompile Include="src\CMPluginBase.cpp">
<Filter>Source Files\Plugins</Filter>
</ClCompile>
diff --git a/src/mir_app/src/Docking.cpp b/src/mir_app/src/Docking.cpp
deleted file mode 100644
index 9012b09568..0000000000
--- a/src/mir_app/src/Docking.cpp
+++ /dev/null
@@ -1,363 +0,0 @@
-/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (C) 2012-25 Miranda NG team (https://miranda-ng.org),
-Copyright (c) 2000-12 Miranda IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "stdafx.h"
-#include "clc.h"
-
-#define WM_DOCKCALLBACK (WM_USER+121)
-#define EDGESENSITIVITY 3
-
-#define DOCKED_NONE 0
-#define DOCKED_LEFT 1
-#define DOCKED_RIGHT 2
-
-static int docked;
-static POINT dockPos;
-
-static void Docking_GetMonitorRectFromPoint(LPPOINT pt, LPRECT rc)
-{
- MONITORINFO monitorInfo;
- HMONITOR hMonitor = MonitorFromPoint(*pt, MONITOR_DEFAULTTONEAREST); // always returns a valid value
- monitorInfo.cbSize = sizeof(monitorInfo);
-
- if (GetMonitorInfo(hMonitor, &monitorInfo)) {
- *rc = monitorInfo.rcMonitor;
- return;
- }
-
- // "generic" win95/NT support, also serves as failsafe
- rc->left = 0;
- rc->top = 0;
- rc->bottom = GetSystemMetrics(SM_CYSCREEN);
- rc->right = GetSystemMetrics(SM_CXSCREEN);
-}
-
-static void Docking_RectToDock(LPRECT rc)
-{
- rc->right += dockPos.x - rc->left;
- rc->left = dockPos.x;
- rc->bottom += dockPos.y - rc->top;
- rc->top = dockPos.y;
-}
-
-static void Docking_PosCommand(HWND hwnd, LPRECT rc, bool query)
-{
- APPBARDATA abd = { 0 };
-
- abd.cbSize = sizeof(abd);
- abd.hWnd = hwnd;
- abd.uEdge = docked == DOCKED_LEFT ? ABE_LEFT : ABE_RIGHT;
- abd.rc = *rc;
- SHAppBarMessage(query ? ABM_QUERYPOS : ABM_SETPOS, &abd);
- *rc = abd.rc;
-}
-
-static UINT_PTR Docking_Command(HWND hwnd, int cmd)
-{
- APPBARDATA abd = { 0 };
-
- abd.cbSize = sizeof(abd);
- abd.hWnd = hwnd;
- abd.uCallbackMessage = WM_DOCKCALLBACK;
- return SHAppBarMessage(cmd, &abd);
-}
-
-static void Docking_AdjustPosition(HWND hwnd, LPRECT rcDisplay, LPRECT rc, bool query, bool move)
-{
- int cx = rc->right - rc->left;
-
- rc->top = rcDisplay->top;
- rc->bottom = rcDisplay->bottom;
- if (docked == DOCKED_LEFT) {
- rc->right = rcDisplay->left + (rc->right - rc->left);
- rc->left = rcDisplay->left;
- }
- else {
- rc->left = rcDisplay->right - (rc->right - rc->left);
- rc->right = rcDisplay->right;
- }
- Docking_PosCommand(hwnd, rc, true);
-
- if (docked == DOCKED_LEFT)
- rc->right = rc->left + cx;
- else
- rc->left = rc->right - cx;
-
- if (!query) {
- Docking_PosCommand(hwnd, rc, false);
- dockPos = *(LPPOINT)rc;
- }
-
- if (move)
- MoveWindow(hwnd, rc->left, rc->top, rc->right - rc->left, rc->bottom - rc->top, TRUE);
-}
-
-static void Docking_SetSize(HWND hwnd, LPRECT rc, bool query, bool move)
-{
- RECT rcMonitor;
- Docking_GetMonitorRectFromPoint(
- docked == DOCKED_LEFT && !query ? (LPPOINT)&rc->right : (LPPOINT)rc, &rcMonitor);
- Docking_AdjustPosition(hwnd, &rcMonitor, rc, query, move);
-}
-
-static bool Docking_IsWindowVisible(HWND hwnd)
-{
- LONG style = GetWindowLongPtr(hwnd, GWL_STYLE);
- return style & WS_VISIBLE && !(style & WS_MINIMIZE);
-}
-
-MIR_APP_DLL(BOOL) Clist_IsDocked()
-{
- return docked;
-}
-
-int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
-{
- static int draggingTitle;
- MSG *msg = (MSG *)wParam;
-
- if (msg->message == WM_DESTROY) {
- if (docked) {
- db_set_b(0, "CList", "Docked", (uint8_t)docked);
- db_set_dw(0, "CList", "DockX", (uint32_t)dockPos.x);
- db_set_dw(0, "CList", "DockY", (uint32_t)dockPos.y);
- }
- else {
- db_unset(0, "CList", "Docked");
- db_unset(0, "CList", "DockX");
- db_unset(0, "CList", "DockY");
- }
- }
-
- if (!docked && msg->message != WM_CREATE && msg->message != WM_MOVING)
- return 0;
-
- switch (msg->message) {
- case WM_CREATE:
- draggingTitle = 0;
- docked = db_get_b(0, "CLUI", "DockToSides", 1) ?
- (char)db_get_b(0, "CList", "Docked", 0) : 0;
- dockPos.x = (int)db_get_dw(0, "CList", "DockX", 0);
- dockPos.y = (int)db_get_dw(0, "CList", "DockY", 0);
- break;
-
- case WM_ACTIVATE:
- Docking_Command(msg->hwnd, ABM_ACTIVATE);
- break;
-
- case WM_WINDOWPOSCHANGING:
- {
- LPWINDOWPOS wp = (LPWINDOWPOS)msg->lParam;
-
- bool vis = Docking_IsWindowVisible(msg->hwnd);
- if (wp->flags & SWP_SHOWWINDOW)
- vis = !IsIconic(msg->hwnd);
- if (wp->flags & SWP_HIDEWINDOW)
- vis = false;
-
- if (vis) {
- if (!(wp->flags & (SWP_NOMOVE | SWP_NOSIZE))) {
- bool addbar = Docking_Command(msg->hwnd, ABM_NEW) != 0;
-
- RECT rc = { 0 };
- GetWindowRect(msg->hwnd, &rc);
-
- int cx = rc.right - rc.left;
- if (!(wp->flags & SWP_NOMOVE)) { rc.left = wp->x; rc.top = wp->y; }
-
- if (addbar)
- Docking_RectToDock(&rc);
-
- if (!(wp->flags & SWP_NOSIZE)) {
- rc.right = rc.left + wp->cx;
- rc.bottom = rc.top + wp->cy;
- addbar |= (cx != wp->cx);
- }
-
- Docking_SetSize(msg->hwnd, &rc, !addbar, false);
-
- if (!(wp->flags & SWP_NOMOVE)) { wp->x = rc.left; wp->y = rc.top; }
- if (!(wp->flags & SWP_NOSIZE)) wp->cy = rc.bottom - rc.top;
-
- *((LRESULT *)lParam) = TRUE;
- return TRUE;
- }
- else {
- if ((wp->flags & SWP_SHOWWINDOW) && Docking_Command(msg->hwnd, ABM_NEW)) {
- RECT rc = { 0 };
- GetWindowRect(msg->hwnd, &rc);
- Docking_RectToDock(&rc);
-
- Docking_SetSize(msg->hwnd, &rc, false, false);
-
- wp->x = rc.left;
- wp->y = rc.top;
- wp->cy = rc.bottom - rc.top;
- wp->cx = rc.right - rc.left;
- wp->flags &= ~(SWP_NOSIZE | SWP_NOMOVE);
- }
- }
- }
- }
- break;
-
- case WM_WINDOWPOSCHANGED:
- {
- LPWINDOWPOS wp = (LPWINDOWPOS)msg->lParam;
- bool vis = Docking_IsWindowVisible(msg->hwnd);
- if (wp->flags & SWP_SHOWWINDOW)
- vis = !IsIconic(msg->hwnd);
- if (wp->flags & SWP_HIDEWINDOW)
- vis = false;
-
- if (!vis)
- Docking_Command(msg->hwnd, ABM_REMOVE);
- else
- Docking_Command(msg->hwnd, ABM_WINDOWPOSCHANGED);
- }
- break;
-
- case WM_DISPLAYCHANGE:
- if (Docking_IsWindowVisible(msg->hwnd)) {
- RECT rc = { 0 };
- GetWindowRect(msg->hwnd, &rc);
- Docking_RectToDock(&rc);
- Docking_SetSize(msg->hwnd, &rc, false, true);
- }
- break;
-
- case WM_MOVING:
- if (!docked) {
- RECT rcMonitor;
- POINT ptCursor;
-
- // stop early
- if (GetAsyncKeyState(VK_CONTROL) & 0x8000)
- return 0;
-
- // GetMessagePos() is no good, position is always unsigned
- // GetCursorPos(&ptCursor);
- uint32_t pos = GetMessagePos();
- ptCursor.x = GET_X_LPARAM(pos);
- ptCursor.y = GET_Y_LPARAM(pos);
- Docking_GetMonitorRectFromPoint(&ptCursor, &rcMonitor);
-
- if (((ptCursor.x < rcMonitor.left + EDGESENSITIVITY) ||
- (ptCursor.x >= rcMonitor.right - EDGESENSITIVITY)) &&
- db_get_b(0, "CLUI", "DockToSides", 1)) {
- docked = (ptCursor.x < rcMonitor.left + EDGESENSITIVITY) ? DOCKED_LEFT : DOCKED_RIGHT;
- PostMessage(msg->hwnd, WM_LBUTTONUP, 0, MAKELPARAM(ptCursor.x, ptCursor.y));
-
- Docking_Command(msg->hwnd, ABM_NEW);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, (LPRECT)msg->lParam, false, true);
-
- *((LRESULT *)lParam) = TRUE;
- return TRUE;
- }
- }
- break;
-
- case WM_NCHITTEST:
- switch (DefWindowProc(msg->hwnd, WM_NCHITTEST, msg->wParam, msg->lParam)) {
- case HTSIZE: case HTTOP: case HTTOPLEFT: case HTTOPRIGHT:
- case HTBOTTOM: case HTBOTTOMRIGHT: case HTBOTTOMLEFT:
- *((LRESULT *)lParam) = HTCLIENT;
- return TRUE;
-
- case HTLEFT:
- if (docked == DOCKED_LEFT) {
- *((LRESULT *)lParam) = HTCLIENT;
- return TRUE;
- }
- break;
-
- case HTRIGHT:
- if (docked == DOCKED_RIGHT) {
- *((LRESULT *)lParam) = HTCLIENT;
- return TRUE;
- }
- break;
- }
- break;
-
- case WM_SYSCOMMAND:
- if ((msg->wParam & 0xFFF0) != SC_MOVE)
- return 0;
-
- SetActiveWindow(msg->hwnd);
- SetCapture(msg->hwnd);
- draggingTitle = 1;
- *((LRESULT *)lParam) = 0;
- return 1;
-
- case WM_MOUSEMOVE:
- if (draggingTitle) {
- RECT rc;
- POINT pt;
- GetClientRect(msg->hwnd, &rc);
- if ((docked == DOCKED_LEFT && (short)LOWORD(msg->lParam) > rc.right) ||
- (docked == DOCKED_RIGHT && (short)LOWORD(msg->lParam) < 0)) {
- ReleaseCapture();
- draggingTitle = 0;
- docked = 0;
- GetCursorPos(&pt);
- PostMessage(msg->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(pt.x, pt.y));
- SetWindowPos(msg->hwnd, nullptr, pt.x - rc.right / 2,
- pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2,
- db_get_dw(0, "CList", "Width", 0),
- db_get_dw(0, "CList", "Height", 0),
- SWP_NOZORDER);
- Docking_Command(msg->hwnd, ABM_REMOVE);
- }
- return 1;
- }
- break;
-
- case WM_LBUTTONUP:
- if (draggingTitle) {
- ReleaseCapture();
- draggingTitle = 0;
- }
- break;
-
- case WM_DOCKCALLBACK:
- switch (msg->wParam) {
- case ABN_WINDOWARRANGE:
- ShowWindow(msg->hwnd, msg->lParam ? SW_HIDE : SW_SHOW);
- break;
-
- case ABN_POSCHANGED:
- RECT rc = { 0 };
- GetWindowRect(msg->hwnd, &rc);
- Docking_SetSize(msg->hwnd, &rc, false, true);
- break;
- }
- return 1;
-
- case WM_DESTROY:
- Docking_Command(msg->hwnd, ABM_REMOVE);
- break;
- }
- return 0;
-}
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h
index bd6ccd49c0..721f6b462b 100644
--- a/src/mir_app/src/clc.h
+++ b/src/mir_app/src/clc.h
@@ -167,9 +167,6 @@ int LoadCLUIModule(void);
/* contact.c */
int fnSetHideOffline(int iValue);
-/* docking.c */
-int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam);
-
// clistgroups.cpp
struct CGroupInternal
diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp
index ec2fea7923..22d1a35825 100644
--- a/src/mir_app/src/clistcore.cpp
+++ b/src/mir_app/src/clistcore.cpp
@@ -123,8 +123,6 @@ void InitClistCore()
g_clistApi.pfnSetHideOffline = fnSetHideOffline;
- g_clistApi.pfnDocking_ProcessWindowMessage = fnDocking_ProcessWindowMessage;
-
g_clistApi.pfnGetIconFromStatusMode = fnGetIconFromStatusMode;
g_clistApi.pfnGetWindowVisibleState = fnGetWindowVisibleState;
g_clistApi.pfnIconFromStatusMode = fnIconFromStatusMode;
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp
index dede1547b0..ef5d2611d3 100644
--- a/src/mir_app/src/clistmod.cpp
+++ b/src/mir_app/src/clistmod.cpp
@@ -284,9 +284,6 @@ int fnGetWindowVisibleState(HWND hWnd, int iStepX, int iStepY)
if (IsIconic(hWnd) || !IsWindowVisible(hWnd))
return GWVS_HIDDEN;
- if (Clist_IsDocked())
- return GWVS_VISIBLE;
-
GetWindowRect(hWnd, &rcWin);
SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, FALSE);
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp
index ea8280d428..707b8800cf 100644
--- a/src/mir_app/src/clui.cpp
+++ b/src/mir_app/src/clui.cpp
@@ -264,8 +264,6 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
m.message = msg;
m.wParam = wParam;
m.lParam = lParam;
- if (g_clistApi.pfnDocking_ProcessWindowMessage((WPARAM)&m, (LPARAM)&result))
- return result;
if (g_clistApi.pfnTrayIconProcessMessage((WPARAM)&m, (LPARAM)&result))
return result;
@@ -332,12 +330,6 @@ int LoadCLUIModule(void)
pos.left, pos.top, pos.right - pos.left, pos.bottom - pos.top,
nullptr, nullptr, g_clistApi.hInst, nullptr);
- if (db_get_b(0, "CList", "OnDesktop", 0)) {
- HWND hProgMan = FindWindow(L"Progman", nullptr);
- if (IsWindow(hProgMan))
- SetParent(g_clistApi.hwndContactList, hProgMan);
- }
-
HookEvent(ME_LANGPACK_CHANGED, CluiLangpackChanged);
CluiLangpackChanged(0, 0);
@@ -547,18 +539,15 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (db_get_b(0, "CList", "DisableWorkingSet", 1))
SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
}
- // drop thru
+ __fallthrough;
+
case WM_MOVE:
if (!IsIconic(hwnd)) {
RECT rc;
GetWindowRect(hwnd, &rc);
-
- //if docked, dont remember pos (except for width)
- if (!Clist_IsDocked()) {
- db_set_dw(0, "CList", "Height", (uint32_t)(rc.bottom - rc.top));
- db_set_dw(0, "CList", "x", (uint32_t)rc.left);
- db_set_dw(0, "CList", "y", (uint32_t)rc.top);
- }
+ db_set_dw(0, "CList", "Height", (uint32_t)(rc.bottom - rc.top));
+ db_set_dw(0, "CList", "x", (uint32_t)rc.left);
+ db_set_dw(0, "CList", "y", (uint32_t)rc.top);
db_set_dw(0, "CList", "Width", (uint32_t)(rc.right - rc.left));
}
return FALSE;
@@ -725,7 +714,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
return 0;
case WM_SETTINGCHANGE:
- if (wParam == SPI_SETWORKAREA && (GetWindowLongPtr(hwnd, GWL_STYLE) & (WS_VISIBLE | WS_MINIMIZE)) == WS_VISIBLE && !Clist_IsDocked()) {
+ if (wParam == SPI_SETWORKAREA && (GetWindowLongPtr(hwnd, GWL_STYLE) & (WS_VISIBLE | WS_MINIMIZE)) == WS_VISIBLE) {
RECT rc;
GetWindowRect(hwnd, &rc);
if (Utils_AssertInsideScreen(&rc) == 1)
@@ -783,15 +772,10 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
return Clist_MenuProcessHotkey(((NMKEY*)lParam)->nVKey);
case CLN_LISTSIZECHANGE:
- {
- RECT rcWindow, rcTree, rcWorkArea;
- int maxHeight, newHeight;
+ if (db_get_b(0, "CLUI", "AutoSize", 0)) {
+ int maxHeight = db_get_b(0, "CLUI", "MaxSizeHeight", 75);
- if (!db_get_b(0, "CLUI", "AutoSize", 0))
- break;
- if (Clist_IsDocked())
- break;
- maxHeight = db_get_b(0, "CLUI", "MaxSizeHeight", 75);
+ RECT rcWindow, rcTree, rcWorkArea;
GetWindowRect(hwnd, &rcWindow);
GetWindowRect(g_clistApi.hwndContactTree, &rcTree);
@@ -802,7 +786,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (GetMonitorInfo(hMon, &mi))
rcWorkArea = mi.rcWork;
- newHeight = max(nmc->pt.y, LONG(9)) + 1 + (rcWindow.bottom - rcWindow.top) - (rcTree.bottom - rcTree.top);
+ int newHeight = max(nmc->pt.y, LONG(9)) + 1 + (rcWindow.bottom - rcWindow.top) - (rcTree.bottom - rcTree.top);
if (newHeight > (rcWorkArea.bottom - rcWorkArea.top) * maxHeight / 100)
newHeight = (rcWorkArea.bottom - rcWorkArea.top) * maxHeight / 100;
if (db_get_b(0, "CLUI", "AutoSizeUpward", 0)) {
@@ -1012,13 +996,9 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (!IsIconic(hwnd)) {
RECT rc;
GetWindowRect(hwnd, &rc);
-
- //if docked, dont remember pos (except for width)
- if (!Clist_IsDocked()) {
- db_set_dw(0, "CList", "Height", (uint32_t)(rc.bottom - rc.top));
- db_set_dw(0, "CList", "x", (uint32_t)rc.left);
- db_set_dw(0, "CList", "y", (uint32_t)rc.top);
- }
+ db_set_dw(0, "CList", "Height", (uint32_t)(rc.bottom - rc.top));
+ db_set_dw(0, "CList", "x", (uint32_t)rc.left);
+ db_set_dw(0, "CList", "y", (uint32_t)rc.top);
db_set_dw(0, "CList", "Width", (uint32_t)(rc.right - rc.left));
}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index fe6aefe6cd..f5b4697d98 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -185,7 +185,6 @@ Window_SetIcon_IcoLib @265
Clist_Broadcast @266 NONAME
Clist_BroadcastAsync @267 NONAME
Clist_MenuProcessCommand @268
-Clist_IsDocked @269
Clist_MenuProcessHotkey @270
Clist_ContactChangeGroup @271
Clist_ContactCompare @272
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 987822ddc2..bb13b5bd53 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -185,7 +185,6 @@ Window_SetIcon_IcoLib @265
Clist_Broadcast @266 NONAME
Clist_BroadcastAsync @267 NONAME
Clist_MenuProcessCommand @268
-Clist_IsDocked @269
Clist_MenuProcessHotkey @270
Clist_ContactChangeGroup @271
Clist_ContactCompare @272