-
Notifications
You must be signed in to change notification settings - Fork 273
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
Add "Show desktop" button #169
Conversation
|
||
private void ToggleDesktop() | ||
{ | ||
NativeMethods.SendMessage(WindowHelper.FindWindowsTray(IntPtr.Zero), |
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 it should be better to add this to ManagedShell instead of being 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 agree. This could complement the other Aero Peek helper methods in ManagedShell.
ebc500f
to
9e553de
Compare
aaeeb34
to
7a0369f
Compare
This comment was marked as outdated.
This comment was marked as outdated.
83f78f9
to
7a0369f
Compare
This comment was marked as outdated.
This comment was marked as outdated.
67e0ad3
to
128280b
Compare
Maybe using https://github.com/michaelnoonan/inputsimulator They use NativeMethods.SendInput. |
Thanks, but I don't want to use the keyboard shortcuts, as I know some people like to override the default shortcuts with custom ones. I will look into this situation a bit anyway. |
Tested the #305 action build and have no issues with the desktop button so far. Windows 11 Pro |
RetroBar/Controls/TaskList.xaml.cs
Outdated
@@ -143,5 +143,24 @@ private void TasksScrollViewer_PreviewMouseWheel(object sender, System.Windows.I | |||
e.Handled = true; | |||
} | |||
} | |||
|
|||
public bool AreAllWindowsMinimized() |
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.
@dremin, is it possible that we need to bind AreAllWindowsMinimized to the ShowDesktop Checked state, or is there a better way to detect when all windows are minimized?
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 think you'll need to check if windows are minimized. From testing it seems like Explorer sets the desktop as the foreground window when "show desktop" is "enabled", and then considers it "enabled" until the desktop is no longer the foreground window. Once another window is foreground, toggling "show desktop" will show the desktop again rather than restore the windows. So basically once we enable show desktop, we want to keep the button checked until the foreground window changes.
There are a couple ways to do this, one being an approach similar to FullScreenHelper that polls GetForegroundWindow()
every 100ms. Another idea that might be cleaner is to add an event to TasksService on shell hook messages that RetroBar could add a handler for (maybe FullScreenHelper could even be refactored to use this down the road if appropriate).
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.
@xoascf Would you like me to help with the above to get this finished up?
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.
Oh that would be perfect, this week I tried to add it in ManagedShell but I don't quite understand how to do it as you described above, I would be very grateful if you could do it for me, maybe later changes can be made if needed or requested for some themes.
The "Allow edits..." option is enabled, you can make the changes you want in this PR or separately, @dremin.
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 seems that the behavior varies for certain themes:
In Windows 95 (and presumably the same for classic pre-7 themes): The button appears pressed when all windows are minimized (either with the button itself or with a keyboard shortcut to minimize them) and if the desktop is active after that (if the desktop is just foregrounded without any minimized windows, it's not going to appear as pressed).
In Windows 7 (and later): The button does not appear pressed when all windows are minimized or after you click it.
In both cases, it seems that the value (all minimized windows) is used for the context menu options, this seems to be especially useful for toggling them in #461.
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.
@xoascf cairoshell/ManagedShell#74 is the ManagedShell support for this. Would you like me to wait to commit the RetroBar changes until a ManagedShell build is available on NuGet?
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.
is the ManagedShell support for this. Would you like me to wait to commit the RetroBar changes until a ManagedShell build is available on NuGet?
That would be preferable.
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.
@xoascf Just pushed the changes.
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.
Thanks @dremin, by the way, the Show desktop button is not selected or deselected when using the shortcut to show the desktop with Win + D. Is this by design?
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.
@xoascf Yeah, that is expected. I didn't add any handling for WM_COMMAND but will look into it. I don't think that should block this though.
a59483f
to
9c52bd1
Compare
Hope that is complete soon. |
499a282
to
cffac80
Compare
e552fd2
to
f4e8765
Compare
@xoascf I am interested in testing you fork on a unused windows 7 pc so I can encounter this issue and try to help you fix it. |
Alright @som3rando, let me fix this real quick. |
d9cabf3
to
a3a6f97
Compare
Had difficulties with the pc so i switched to a VM, and i believe i found a issue with the peek feature wich happens when you interact with the original peek function and switch back to retrobar. To fix the issue I had to delete appdata and restart. |
a3a6f97
to
4cd8adc
Compare
Ok, I'm not sure if we will continue to support Windows 7, it would be better to finish this and if a solution is found, implement it in the future. |
4cd8adc
to
a89de8d
Compare
I'm working on some additional tweaks to the appearance to better match what I am seeing in Memphis build 1400 and NT 5 build 1796, as well as some improvements to the XP themes. Where does the peek feature currently stand? It seems to be working great for me. |
@xoascf I think this is good to go. What do you think? |
Yes, this looks pretty good already, thanks for your patience and cooperation. |
Fixes:
Uses correct checkered background(already done in Fix issues in XP classic theme #248)Small issues: