From c9c2324e4f13e66c75d886f94dbacac1e28b191f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 12 May 2025 17:25:26 +0300 Subject: fixes #5009 ("Pin to desktop" option doesn't work in all modern Windows) --- src/core/stdclist/res/resource.rc | 2 +- src/core/stdclist/src/cluiopts.cpp | 13 +++---------- src/core/stdclist/src/resource.h | 1 - 3 files changed, 4 insertions(+), 12 deletions(-) (limited to 'src/core/stdclist') 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 -- cgit v1.2.3