Skip to content

Conversation

@anaximeno
Copy link
Contributor

@anaximeno anaximeno commented May 18, 2024

Closes #11455
Depends on linuxmint/muffin#766

  • ex. 1

    screenshot-auto_1716056760

  • ex. 2
    screenshot-auto_1716058326

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

@anaximeno anaximeno force-pushed the workspace-switcher-add-display-icon-option branch 3 times, most recently from 495be98 to 95d0f52 Compare May 20, 2024 05:24
@clefebvre
Copy link
Member

Pretty cool idea but it needs some work and thoughts.

image

Marking as Next for now.

@clefebvre clefebvre changed the title workspace switcher: Add option to display window icons [Next] workspace switcher: Add option to display window icons Nov 27, 2024
@anaximeno
Copy link
Contributor Author

Pretty cool idea but it needs some work and thoughts.

image

Marking as Next for now.

Sure I'll take a look at that, I can auto-hide the icon if the window area is smaller than the icon size in either of the directions. I'll test that, and see how it looks.

@clefebvre clefebvre changed the title [Next] workspace switcher: Add option to display window icons workspace switcher: Add option to display window icons Feb 24, 2025
@anaximeno
Copy link
Contributor Author

I converted the window icon size settings option into a combobox (to maintain consistency with other parts like how panel icon sizes are selected) and added an option (by default) to auto size the icons according to the workspace graph size:

Captura de ecrã de 2025-03-01 19-55-50

Captura de ecrã de 2025-03-01 19-56-16

@Boris-Dimov
Copy link

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.

@anaximeno anaximeno force-pushed the workspace-switcher-add-display-icon-option branch from 2f09d60 to a108594 Compare November 22, 2025 19:10
@anaximeno
Copy link
Contributor Author

Did a rebase on master, I think this should be ready for consideration.

Copy link
Contributor

Copilot AI left a 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) and window-icon-size (configurable/auto)
  • Refactored window rendering from a single canvas approach to individual WindowGraph objects 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.

@anaximeno anaximeno force-pushed the workspace-switcher-add-display-icon-option branch from d74b133 to 5417b71 Compare November 26, 2025 02:49
@anaximeno
Copy link
Contributor Author

Resolved copilot suggestions.

Copy link
Contributor

Copilot AI left a 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.

@anaximeno
Copy link
Contributor Author

Resolved suggestions.

@clefebvre
Copy link
Member

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:

image

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.

@anaximeno
Copy link
Contributor Author

(...)

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
@clefebvre
Copy link
Member

I asked @mtwebster to take a look to see if we could hide obfuscated windows. It's not simple..

otherwise it looks like that:

Capture d’écran du 2025-11-27 15-22-21

mtwebster added a commit to linuxmint/muffin that referenced this pull request Nov 28, 2025
Returns only those windows that would be visible on the workspace.

ref:
linuxmint/cinnamon#12202 (comment)
@mtwebster
Copy link
Member

mtwebster commented Nov 28, 2025

I made a PR for muffin to add a new workspace method:

linuxmint/muffin#766

let windows = this.workspace.list_unobscured_windows();

note:

  • This already skips minimized windows, you can remove that from your filter.
  • Most-recently-used order isn't relevant, this is a visual representation only, so you should be able to eliminate that sort also.
  • The graph doesn't seem to refresh in certain situations where it should - like maximizing and unmaximizing, tiling.. things that may change size and shape (and thus expose or cover other windows), but not the focus window. (Maybe a couple more things to monitor on the focused window - maximized, tile-mode... )

edit..

  • another thing I noticed you're triggering full refreshes (rebuilding this list) every time you enter/leave the applet itself, which could maybe be filtered out.

@anaximeno
Copy link
Contributor Author

Sure, I'll look into that.

@anaximeno
Copy link
Contributor Author

anaximeno commented Nov 28, 2025

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
Regarding the additional signals to listen to, I think they aren't needed, the already listened to "position-changed" and "size-changed" seems to cover state changes that occur during operations such as tile, maximize and unmaximize, etc.

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.
@anaximeno anaximeno force-pushed the workspace-switcher-add-display-icon-option branch from 55bc726 to e8e5df7 Compare November 29, 2025 02:54
mtwebster added a commit to linuxmint/muffin that referenced this pull request Dec 4, 2025
* 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.
@mtwebster mtwebster merged commit 673dc2e into linuxmint:master Dec 4, 2025
3 checks passed
@anaximeno anaximeno deleted the workspace-switcher-add-display-icon-option branch December 5, 2025 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show an Icon representation of the window in the workspace-switcher applet

4 participants