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

XWayland applications do not have the correct keyboard layout set #8481

Open
1 task done
frebib opened this issue Nov 15, 2024 · 1 comment
Open
1 task done

XWayland applications do not have the correct keyboard layout set #8481

frebib opened this issue Nov 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@frebib
Copy link

frebib commented Nov 15, 2024

Already reported ? *

  • I have searched the existing open and closed issues.

Regression?

Yes

System Info and Version

System/Version info
Hyprland 0.45.0 built from branch  at commit  dirty ().
Date:
Tag: , commits:
built against aquamarine 0.4.3


flags set:
debug


System Information:
System name: Linux
Node name: frebib-PC
Release: 6.11.6-arch1-1
Version: #1 SMP PREEMPT_DYNAMIC Fri, 01 Nov 2024 03:30:41 +0000


GPU information:
0a:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 31 [Radeon RX 7900 XT/7900 XTX/7900 GRE/7900M] [1002:744c] (rev cc) (prog-if 00 [VGA controller])


os-release: NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo


plugins:

======Config-Start======


Config File: /home/frebib/.config/hypr/hyprland.conf: Read Succeeded

# #######################################################################################
# AUTOGENERATED HYPR CONFIG.
# PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT,
# OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS.
# #######################################################################################

# This is an example Hyprland config file.
# Refer to the wiki for more information.
# https://wiki.hyprland.org/Configuring/Configuring-Hyprland/

# Please note not all available settings / options are set here.
# For a full list, see the wiki

# You can split this configuration into multiple files
# Create your files separately and then link them to this file like this:
# source = ~/.config/hypr/myColors.conf

# See https://wiki.hyprland.org/Configuring/Keywords/

################
### MONITORS ###
################

# See https://wiki.hyprland.org/Configuring/Monitors/
#monitor=,preferred,auto,auto
source = ~/.config/hypr/monitors.conf


#################
### AUTOSTART ###
#################

# Autostart necessary processes (like notifications daemons, status bars, etc.)
# Or execute your favorite apps at launch like this:

exec-once = systemd-run --user --unit=swww --slice=session swww-daemon
exec-once = systemd-run --user start waybar copyq

# exec-once = $terminal
# exec-once = nm-applet &
# exec-once = waybar & hyprpaper & firefox


#############################
### ENVIRONMENT VARIABLES ###
#############################

# See https://wiki.hyprland.org/Configuring/Environment-variables/

env = XCURSOR_SIZE,24
env = HYPRCURSOR_SIZE,24


#####################
### LOOK AND FEEL ###
#####################

# Refer to https://wiki.hyprland.org/Configuring/Variables/

# https://wiki.hyprland.org/Configuring/Variables/#general
general {
    gaps_in = 8
    gaps_out = 24

    border_size = 0

    # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors
    col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
    col.inactive_border = rgba(595959aa)

    # Set to true enable resizing windows by clicking and dragging on borders and gaps
    resize_on_border = false

    # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
    allow_tearing = false

    layout = dwindle
}

# https://wiki.hyprland.org/Configuring/Variables/#decoration
decoration {
    rounding = 9

    # Change transparency of focused and unfocused windows
    active_opacity = 1.0
    inactive_opacity = 0.6

    # https://wiki.hyprland.org/Configuring/Variables/#shadow
    shadow {
        enabled = true
        range = 24
        scale = 1
        #offset = 0 8
        render_power = 2
        ignore_window = true
        color = rgba(00000035)
    }

    # https://wiki.hyprland.org/Configuring/Variables/#blur
    blur {
        enabled = true
        size = 8
        passes = 3
        ignore_opacity = true

        vibrancy = 0.1696
    }
}

# https://wiki.hyprland.org/Configuring/Variables/#animations
animations {
    enabled = true

    # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more

    bezier = opening, 0.05, 0.9, 0.1, 1.05

    animation = windows, 1, 3, opening
    animation = border, 1, 10, default
    #animation = borderangle, 1, 8, default
    animation = workspaces, 1, 6, default
    animation = fade, 1, 5, default
    animation = fadeSwitch, 1, 5, default
    animation = fadeDim, 1, 9, default
    animation = fadeOut, 1, 2, default
}

# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
dwindle {
    pseudotile = true # Master switch for pseudotiling. Enabling is bound to mod + P in the keybinds section below
    preserve_split = true # You probably want this
}

# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
master {
    new_status = master
}

# https://wiki.hyprland.org/Configuring/Variables/#misc
misc {
    force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers
    disable_hyprland_logo = true # If true disables the random hyprland logo / anime girl background. :(
}


#############
### INPUT ###
#############

# https://wiki.hyprland.org/Configuring/Variables/#input
input {
    kb_layout = gb
    kb_variant = dvorak
    kb_model =
    kb_options =
    kb_rules =

    follow_mouse = 1

    sensitivity = 0 # -1.0 - 1.0, 0 means no modification.

    touchpad {
        natural_scroll = true
    }
}

# https://wiki.hyprland.org/Configuring/Variables/#gestures
gestures {
    workspace_swipe = true
    workspace_swipe_fingers = 3
}

# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
device {
    name = epic-mouse-v1
    sensitivity = -0.5
}


###################
### KEYBINDINGS ###
###################

# See https://wiki.hyprland.org/Configuring/Keywords/
$mod = SUPER # Sets "Windows" key as main modifier

# See https://wiki.hyprland.org/Configuring/Binds/ for more bindings
bind = $mod, M, exit,
bind = $mod, Apostrophe, killactive,
bind = $mod, U, togglefloating,
bind = $mod, P, pseudo, # dwindle
bind = $mod, F, fullscreen
bind = $mod, Period, togglesplit, # dwindle

bind = $mod, Space, exec, systemd-run-i3 fuzzel --launch-prefix=systemd-run-i3 --list-executables-in-path
bind = $mod, B, exec, systemd-run-i3 firefox
bind = $mod, Return, exec, systemd-run-i3 alacritty
bind = $mod&Shift, Return, exec, systemd-run-i3 alacritty --working-directory="$(hyprcwd)"
bind = $mod&Control_L, Return, exec, systemd-run-i3 alacritty --class=floating
bind = $mod&Shift&Control_L, Return, exec, systemd-run-i3 alacritty --class=floating --working-directory="$(hyprcwd)"
bind = , Print, exec, hyprshot -m region --clipboard-only

bindnip = , Pause, pass, ^(TeamSpeak 3)$

# Move focus with mod + arrow keys
bind = $mod, left, movefocus, l
bind = $mod, right, movefocus, r
bind = $mod, up, movefocus, u
bind = $mod, down, movefocus, d

# Switch workspaces with mod + [0-9]
bind = $mod, 1, workspace, 1
bind = $mod, 2, workspace, 2
bind = $mod, 3, workspace, 3
bind = $mod, 4, workspace, 4
bind = $mod, 5, workspace, 5
bind = $mod, 6, workspace, 6
bind = $mod, 7, workspace, 7
bind = $mod, 8, workspace, 8
bind = $mod, 9, workspace, 9
bind = $mod, 0, workspace, 10

# Move active window to a workspace with mod + SHIFT + [0-9]
bind = $mod SHIFT, 1, movetoworkspace, 1
bind = $mod SHIFT, 2, movetoworkspace, 2
bind = $mod SHIFT, 3, movetoworkspace, 3
bind = $mod SHIFT, 4, movetoworkspace, 4
bind = $mod SHIFT, 5, movetoworkspace, 5
bind = $mod SHIFT, 6, movetoworkspace, 6
bind = $mod SHIFT, 7, movetoworkspace, 7
bind = $mod SHIFT, 8, movetoworkspace, 8
bind = $mod SHIFT, 9, movetoworkspace, 9
bind = $mod SHIFT, 0, movetoworkspace, 10

# Example special workspace (scratchpad)
bind = $mod, S, togglespecialworkspace, magic
bind = $mod SHIFT, S, movetoworkspace, special:magic

# Scroll through existing workspaces with mod + scroll
bind = $mod, mouse_down, workspace, e+1
bind = $mod, mouse_up, workspace, e-1

# Move/resize windows with mod + LMB/RMB and dragging
bindm = $mod, mouse:272, movewindow
bindm = $mod, mouse:273, resizewindow

# Laptop multimedia keys for volume and LCD brightness
bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
bindel = ,XF86MonBrightnessUp, exec, brightnessctl s 10%+
bindel = ,XF86MonBrightnessDown, exec, brightnessctl s 10%-

##############################
### WINDOWS AND WORKSPACES ###
##############################

# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules

# Example windowrule v1
# windowrule = float, ^(kitty)$

# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$

windowrulev2 = float, class:floating
windowrulev2 = suppressevent maximize, class:.* # You'll probably like this.

layerrule = blur, notifications

# vim: ft=dosini


Config File: /home/frebib/.config/hypr/monitors.conf: Read Succeeded
# Generated by nwg-displays on 2024-10-18 at 20:40:15. Do not edit manually.

monitor=desc:Dell Inc. DELL U2414H 3415X49B27LL,[email protected],1920x1920,1.0
monitor=desc:Dell Inc. DELL U2414H 9TG4662CCDHL,[email protected],1920x840,1.0
monitor=desc:Dell Inc. DELL U2414H 9TG4662CCDHL,transform,2
monitor=desc:Dell Inc. DELL U2414H 9TG464424YTL,[email protected],3840x1920,1.0
monitor=desc:Dell Inc. DELL U2414H 9TG463AR1KNL,[email protected],4087x0,1.0
monitor=desc:Dell Inc. DELL U2414H 9TG463AR1KNL,transform,1

======Config-End========

Description

I've been using Hyprland for a month or two now and ever since I started using it, I noticed that immediately after boot XWayland applications would seem to use en_US keyboard layout, despite the configuration being set both in hyprland's configuration file and also in the system Xorg configuration. Disconnecting and reconnecting my keyboard would fix this until the next reboot.

I booted up my computer today and I think it's the first time I'm using 0.45.0, and I cannot get XWayland applications to use the correct keyboard layout, at all. Reconnecting the keyboard does nothing.

Native wayland applications (alacritty, firefox, etc) are fine. Only xwayland are affected (teamspeak3, Android Studio, etc)

My configuration is


# https://wiki.hyprland.org/Configuring/Variables/#input
input {
    kb_layout = gb
    kb_variant = dvorak
    kb_model =
    kb_options =
    kb_rules =

    follow_mouse = 1

    sensitivity = 0 # -1.0 - 1.0, 0 means no modification.

    touchpad {
        natural_scroll = true
    }
}

Also /etc/X11/xorg.conf.d/00-keyboard.conf:

# Written by systemd-localed(8), read by systemd-localed and Xorg. It's
# probably wise not to edit this file manually. Use localectl(1) to
# update this file.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "gb"
        Option "XkbVariant" "dvorak"
EndSection
frebib@frebib-PC ~> localectl status
System Locale: LANG=en_GB.UTF-8
               LC_COLLATE=C
    VC Keymap: dvorak-uk
   X11 Layout: gb
    X11 Model: dvorak

What I actually get is en_US (note not gb without dvorak because the " and @ are in the US locations).

How to reproduce

Configure hyprland with input configuration as above
Launch hyprland from a fresh boot and open an xwayland application and notice that the incorrect keyboard layout is being set/used

Crash reports, logs, images, videos

I'm a big newb when it comes to hyprland (or Wayland in general).
If there's any specific logs or debugging I can provide to help repro or identify the issue.
Let me know.

Note I'm also AFK for a week after posting this (sorry)

@frebib frebib added the bug Something isn't working label Nov 15, 2024
@frebib
Copy link
Author

frebib commented Nov 22, 2024

Using setxkbmap seems to fix it, at least as a workaround

$ setxkbmap -print
WARNING: Running setxkbmap against an Xwayland server
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+us+inet(evdev)+capslock(none)"	};
	xkb_geometry  { include "pc(pc105)"	};
};

$ setxkbmap -layout gb -variant dvorak
WARNING: Running setxkbmap against an Xwayland server

$ setxkbmap -print
WARNING: Running setxkbmap against an Xwayland server
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+gb(dvorak)+inet(evdev)+capslock(none)"	};
	xkb_geometry  { include "pc(pc105)"	};
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant