-
-
Notifications
You must be signed in to change notification settings - Fork 32
Workspace switcher #361
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
Merged
Merged
Workspace switcher #361
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
1cfd418
WIP: POF workspace switcher
lenemter bbd8aed
Fix bugs
lenemter 95e19dc
Add support for switching workspaces
lenemter e34fc23
Use existing DesktopIntegration API
lenemter aca71f9
Fix crash. Make WorkspaceSystem handle the workspace indexes
lenemter 28c1149
Introduce WindowSystem
lenemter a42d660
Fix edge cases
lenemter 116acd5
Restructure the project
lenemter 2326695
LauncherManager -> ItemManager
lenemter a0a3c29
Add support for custom dynamic workspace styling
lenemter 0ef83b8
IconGroup: respect icon-size setting
lenemter c0fca29
Prepare support for active workspace indicator
lenemter eaf00ec
Don't reload application windows when switching workspace
lenemter 072bfbd
Add active workspace indicator
lenemter 2d467ff
A
lenemter fdd29b1
Fix lint
lenemter 982b778
Add new line
lenemter 1866d64
CSS: add workspace switcher styles (#364)
danirabbit 0b7d384
Merge branch 'main' into lenemter/workspace-switcher-pof
lenemter 72597c9
Fix crash
lenemter cf1e40d
Improve high contrast styles (#365)
danirabbit 67d7c46
Add separate button for new workspace
lenemter 89bacb7
DynamicWorkspaceItem: scale icon with dock icon size (#369)
danirabbit c6177c3
Update icon sizes in IconGroup for better scaling (#368)
alainm23 ad28f33
Dynamically compute grid spacing
lenemter 6d0d7e7
Fix alignment
lenemter 8619d9c
Fix crash
lenemter 1203631
Merge branch 'main' into lenemter/workspace-switcher-pof
lenemter c740899
Fix merge and update POTFILES
lenemter 4599581
Add a nice pop up animation
lenemter d7351d1
Remove TODO
lenemter 1ee32c0
Introduce DockSettings
lenemter 04ddbd8
Move launchers here as well
lenemter 712dceb
Fix lint
lenemter d26c39b
Create base class 'DockItem'
lenemter 5071d4c
Remove DockSettings
lenemter 19614cd
Remove extra new line
lenemter a48b91c
Merge branch 'main' into lenemter/workspace-switcher-pof
lenemter 63da719
AppSystem: Revert changes to active workspace handling
lenemter b05dd1f
Reduce diff
lenemter 1d2adac
Add default icon
lenemter 08ed668
Make DynamicWorkspaceIcon a subclass of DockItem
lenemter 05869b7
DockItem -> BaseItem
lenemter 82d87df
Merge branch 'main' into lenemter/workspace-switcher-pof
lenemter fdff8a9
Don't query active workspace on windows update
lenemter c383eb1
Remove setup_item_removed
lenemter f2f0e1a
Add pop up animation for dynamic workspace
lenemter 52104d0
Merge branch 'main' into lenemter/workspace-switcher-pof
lenemter 204b1da
remove_item_finish -> remove_finish
lenemter 247c872
A
lenemter 1c60d30
Better track of removed workspaces
lenemter f0707b0
Revert "Better track of removed workspaces"
lenemter b5e81f5
Fix removing workspaces
lenemter 12d63b5
Fix warnings
lenemter 8399ecb
Remove duplicate files from meson
lenemter 7da3132
Sort files
lenemter d4e4198
Merge branch 'main' into lenemter/workspace-switcher-pof
lenemter 30f6eeb
Simplify reposition_items
lenemter 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
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 |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| /* | ||
| * SPDX-License-Identifier: GPL-3.0 | ||
| * SPDX-FileCopyrightText: 2025 elementary, Inc. (https://elementary.io) | ||
| */ | ||
|
|
||
| public class Dock.DynamicWorkspaceIcon : BaseItem { | ||
| class construct { | ||
| set_css_name ("icongroup"); | ||
| } | ||
|
|
||
| public DynamicWorkspaceIcon () { | ||
| Object (); | ||
| } | ||
|
|
||
| construct { | ||
| var add_image = new Gtk.Image.from_icon_name ("list-add-symbolic") { | ||
| hexpand = true, | ||
| vexpand = true | ||
| }; | ||
| add_image.add_css_class ("add-image"); | ||
|
|
||
| // Gtk.Box is used here to keep css nodes consistent with IconGroup | ||
| var box = new Gtk.Box (VERTICAL, 0); | ||
| box.append (add_image); | ||
|
|
||
| overlay.child = box; | ||
|
|
||
| WorkspaceSystem.get_default ().workspace_added.connect (update_running_indicator_visibility); | ||
| WorkspaceSystem.get_default ().workspace_removed.connect (update_running_indicator_visibility); | ||
| WindowSystem.get_default ().notify["active-workspace"].connect (update_running_indicator_visibility); | ||
|
|
||
| dock_settings.bind ("icon-size", box, "width-request", DEFAULT); | ||
| dock_settings.bind ("icon-size", box, "height-request", DEFAULT); | ||
|
|
||
| dock_settings.bind_with_mapping ( | ||
| "icon-size", add_image, "pixel_size", DEFAULT | GET, | ||
| (value, variant, user_data) => { | ||
| var icon_size = variant.get_int32 (); | ||
| value.set_int (icon_size / 2); | ||
| return true; | ||
| }, | ||
| (value, expected_type, user_data) => { | ||
| return new Variant.maybe (null, null); | ||
| }, | ||
| null, null | ||
| ); | ||
|
|
||
| gesture_click.button = Gdk.BUTTON_PRIMARY; | ||
| gesture_click.released.connect (switch_to_new_workspace); | ||
| } | ||
|
|
||
| private void update_running_indicator_visibility () { | ||
| unowned var workspace_system = WorkspaceSystem.get_default (); | ||
| unowned var window_system = WindowSystem.get_default (); | ||
| running_revealer.reveal_child = workspace_system.workspaces.size == window_system.active_workspace; | ||
| } | ||
|
|
||
| private async void switch_to_new_workspace () { | ||
| var n_workspaces = WorkspaceSystem.get_default ().workspaces.size; | ||
|
|
||
| try { | ||
| yield WindowSystem.get_default ().desktop_integration.activate_workspace (n_workspaces); | ||
| } catch (Error e) { | ||
| warning ("Couldn't switch to new workspace: %s", e.message); | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.