-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add per-app auto-hide taskbar when active #12
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
Open
tkaiman
wants to merge
5
commits into
adamk33n3r:main
Choose a base branch
from
tkaiman:feature/auto-hide-taskbar
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3aa9dc1
feat: add per-app auto-hide taskbar when active
tkaiman 1f0b256
fix: preserve full taskbar state bitmask and propagate errors
tkaiman 13d3d17
fix: keep taskbar hidden while app is running, not just when focused
tkaiman c47cabd
fix: prevent scan loop from blocking when GUI is minimized to tray
tkaiman dfdc7dd
fix: force taskbar to retract immediately after enabling auto-hide
tkaiman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,7 @@ func (w Window) String() string { | |
| } | ||
|
|
||
| var monitors []Monitor | ||
| var chWindowList = make(chan []Window) // Channel to send window list updates | ||
| var chWindowList = make(chan []Window, 1) // Buffered so scan loop doesn't block when GUI isn't consuming updates | ||
|
|
||
| var ALWAYS_HIDDEN_PROCESSESS = []string{ | ||
| // Skip self | ||
|
|
@@ -161,7 +161,14 @@ func scanWindows(settings *Settings) { | |
| allWindows := EnumWindows() | ||
| windowData := getWindowData(allWindows) | ||
|
|
||
| chWindowList <- windowData // Update global window list | ||
| // Non-blocking send: drop stale data if GUI isn't consuming | ||
| select { | ||
| case chWindowList <- windowData: | ||
| default: | ||
| } | ||
|
Comment on lines
+164
to
+168
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Newest window snapshot is dropped when channel is full. Line 164 says stale data should be dropped, but this Suggested non-blocking overwrite of stale entry- // Non-blocking send: drop stale data if GUI isn't consuming
- select {
- case chWindowList <- windowData:
- default:
- }
+ // Non-blocking send: keep latest snapshot, drop stale buffered one if needed.
+ select {
+ case chWindowList <- windowData:
+ default:
+ select {
+ case <-chWindowList:
+ default:
+ }
+ select {
+ case chWindowList <- windowData:
+ default:
+ }
+ }🤖 Prompt for AI Agents |
||
|
|
||
| shouldHideTaskbar := false | ||
|
|
||
| for appSettingIdx, appSetting := range settings.Apps { | ||
| if !appSetting.AutoApply { | ||
| continue | ||
|
|
@@ -178,11 +185,33 @@ func scanWindows(settings *Settings) { | |
| settings.Save() | ||
| } | ||
| makeBorderless(win, appSetting) | ||
| // Hide taskbar as long as this app's window exists | ||
| if appSetting.HideTaskbar { | ||
| shouldHideTaskbar = true | ||
| } | ||
| break | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Also check non-auto-apply apps that are already borderless and running | ||
| for _, appSetting := range settings.Apps { | ||
| if !appSetting.HideTaskbar { | ||
| continue | ||
| } | ||
| for _, win := range windowData { | ||
| if matchWindow(win, appSetting) && isBorderless(win) { | ||
| shouldHideTaskbar = true | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if shouldHideTaskbar { | ||
| hideTaskbar() | ||
| } else { | ||
| restoreTaskbar() | ||
| } | ||
|
|
||
| time.Sleep(time.Second * 1) // Sleep for 1 second before next scan | ||
| } | ||
| } | ||
|
|
@@ -217,6 +246,8 @@ func main() { | |
| } | ||
|
|
||
| settings.Save() | ||
| // Save the user's original taskbar state before we potentially modify it | ||
| saveTaskbarState() | ||
| fmt.Println(settings) | ||
| for _, mon := range monitors { | ||
| fmt.Printf("Monitor %d\n", mon.number) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Restore the taskbar from every shutdown path, not just window-close.
Line 314 only covers the close intercept.
restartApp()in this file still exits viaos.Exit(0)without callingrestoreTaskbarOnExit(), so update/restart can leave the taskbar stuck in the app-forced state. Please route quit/restart through one shared shutdown helper.🤖 Prompt for AI Agents