-
Notifications
You must be signed in to change notification settings - Fork 7.1k
[CmdPal] Add system tray menu #39155
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
Conversation
{ | ||
PInvoke.GetCursorPos(out var cursorPos); | ||
PInvoke.SetForegroundWindow(_hwnd); | ||
PInvoke.TrackPopupMenuEx(_popupMenu, (uint)TRACK_POPUP_MENU_FLAGS.TPM_LEFTALIGN | (uint)TRACK_POPUP_MENU_FLAGS.TPM_BOTTOMALIGN, cursorPos.X, cursorPos.Y, _hwnd, null); |
Check failure
Code scanning / check-spelling
Unrecognized Spelling
@@ -216,7 +196,7 @@ private static DesktopAcrylicController GetAcrylicConfig(UIElement content) | |||
|
|||
private void ShowHwnd(IntPtr hwndValue, MonitorBehavior target) | |||
{ | |||
var hwnd = new HWND(hwndValue); | |||
var hwnd = new HWND(hwndValue != 0 ? hwndValue : _hwnd); |
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 like this.. 😒
Do we really need to propagate CmdPal window HWND from various messages? Isn't the HWND fixed?
i like it but i feel like we're in a mode where we need to really dark mode enable / unify the context menus :( |
I agree that dark mode would be nice but I also like the native approach (Runner and Awake tray icon menus also use native API). EDIT: otherwise we could explore another solution.. https://github.com/HavenDV/H.NotifyIcon comes to mind 🤔 |
Is there any reason that this is still in draft? Seems like we can ship it. (I'd probably also just leave the "exit" item there always, but that's just me) |
No reason. I just wanted to do more testing, which I did, but forgot to mark as ready. As the PT arg has been removed I would love get a feedback on the Exit menu. Does it make sense to add Exit only when NOT started from the URI? Then I will merge latest main and mark as ready. |
I frankly would just leave the exit item in the menu always. I still get a pretty decent number of cases where something goes sideways and I need to quit out of the palette, and being able to do that even when started from PT seems useful to me (even if that's a little weird for how it integrates with PT) |
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.
LGTM
Summary of the Pull Request
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
Manually tested: