Skip to content

Conversation

curoviyxru
Copy link
Contributor

No description provided.

helper = new WindowInteropHelper(this);
Handle = helper.Handle;

WindowHelper.SetWindowNoActivate(Handle);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why? Generally AppBars should be able to take focus.

Copy link
Contributor Author

@curoviyxru curoviyxru Mar 7, 2022

Choose a reason for hiding this comment

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

If it will take a focus, Windows-like layout switcher located on menu bar wouldn't able to switch current layout language for focused window. (because it will take focus for itself)
It doesn't matter when keyboard layout is system-wide in Windows. (but if layout is window-wide that will cause some problems that I had encountered)
We can remember last window that was focused before Cairo and then change it layout, but it will be a strange workaround imo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Taskbar.behavior.mp4
Cairo.behavior.mp4
Cairo.behavior.without.WS_EX_NOACTIVATE.mp4

Copy link
Contributor

Choose a reason for hiding this comment

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

The AppBar should still take focus (e.g., so you can change the input method for Cairo when searching), what shouldn't take focus is only the input indicator (e.g., so that you can change the input method for the current app window if enabled).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about this way, but how it could be implemented?

p.s. interesting to find out, why it should take focus?

Copy link
Contributor

Choose a reason for hiding this comment

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

Try to make sure that the input indicator control does not receive focus when clicked.

If I remember correctly, some AppBars, as in RetroBar, need focus for the windows to be behind the taskbar.

@curoviyxru
Copy link
Contributor Author

Ah, I forgot about different layout types, so I'm implementing it now...

@curoviyxru
Copy link
Contributor Author

There is no way to get KLID (keyboard layout ID) from HKL (locale identifier) or current KLIDs list, that's bad. So the only workaround is... switch to every layout and get every KLID for layout type determining. Also we can't get localized keyboard layout names. :(

@josuave
Copy link
Collaborator

josuave commented Mar 7, 2022

I did some work a while back attempting this with Cairo. Let me see if I can see what I got locally.

@dremin
Copy link
Collaborator

dremin commented Jan 16, 2024

I did some work a while back attempting this with Cairo. Let me see if I can see what I got locally.

@josuave Did you find this by chance?

xoascf added a commit to xoascf/ManagedShell that referenced this pull request Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants