Skip to content

BaseCard: Move focus to the first focusable child on grab_focus - #912

Open
dklima wants to merge 4 commits into
elementary:mainfrom
dklima:card-grab-focus
Open

dklima wants to merge 4 commits into
elementary:mainfrom
dklima:card-grab-focus

Conversation

@dklima

@dklima dklima commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #907

The cards can't take focus, and in GTK 4 grab_focus () on them doesn't pass the focus to a child. So the password entry never got focus.

UserCard now focuses the password entry after the form reveal animation ends. Before that the form isn't mapped, and the entry can't take focus.

Test:

  1. Lock the session (Super+L) and press a key.
  2. Type the password without a click or Tab.
  3. Switch to another user and back, then type again.

Tested on Fedora 44, GTK 4.22.5, Wayland. Keyboard focus also needs elementary/gala#2937.

@vjr

vjr commented Sep 25, 2026

Copy link
Copy Markdown
Member

@dklima appears to work for me, even without the gala patch, but there's a linter error, i dont know how/where that came from, can you fix that? remove using Meta; near the top of compositor/WindowManager.vala?

i can then approve and merge both PRs, if there's a regression or complaints, the devs can yell.

@vjr
vjr requested review from a team, lenemter and leolost2605 September 25, 2026 10:02
@vjr

vjr commented Sep 25, 2026

Copy link
Copy Markdown
Member

Maybe you only need to pull/update your fork and update your branch?

@dklima

dklima commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Fixed in 47b6505. I removed using Meta; and added the Meta. prefix where necessary. The error is not from this PR: the file is the same on main. An update of the branch does not fix it, because main has no new commits.

@ryonakano

Copy link
Copy Markdown
Member

@dklima

Fixed in 47b6505. I removed using Meta; and added the Meta. prefix where necessary. The error is not from this PR: the file is the same on main. An update of the branch does not fix it, because main has no new commits.

Thank you for your fix! Would you cherry-pick your commit into a new branch and open a new PR fot that since it's out of the topic of this branch?

@dklima

dklima commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

Done. I moved the lint fix to #913 and removed it from this branch.

@dklima

dklima commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

@dklima appears to work for me, even without the gala patch

@vjr Thank you for the test. On my system, the gala patch is necessary. I did another A/B test (to make sure) on Fedora 44 (Wayland, gala 8.6.1, GTK 4.22.5), with this PR installed both times:

Which distro, session type (Wayland or X11), and gala version did you use? Maybe your compositor gives focus to desktop windows in a different way.

@vjr

vjr commented Sep 28, 2026

Copy link
Copy Markdown
Member

Which distro, session type (Wayland or X11), and gala version did you use? Maybe your compositor gives focus to desktop windows in a different way.

I'm running elementary OS9 daily but the classic apt-based installer, secure/wayland session, gala reports 8.6.1, everything is likely from main branches so even if gala says it's 8.6.1 it may have newer unreleased patches committed. I think there's no harm in merging this PR anyway though, subject to dev approval.

@leolost2605 leolost2605 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.

Instead of overriding grab focus shouldn't we just call grab_focus on the password entry?

@dklima

dklima commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, that works. I removed the override. UserCard now focuses the password entry after the reveal animation ends.

I tested it on Fedora 44 (Wayland): the lock screen, and a switch between two users. I didn't test a user without a password or a locked user.

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.

Password entry is not focused by default

4 participants