-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EXPLORER] Implement taskbar application grouping #6889
base: master
Are you sure you want to change the base?
Conversation
@@ -216,3 +217,5 @@ | |||
#define ID_SHELL_CMD_CUST_NOTIF (411) | |||
#define ID_SHELL_CMD_ADJUST_DAT (412) | |||
#define ID_SHELL_CMD_RESTORE_ALL (413) | |||
#define ID_SHELL_CMD_MINIMIZE_GRP (414) | |||
#define ID_SHELL_CMD_CLOSE_GRP (415) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If PR #6872 is merged before this (likely) then you need to adjust ID_SHELL_CMD_LAST before merging (likely a conflict).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah i know, currently it's a TODO PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing is that ID_SHELL_CMD_LAST was 0x7FEF so it should be fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was yes but not after my PR is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, then, totally true
|
There's something weird happening when the MSVC builders compile the (modified) explorer.rc ... |
For information, builds are now working, except for those that have a problem in the github actions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1st part of final review
@@ -55,6 +55,7 @@ | |||
|
|||
#define IDM_STARTMENU 204 | |||
#define IDM_TRAYWND 205 | |||
#define IDM_TASKGRP 210 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 210 and not 206? You want to reserve space for extra menus for tray/taskbar here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't exactly remember right now if this is right but i think that was xp behaviour. I don't exactly remember as this was added like a year ago
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that doesn't matter then yeah, we can use 206
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can leave this, I would just add a comment explaining where you got the numbers from.
GetProcessPath(IN DWORD dwProcessId, | ||
OUT LPWSTR szBuffer, | ||
IN DWORD cbBufLen) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetProcessPath(IN DWORD dwProcessId, | |
OUT LPWSTR szBuffer, | |
IN DWORD cbBufLen) | |
GetProcessPath( | |
_In_ DWORD dwProcessId, | |
_Out_ LPWSTR szBuffer, | |
_In_ DWORD cbBufLen) |
HANDLE hTaskProc = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, dwProcessId); | ||
BOOL bRet = FALSE; | ||
if (hTaskProc != NULL) | ||
{ | ||
if (GetModuleFileNameExW(hTaskProc, NULL, szBuffer, cbBufLen)) | ||
bRet = TRUE; | ||
|
||
CloseHandle(hTaskProc); | ||
} | ||
|
||
return bRet; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are in C++ we can put the variables in the middle of the code:
HANDLE hTaskProc = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, dwProcessId); | |
BOOL bRet = FALSE; | |
if (hTaskProc != NULL) | |
{ | |
if (GetModuleFileNameExW(hTaskProc, NULL, szBuffer, cbBufLen)) | |
bRet = TRUE; | |
CloseHandle(hTaskProc); | |
} | |
return bRet; | |
HANDLE hTaskProc = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, dwProcessId); | |
if (!hTaskProc) | |
return FALSE; | |
BOOL bRet = (GetModuleFileNameExW(hTaskProc, NULL, szBuffer, cbBufLen) != 0); | |
CloseHandle(hTaskProc); | |
return bRet; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True
if (bRet == FALSE && cbTranslate >= sizeof(LANGCODEPAGE)) | ||
{ | ||
//Try to use the first language as a fallback | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (bRet == FALSE && cbTranslate >= sizeof(LANGCODEPAGE)) | |
{ | |
//Try to use the first language as a fallback | |
if (!bRet && cbTranslate >= sizeof(LANGCODEPAGE)) | |
{ | |
// Try to use the first language as a fallback |
_countof(szSubBlock), | ||
L"\\StringFileInfo\\%04X%04X\\%s", | ||
lpTranslate[0].wLanguage, | ||
lpTranslate[0].wCodePage, | ||
szVersionInfo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_countof(szSubBlock), | |
L"\\StringFileInfo\\%04X%04X\\%s", | |
lpTranslate[0].wLanguage, | |
lpTranslate[0].wCodePage, | |
szVersionInfo); | |
_countof(szSubBlock), | |
L"\\StringFileInfo\\%04X%04X\\%s", | |
lpTranslate[0].wLanguage, | |
lpTranslate[0].wCodePage, | |
szVersionInfo); |
RECT rcBitmap = nmtbcd->nmcd.rc; | ||
RECT rcArrow = nmtbcd->nmcd.rc; | ||
InflateRect(&rcText, -GetSystemMetrics(SM_CXEDGE), 0); | ||
rcText.left += bitmapWidth + 6; //TODO Default list gap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rcText.left += bitmapWidth + 6; //TODO Default list gap | |
rcText.left += bitmapWidth + 6; // TODO: Default list gap |
rcBitmap.top++; | ||
} | ||
|
||
rcArrow.left = max(rcArrow.left, rcArrow.right - 13); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this "13" about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think is a prepcalculated x offset, i could try to add the formula there, but u think is always a constant and always the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could add a #define
for this that uses the calculation.
ImageList_Draw(m_ImageList, TaskGroup->Index, nmtbcd->nmcd.hdc, rcBitmap.left, rcBitmap.top, (btni.fsState & CDIS_MARKED) ? ILD_BLEND50 | ILD_TRANSPARENT : ILD_TRANSPARENT); | ||
|
||
WCHAR TaskCountText[20]; | ||
StringCbPrintfW(TaskCountText, 20, L"(%d)", TaskGroup->dwTaskCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StringCbPrintfW(TaskCountText, 20, L"(%d)", TaskGroup->dwTaskCount); | |
StringCbPrintfW(TaskCountText, sizeof(TaskCountText), L"(%d)", TaskGroup->dwTaskCount); |
INT x, y; | ||
HPEN hPen, hOldPen; | ||
|
||
if (!(hPen = CreatePen( PS_SOLID, 1, nmtbcd->clrText))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!(hPen = CreatePen( PS_SOLID, 1, nmtbcd->clrText))) | |
if (!(hPen = CreatePen(PS_SOLID, 1, nmtbcd->clrText))) |
@@ -1747,27 +2640,31 @@ class CTaskSwitchWnd : | |||
|
|||
switch (nmh->code) | |||
{ | |||
case NM_CUSTOMDRAW: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure the reformatting here is useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's exactly to comply with the formatting rules
I will solve all the requests tomorrow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR will need some work before it can get merged. The author of this PR suggested in the past that he was willing to have us finish this work without needing his intervention since he is busy. I reached out to him to make sure he is still okay with this. If he allows us, we will commit fixes directly to this PR to clean it up before merging it.
Update: He says he will be back in about a week, but we can help clean it up in the meantime.
@@ -55,6 +55,7 @@ | |||
|
|||
#define IDM_STARTMENU 204 | |||
#define IDM_TRAYWND 205 | |||
#define IDM_TASKGRP 210 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can leave this, I would just add a comment explaining where you got the numbers from.
Purpose
I've implemented the task grouping function to taskbar.
JIRA issue: CORE-16134
Proposed changes
TODO