-
Notifications
You must be signed in to change notification settings - Fork 809
workspace switcher: Add option to display window icons #12202
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
workspace switcher: Add option to display window icons #12202
Conversation
495be98 to
95d0f52
Compare
|
Tested this on Mint 22.2 with Cinnamon 6.4.8, works like a charm. Thank you to the developer, would love to see it merged into master soon. |
This is handled after during button creation, and can lead to workspace switcher applet not following the focus windows initially.
2f09d60 to
a108594
Compare
|
Did a rebase on master, I think this should be ready for consideration. |
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.
Pull request overview
This PR adds an optional feature to display window icons in the workspace switcher applet's visual mode. When enabled, application icons appear centered in the window representations, with configurable sizes or automatic sizing based on available space. The implementation introduces a new WindowGraph class to encapsulate individual window rendering and icon management, refactoring the previous monolithic canvas painting approach into a more object-oriented design.
Key changes:
- Added two new settings:
show-window-icons(toggle) andwindow-icon-size(configurable/auto) - Refactored window rendering from a single canvas approach to individual
WindowGraphobjects per window - Optimized updates to only repaint focused windows when they change position or size
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| settings-schema.json | Added two new settings with visual display mode dependencies for controlling window icon display and size |
| applet.js | Introduced WindowGraph class for per-window rendering with icon support, refactored WorkspaceGraph to use the new architecture, and added optimization for partial updates |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
files/usr/share/cinnamon/applets/workspace-switcher@cinnamon.org/applet.js
Outdated
Show resolved
Hide resolved
files/usr/share/cinnamon/applets/workspace-switcher@cinnamon.org/applet.js
Outdated
Show resolved
Hide resolved
files/usr/share/cinnamon/applets/workspace-switcher@cinnamon.org/applet.js
Outdated
Show resolved
Hide resolved
d74b133 to
5417b71
Compare
|
Resolved copilot suggestions. |
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
files/usr/share/cinnamon/applets/workspace-switcher@cinnamon.org/applet.js
Outdated
Show resolved
Hide resolved
files/usr/share/cinnamon/applets/workspace-switcher@cinnamon.org/applet.js
Outdated
Show resolved
Hide resolved
files/usr/share/cinnamon/applets/workspace-switcher@cinnamon.org/applet.js
Outdated
Show resolved
Hide resolved
files/usr/share/cinnamon/applets/workspace-switcher@cinnamon.org/applet.js
Outdated
Show resolved
Hide resolved
|
Resolved suggestions. |
|
Thanks @anaximeno, it's a nice evolution of the visual representation. I don't think it should be an option, I think it should be an improvement. Until now the representation was accurate but complex:
Because there were no icons and maximized windows were just an empty large rectangle, we used transparency to show underlying windows and workaround this. If you're adding icons, you're essentially solving this issue, and thus we no longer need this complexity. You can get rid of transparency here and just mimic what is seen on the screen. You don't need any extra options. Icons should auto-adjust and be visible. |
Ok, as I understand I should remove the additional settings and assume the icons should show by default. I'll send an update in moments. |
Remove window icon settings and refactor icon handling in WindowGraph
|
I asked @mtwebster to take a look to see if we could hide obfuscated windows. It's not simple.. otherwise it looks like that:
|
Returns only those windows that would be visible on the workspace. ref: linuxmint/cinnamon#12202 (comment)
|
I made a PR for muffin to add a new workspace method: note:
edit..
|
|
Sure, I'll look into that. |
|
Ok, I've with tested linuxmint/muffin#766 in a VM and made the updates, I think it should be adapted to work as intended with that new feature now. Edit: @mtwebster You probably noticed it wasn't completely refreshing the graph, not filtering the obfuscated windows, however that was due to the approach I was using to only update the focus window area instead of the whole graph on changes concerning only the focused window (like size change, position change, etc). I've reverted this behavior to instead update the whole graph of the current workspace, so that the obfuscated windows can be filtered immediately as they get covered up by the focused window. |
If the window is minimized, we need to trigger a repaint of the workspace graph here because there's an edge case where if this window is minimized out of focus (i.e. while it isn't the focused window), the graph won't update properly update to reflect the state of other underlying windows.
55bc726 to
e8e5df7
Compare
* workspace.c: Add new method for listing visible window stack. Returns only those windows that would be visible on the workspace. ref: linuxmint/cinnamon#12202 (comment) * update libmuffin0.symbols.






Closes #11455
Depends on linuxmint/muffin#766
ex. 1
ex. 2

Replaces #11530 (I closed and recreated this pull request with a cleaner commit log)