Skip to content
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

implement focusable attribute for Window #4124

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

lunixbochs
Copy link
Contributor

@lunixbochs lunixbochs commented Feb 11, 2025

  • Tested on all platforms changed
  • Added an entry to the changelog module if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality

if focusable is false, a window won't take focus, even if you interact with it
this is very useful for always-on-top floating utility windows

@kchibisov
Copy link
Member

How keyboard input generally works with such windows or it doesn't and you have mostly pointer input?

@lunixbochs
Copy link
Contributor Author

Yeah, they don't take keyboard focus, which is a feature - it allows you to interact with the overlay window without taking focus away from the current app. Imagine an on-screen keyboard, for example, we need to be able to click the keyboard buttons but have keyboard input still go to the app in the background.

@madsmtm madsmtm added S - enhancement Wouldn't this be the coolest? DS - macos DS - windows DS - x11 S - api Design and usability labels Feb 24, 2025
Copy link
Member

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

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

macOS impl looks fine apart from the duplicated state. Requested changes because I'd like to see more docs, but am otherwise fine with the API.

@lunixbochs
Copy link
Contributor Author

@madsmtm rebased and addressed feedback, see last two commits in the force push

@lunixbochs lunixbochs force-pushed the focusable branch 2 times, most recently from 32501c9 to e294cf2 Compare March 10, 2025 14:45
Copy link
Member

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

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

Thanks, looks fine, only uncertain about is_focusable return value.

Copy link
Member

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

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

Thanks, I'll leave this open for a week or so (please remind me if I forget) for the other maintainers to comment on X11 and Windows impls (I've reviewed them myself, but it's hard for me to know if they're semantically correct).

@madsmtm madsmtm self-assigned this Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DS - macos DS - windows DS - x11 S - api Design and usability S - enhancement Wouldn't this be the coolest?
Development

Successfully merging this pull request may close these issues.

3 participants