Skip to content

shell/focus: Don't dismiss grabbing popups of exclusive layer surfaces - #2845

Merged
jacobgkau merged 1 commit into
pop-os:masterfrom
hojjatabdollahi:hojjat/fix-popup-exclusive
Sep 16, 2026
Merged

jacobgkau merged 1 commit into
pop-os:masterfrom
hojjatabdollahi:hojjat/fix-popup-exclusive

Conversation

@hojjatabdollahi

@hojjatabdollahi hojjatabdollahi commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

I added context menu to all input boxes for copy/cut/paste in libcosmic. It works in all libcosmic apps, except for app-library and cosmic-launcher.

Turns out cosmic-comp's focus refresh decides that a context menu is not allowed to have focus while app-library is open. Since app-library opens with KeyboardInteractivity::Exclusive and refresh-focus has a rule that if a surface has exclusive keyboard interactivity then no pop up is a valid focus target, it ungrabs the pop up in the next tick.

The solution would be to check if the parent of the pop up is the surface with exclusive keyboard interactivity and allow it.

Our discussion in mattermost.


  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

@hojjatabdollahi
hojjatabdollahi marked this pull request as ready for review September 10, 2026 23:15
@hojjatabdollahi
hojjatabdollahi force-pushed the hojjat/fix-popup-exclusive branch from d877054 to 550d120 Compare September 15, 2026 22:30
@hojjatabdollahi
hojjatabdollahi force-pushed the hojjat/fix-popup-exclusive branch from 550d120 to 85f0902 Compare September 15, 2026 22:31

@ids1024 ids1024 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems correct to treat popups on an exclusive layer as valid keyboard targets.

@hojjatabdollahi

hojjatabdollahi commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor Author

For QA, this can be tested with pop-os/cosmic-app-library#408.

That PR without this fix:

recording-2026-09-15_17-44-07.mp4

With this fix:

recording-2026-09-15_17-52-19.mp4

@jacobgkau jacobgkau self-assigned this Sep 16, 2026
@jacobgkau
jacobgkau merged commit 651f701 into pop-os:master Sep 16, 2026
4 checks passed
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.

3 participants