-
Notifications
You must be signed in to change notification settings - Fork 47
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
feat: show preview for minimize/hidden windows #214
Conversation
} | ||
let apps = NSWorkspace.shared.runningApplications | ||
let windows = apps.flatMap { app in | ||
return WindowUtil.getRunningAppWindows(app: app) |
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.
Ensure you use [weak self]
in the closure like the original code (when referring to WindowUtil), otherwise there may be memory retention issues. The app previously had a memory leak/abandoned memory problem, which was resolved by using weak self references. The new code removes this safety measure, which could reintroduce memory management issues.
If you do decide to keep this change, I would just be sure to run lengthy tests to ensure that memory usage doesn't grow continuously as the app keeps running and being used.
Yes, there is still a lot of work and cleaning to do here. I want to largely mimic the alt-tab architecture. it's WIP |
Nice work @ShlomoCode! |
86b3ea3
to
23f3bd9
Compare
@ejbills What do you think so far? |
I still want to stress the importance of ensuring the use of It seems I am having trouble with clicking the window preview. The hover container window hides, but the window selected is not being brought to front for some reason. Also, the window placement when the dock is set to the left seems to be placing the window in the incorrect place. I am regularly seeing some odd placement of the hover window, where it snaps to the bottom of the dock (it usually self corrects the placement, but sometimes it gets stuck at the bottom of the dock when I'm hovering on an icon on the top. (Though, I am unsure if this is an issue I was talking about with @chrisharper22 when he changed how the window placement works - input? Though, this doesn't seem to be present on the current main branch.) I experienced one crash and some warnings when running this version about SharedPreviewWindowCoordinator being referred to on non-main threads. NSWindow should only be referred to on the main thread, so just make sure that is covered. In regards to the overall changed structure of the project and things being shuffled around, I think it looks great. I was able to jump right in and intuitively understand the new flow of the project. So, I think the refactoring is perfect so far! Short of the few bugs, but nothing major. |
I can't reproduce it... https://share.cleanshot.com/XYpcLXQBKFsPcB3T0Tl3 |
c5a481b
to
04073a7
Compare
@ejbills I think I fixed the following issues:
Please let me know if there are any other concerns. |
Marked as a draft because of the 2 TODOs listed in the PR description |
24f114c
to
7c21c60
Compare
See comment on this PR: #234 (comment) |
This PR now includes much more than hidden windows, please see the updated PR description |
Yes of course |
This PR was based off v1.1.4 or v1.1.2? |
v1.1.4 I think |
@ejbills @hasansultan92 Is there a big change coming? I want to start redoing the changes here as smaller PRs (I'll start with the performance thing). |
@ShlomoCode no big changes are incoming. Also, we sorted out the performance issue on our end. It was due to the image resolution of the window preview being held in memory. I believe @ejbills pushed out a slider in the settings that controls the image preview resolution before the PR was merged into main. Users who want large resolutions of the window preview take the performance hit vs those who dont want the large resolutions dont take the performance hit. |
It's only the RAM, what bothers me is mainly the CPU. There is no reason
for the app to take 10% CPU when not in use
|
@hasansultan92 See #190 |
@ShlomoCode apologies, I did not realize we were consuming so much CPU in idle state. I have been paying attention to the RAM since most of the work I did in the recent enhancements and features was more related to the logic and less to the preview display and cursor. I like the approach as mentioned in the issue referenced. Is there a POC we can check out, the link there does not work anymore? |
@hasansultan92 It is included in this PR, you can just pull https://github.com/ShlomoCode/DockDoor/tree/main |
@hasansultan92 The |
ok but Edge had no previews despite the window being open |
@hasansultan92 I installed the Edge browser (from https://www.microsoft.com/en-us/edge), it seems to work flawlessly 🤔 |
Hmm not sure what's happening on my end. Regardless, I do like the 0% idle and seems to be working fine otherwise. |
@hasansultan92 Even when hovering on the dock the CPU usage is lower than before. |
d033f5c
to
148e81f
Compare
This reverts commit bbe8bb1. # Conflicts: # DockDoor/logic/DockObserver.swift
closes Feature request: minimized and hidden window previews #31
closes Dock Previews Do Not Activate When Cursor Is Below Icon #19
closes Scrcpy Window Not Shows #30, closes UI elements as windows in Logos Bible Software #36
closes Listening to all mouse movements is a performance concern #190
TODO: