summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/cluiframes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Clist_modern/src/cluiframes.cpp')
-rw-r--r--plugins/Clist_modern/src/cluiframes.cpp50
1 files changed, 11 insertions, 39 deletions
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp
index 4413554500..b980f7b9cf 100644
--- a/plugins/Clist_modern/src/cluiframes.cpp
+++ b/plugins/Clist_modern/src/cluiframes.cpp
@@ -2,7 +2,7 @@
Miranda NG: the free IM client for Microsoft* Windows*
-Copyright (C) 2012-24 Miranda NG team (https://miranda-ng.org),
+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.
@@ -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);
@@ -2620,8 +2599,8 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
//ScreenToClient(Frames[framepos].ContainerWnd,&Frames[framepos].TitleBar.oldpos);
- if ((!(wParam&MK_CONTROL)) && g_pfwFrames[framepos].Locked && (!(g_pfwFrames[framepos].floating))) {
- if (db_get_b(0, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT)) {
+ if ((!(wParam & MK_CONTROL)) && g_pfwFrames[framepos].Locked && (!(g_pfwFrames[framepos].floating))) {
+ if (Clist::bClientAreaDrag) {
POINT pt;
int res;
//pt = nm->pt;
@@ -2939,12 +2918,11 @@ static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wP
switch (msg) {
case WM_ACTIVATE:
if (g_bTransparentFlag) {
- uint8_t alpha;
if ((wParam != WA_INACTIVE || ((HWND)lParam == hwnd) || GetParent((HWND)lParam) == hwnd)) {
HWND hw = lParam ? GetParent((HWND)lParam) : nullptr;
- alpha = g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT);
- if (hw) SetWindowPos(hw, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
- CLUI_SmoothAlphaTransition(hwnd, alpha, 1);
+ if (hw)
+ SetWindowPos(hw, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
+ CLUI_SmoothAlphaTransition(hwnd, Clist::iAlpha, 1);
}
}
@@ -2989,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;
}
@@ -3121,7 +3093,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP
return 0;
case WM_LBUTTONDOWN:
- if (db_get_b(0, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT)) {
+ if (Clist::bClientAreaDrag) {
POINT pt;
GetCursorPos(&pt);
return SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y));