Skip to content

[wayland] Do not show layout override warning when override is disabled #1390

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

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

Conversation

Jun-Amane
Copy link

This pull request consists of two commits:

  1. Prevents the Wayland self-diagnose routine from issuing layout override warnings when "allow overriding system XKB settings" is disabled by the user. Previously, users would receive a confusing message about "sending keyboard layout configuration" even if layout override was explicitly disabled.

  2. Refactors the layout diversity check logic in the same routine by replacing std::unordered_set<std::string> with std::optional<std::string>, which improves performance and clarity.

These changes improve both user experience and internal structure consistency, especially on non-KDE/GNOME compositors (e.g., Hyprland).

Tested with Fcitx5 under Arch Linux with Hyprland and verified the warning is correctly suppressed when override is disabled.

2025-07-21-220818_hyprshot

@wengxt
Copy link
Member

wengxt commented Jul 21, 2025

The meaning of such option is not what you think.

For sway case it's like to run

swaymsg input type:keyboard xkb_layout
swaymsg input type:keyboard xkb_variant

override xkb

please show ~/.config/fcitx5/profile if you think this is not correct.

@Jun-Amane
Copy link
Author

Thank you for the explanation!

After thinking more carefully about this behavior, I believe the root of the confusion lies in conflating two separate concepts:

  1. Defining multiple layouts in input method groups
  2. Overriding the compositor's XKB layout setting

Currently, even when the override feature is explicitly disabled, Fcitx still shows the notification:

"Sending keyboard layout configuration to Wayland compositor from Fcitx is not yet supported on current desktop..."

This message may give users the impression that something is wrong or misconfigured — even though in reality, they've intentionally disabled override setting and expect layout switching to be handled themself or internally by Fcitx.

To improve clarity and avoid misleading users, I’d like to suggest refining the logic slightly:

  • If override option is enabled, and the compositor does not support it:
    Show a helpful message like:

    "Your input method groups contain multiple layouts. Since your system does not support layout synchronization, Fcitx will switch layouts internally."
    (Optionally, include a link to relevant documentation.)

  • If override option is disabled, regardless of compositor support:
    Suppress the notification, since users have already chosen to manually manage layouts (e.g. via compositor hotkeys or external configuration).

This way, the notification serves its original purpose — helping users configure things correctly — without confusing those who already know what they’re doing.

Let me know if this sounds reasonable. I’d be happy to help with a patch or further discussion if needed!

@wengxt
Copy link
Member

wengxt commented Jul 25, 2025

Sorry I misunderstand the overrideXkb here, it's the wayland's config, not the global config one.

I think the change makes sense, but just FYI the notification service, that support "action', it should have a button says "don't show this again'.

It is actually supported by your notification service, but it can only be shown in a not very straight forward way. Check the manual of your notification.

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.

2 participants