-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Always on top powertoy #702
Conversation
@vldmr11080 We can fix this after this PR is merged, I'll open the issue with better repro steps. |
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.
Generally LGTM, great work!
I've added two more suggestions.
{ | ||
ResetCurrentOnTop(); | ||
if (hotKeyHandleWindow) { | ||
DestroyWindow(hotKeyHandleWindow); |
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 should also unregister HotkeyHandleWindow
window class
virtual void disable() | ||
{ | ||
ResetCurrentOnTop(); | ||
enabled = false; |
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 hotKeyHandleWindow
should be destroyed here, and the class should be unregistered.
@enricogior does this include the necessary changes to the installer? |
@vldmr11080 can you add Also, |
Ok, even when stopped I have the "always on top" menu entry. |
@bzoz good catch. we need to update the installer as well, but given we already planned to add telemetry and the icon after the first commit, we can also add the setup update later. |
@bzoz what about, |
@enricogior Win+Ctrl+T works but is very awkward to press. Ctrl + Alt + T works better. |
Looks like the crash I've found can be triggered by disabling the Always on top in the settings, then enabling it again and then exiting. It also leaves a stray system menu entry. |
OK! |
One nit: I get |
Almost there, all the previous issues are gone, but I have a new one: when the "always on top" is activated through the keyboard, the menu does not get updated - the "enabled tick" is not added. If you then click on the option, it disables the "always on top" but adds the tick. |
After starting PowerToys, the first time I right-click a title-bar, the Always On Top menu item doesn't appear, I need to right-click a second time. This as a side effect: start PowerToys and use the hotkey before opening the context menu, this will correctly set the window 'on top', but the context menu will not have the check flag, so turning 'on top' off for the window will make the check flagincorrectly appear. |
@enricogior I don't see this happening with the current code, can you update and test? |
@bzoz |
Closing this for now, we will reopen when we will have a solid solution for adding items to the system menu or come up with a different approach (our own context menu). |
Hello, I'm wondering why a menu item is needed; I think a keyboard shortcut should do. Perhaps you can check out the supporting information mentioned here: Regards |
This service provides simple window management, where user can specify certain window and force it to be always on top. This can be achieved either by opening window system menu (right mouse click on window title bar) and selecting
Always On Top
option, or through hotkey, which can be configured in general settings forAlways On Top
module.This is a PR for #13 which also referenced #49