Skip to content

Conversation

@leolost2605
Copy link
Member

@leolost2605 leolost2605 commented Nov 26, 2025

Fixes #520

Menu and actions are UI stuff and not model stuff so move the pinned action and the main menu model to launcher. Make the pinned action a property action there. PropertyAction keeps a reference on the object whose property it represents so it shouldnt be in the same class because that would form a reference cycle. Also using property action means the property has to be public set anyways so IMO the property action should be created by its consumer which is in this case the launcher (the app shouldn't have to care about how pinned is set).

Closes #508

action_group.add_action (new PropertyAction (PINNED_ACTION, app, "pinned"));
insert_action_group (ACTION_GROUP_PREFIX, action_group);

insert_action_group (App.ACTION_GROUP_PREFIX, app.app_action_group);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda don't like renaming the action group in App because it looks like this when used elsewhere. I think app.action_group was cleaner

Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think about the circular reference. I personally like this less in terms of organization but it fixes the issue for me, so happy to approve it! Thanks for investigating!

@danirabbit danirabbit merged commit f4920fb into main Nov 26, 2025
4 checks passed
@danirabbit danirabbit deleted the leolost/pinned-property-action branch November 26, 2025 20:58
@danirabbit danirabbit mentioned this pull request Nov 26, 2025
4 tasks
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.

"Keep in Dock" Not Working For Most Applications

3 participants