hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
19.33k stars 805 forks source link

Can no longer interact with XWayland applications on secondary monitor using mouse after different secondary monitor has been disconnected and reconnected #6860

Open Ghosthree3 opened 1 month ago

Ghosthree3 commented 1 month ago

Regression?

No

System Info and Version

System/Version info ```sh Hyprland, built from branch main at commit f85c6416c6f5e56c75178ecb24c11e346069197d (renderer: fix a few xray regressions (6855)). Date: Sat Jul 13 07:05:19 2024 Tag: v0.41.2-32-gf85c6416, commits: 4918 flags: (if any) System Information: System name: Linux Node name: milkbar Release: 6.9.9-arch1-1 Version: #1 SMP PREEMPT_DYNAMIC Fri, 12 Jul 2024 00:06:53 +0000 GPU information: 0b:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] [1002:731f] (rev c1) (prog-if 00 [VGA controller]) 0c:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU104 [GeForce RTX 2070 SUPER] [10de:1e84] (rev a1) (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/ghost/.config/hypr/hyprland.conf: Read Succeeded # Hyprland config file # Environmental variables env = XDG_SESSION_TYPE,wayland env = XDG_SESSION_DESKTOP,Hyprland env = XDG_CURRENT_DESKTOP,Hyprland env = GDK_BACKEND,wayland,x11 env = QT_QPA_PLATFORM,wayland;xcb env = QT_AUTO_SCREEN_SCALE_FACTOR,1 env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1 env = QT_QPA_PLATFORMTHEME,qt6ct #env = SDL_VIDEODRIVER,x11 env = CLUTTER_BACKEND,wayland env = MOZ_ENABLE_WAYLAND,1 env = ECORE_EVAS_ENGINE,wayland_egl env = ELM_ENGINE,wayland_egl env = _JAVA_AWT_WM_NONREPARENTING,1 env = NO_AT_BRIDGE,1 env = XCURSOR_SIZE,24 exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP #monitor = DP-1, 1920x1080@144, 1440x0 , 1 #monitor = DP-2, 1440x900@60 , 0x340 , 1 monitor = DP-1, 1920x1080@144, 1920x0 , 1 monitor = DP-2, 1920x1080@60 , 0x100 , 1 monitor = DP-3, 1440x900@60 , 3840x320, 1 # Source a file (multi-file configs) # source = ~/.config/hypr/myColors.conf # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input { kb_layout = us kb_variant = kb_model = kb_options = kb_rules = numlock_by_default = true follow_mouse = 1 touchpad { natural_scroll = false } sensitivity = -0.75 # -1.0 - 1.0, 0 means no modification. } general { # See https://wiki.hyprland.org/Configuring/Variables/ for more border_size = 0 gaps_in = 0 gaps_out = 0 col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.inactive_border = rgba(595959aa) layout = dwindle } decoration { # See https://wiki.hyprland.org/Configuring/Variables/ for more rounding = 0 blur { enabled = false #size = 3 #passes = 1 } drop_shadow = false #shadow_range = 4 #shadow_render_power = 3 #col.shadow = rgba(1a1a1aee) } animations { enabled = false # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more bezier = myBezier, 0.05, 0.9, 0.1, 1.05 animation = windows, 1, 7, myBezier animation = windowsOut, 1, 7, default, popin 80% animation = border, 1, 10, default animation = borderangle, 1, 8, default animation = fade, 1, 7, default animation = workspaces, 1, 6, default } dwindle { # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more pseudotile = true # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = true # you probably want this } master { # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more new_status = master } gestures { # See https://wiki.hyprland.org/Configuring/Variables/ for more workspace_swipe = false } misc { force_default_wallpaper = 0 } binds { movefocus_cycles_fullscreen = false } # Example per-device config # See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more #device:epic-mouse-v1 { # sensitivity = -0.5 #} # Example windowrule v1 # windowrule = float, ^(kitty)$ # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more windowrulev2 = opacity 0.0 override,class:^(xwaylandvideobridge)$ windowrulev2 = noanim,class:^(xwaylandvideobridge)$ windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$ windowrulev2 = maxsize 1 1,class:^(xwaylandvideobridge)$ windowrulev2 = noblur,class:^(xwaylandvideobridge)$ # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER # Workspace Bindings bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 bind = $mainMod, 3, workspace, 3 bind = $mainMod, 4, workspace, 4 bind = $mainMod, 5, workspace, 5 bind = $mainMod, 6, workspace, 6 bind = $mainMod, 7, workspace, 7 bind = $mainMod, 8, workspace, 8 bind = $mainMod, 9, workspace, 9 bind = $mainMod, 0, workspace, 10 bind = $mainMod, KP_End, workspace, 11 bind = $mainMod, KP_Down, workspace, 12 bind = $mainMod, KP_Next, workspace, 13 bind = $mainMod, KP_Left, workspace, 14 bind = $mainMod, KP_Begin, workspace, 15 bind = $mainMod, KP_Right, workspace, 16 bind = $mainMod, KP_Home, workspace, 17 bind = $mainMod, KP_Up, workspace, 18 bind = $mainMod, KP_Prior, workspace, 19 bind = $mainMod, KP_Insert, workspace, 20 bind = $mainMod SHIFT ALT, left, movecurrentworkspacetomonitor, l bind = $mainMod SHIFT ALT, right, movecurrentworkspacetomonitor, r bind = $mainMod SHIFT ALT, up, movecurrentworkspacetomonitor, u bind = $mainMod SHIFT ALT, down, movecurrentworkspacetomonitor, d bind = $mainMod, mouse_down, workspace, e-1 bind = $mainMod, mouse_up, workspace, e+1 # Window Bindings bind = $mainMod SHIFT, 1, movetoworkspace, 1 bind = $mainMod SHIFT, 2, movetoworkspace, 2 bind = $mainMod SHIFT, 3, movetoworkspace, 3 bind = $mainMod SHIFT, 4, movetoworkspace, 4 bind = $mainMod SHIFT, 5, movetoworkspace, 5 bind = $mainMod SHIFT, 6, movetoworkspace, 6 bind = $mainMod SHIFT, 7, movetoworkspace, 7 bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 bind = $mainMod SHIFT, KP_End, movetoworkspace, 11 bind = $mainMod SHIFT, KP_Down, movetoworkspace, 12 bind = $mainMod SHIFT, KP_Next, movetoworkspace, 13 bind = $mainMod SHIFT, KP_Left, movetoworkspace, 14 bind = $mainMod SHIFT, KP_Begin, movetoworkspace, 15 bind = $mainMod SHIFT, KP_Right, movetoworkspace, 16 bind = $mainMod SHIFT, KP_Home, movetoworkspace, 17 bind = $mainMod SHIFT, KP_Up, movetoworkspace, 18 bind = $mainMod SHIFT, KP_Prior, movetoworkspace, 19 bind = $mainMod SHIFT, KP_Insert, movetoworkspace, 20 bind = $mainMod, left, movefocus, l bind = $mainMod, right, movefocus, r bind = $mainMod, up, movefocus, u bind = $mainMod, down, movefocus, d bind = $mainMod SHIFT, left, movewindow, l bind = $mainMod SHIFT, right, movewindow, r bind = $mainMod SHIFT, up, movewindow, u bind = $mainMod SHIFT, down, movewindow, d bind = $mainMod, R, submap, resize submap = resize binde = SHIFT, left, resizeactive, -10 0 binde = SHIFT, right, resizeactive, 10 0 binde = SHIFT, up, resizeactive, 0 -10 binde = SHIFT, down, resizeactive, 0 10 binde = , left, resizeactive, -5 0 binde = , right, resizeactive, 5 0 binde = , up, resizeactive, 0 -5 binde = , down, resizeactive, 0 5 binde = ALT, left, resizeactive, -1 0 binde = ALT, right, resizeactive, 1 0 binde = ALT, up, resizeactive, 0 -1 binde = ALT, down, resizeactive, 0 1 bind = , escape, submap, reset submap = reset bind = $mainMod SHIFT, Q, killactive bind = $mainMod, F, fullscreen bind = $mainMod, E, togglesplit # dwindle bind = $mainMod, P, pseudo # dwindle bind = $mainMod SHIFT, SPACE, togglefloating bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow # Media Bindings binde = , XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5% #increase sound volume binde = , XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -5% #decrease sound volume bind = , XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle # mute sound bind = , XF86AudioPlay, exec, playerctl play bind = , XF86AudioPause, exec, playerctl pause bind = , XF86AudioNext, exec, playerctl next bind = , XF86AudioPrev, exec, playerctl previous # Program Bindings bind = $mainMod, Return, exec, kitty bind = $mainMod, D, exec, kickoff #bind = $mainMod, D, exec, tofi-run | xargs hyprctl dispatch exec bind = $mainMod SHIFT, M, exit bind = , PRINT, exec, hyprshot -m region -o /tmp -f $(date +%s%3N).png bind = ALT, PRINT, exec, hyprshot -m window -o /tmp -f $(date +%s%3N).png bind = $mainMod, PRINT, exec, hyprshot -m output -o /tmp -f $(date +%s%3N).png # Global Hotkeys #bindn = , Control_L, pass, ^(discord)$ bindn = , F10, pass, ^(com\.obsproject\.Studio)$ # Startup Programs exec-once = /usr/lib/polkit-kde-authentication-agent-1 exec-once = xwaylandvideobridge exec-once = mako exec-once = waybar exec-once = easyeffects --gapplication-service exec-once = sleep 3 && keepassxc exec-once = [workspace 1 silent] librewolf exec-once = [workspace 9 silent] brave exec-once = [workspace 7 silent] discord exec-once = [workspace 3 silent] kitty exec-once = [workspace 8 silent] kitty exec-once = pactl set-sink-volume @DEFAULT_SINK@ 85% exec-once = pactl set-sink-volume easyeffects_sink 100% exec-once = pactl set-source-volume @DEFAULT_SOURCE@ 85% exec-once = pactl set-source-volume easyeffects_source 100% exec-once = send-ctrl-to-xwayland /dev/input/by-id/usb-04d9_USB_Keyboard-event-kbd # Hacks #windowrulev2 = nomaximizerequest,class:(mpv) ======Config-End======== ```

Description

I have three monitors, L M R. If I disconnect and then reconnect monitor L, XWayland applications on monitor R can no longer be interacted with using the mouse, and in fact, interacting with them causes mouse events to appear on XWayland applications present on monitor L. The issue isn't present while L is still disconnected, only when it is reconnected.

The windows are selected as the active window when hovering over them with the mouse, but internal hover and click events are broken and sent to monitor L. Keyboard events work completely normally while the window has focus.

I've found no way to fix this problem without restarting Hyprland, and the issue is not present for Wayland windows.

I do actually believe this is a regression, but as I cannot build back far enough to where it was not present (still exists in at least 0.41.0), I'm not marking it as such.

How to reproduce

Have three monitors, disconnect and reconnect the left most monitor (does not appear to happen in reverse if you disconnect the right most monitor), try to interact with XWayland applications on the right most monitor.

Crash reports, logs, images, videos

No response

vaxerski commented 1 month ago

likely from the xwayland rewrite.

DaRacci commented 1 month ago

Second this, it appears to be to do with disconnection or maybe just turning monitors on and off, as thats when this appears for me.

Ghosthree3 commented 1 month ago

or maybe just turning monitors on and off

This is because some monitors are naughty and stop reporting their EDID when soft powered off even though they're supposed to, it is effectively as if it has been disconnected.

vaxerski commented 1 month ago

can someone post the output of xrandr when this bug is active?

vaxerski commented 1 month ago

patch.txt also try this patch

Ghosthree3 commented 1 month ago

I just built master (first time building with AQ), can't reproduce the bug even without the patch. @DaRacci can you?

I did manage to get a hard crash while trying to though, once, wasn't able to reproduce it and the log was outputting to TTY unfortunately.

imxyy1soope1 commented 1 month ago

can someone post the output of xrandr when this bug is active?

without patch:

imxyy@imxyy-nix ~ $ nix run nixpkgs#xorg.xrandr   
Screen 0: minimum 16 x 16, current 5120 x 1440, maximum 32767 x 32767
DP-3 connected 2560x1440+2560+0 (normal left inverted right x axis y axis) 600mm x 340mm
   2560x1440     74.98*+
   1920x1440     74.95  
   1600x1200     74.98  
   1440x1080     74.92  
   1400x1050     74.87  
   1280x1024     74.90  
   1280x960      74.86  
   1152x864      74.82  
   1024x768      74.90  
   800x600       74.91  
   640x480       74.77  
   320x240       73.82  
   1920x1200     75.01  
   1680x1050     74.89  
   1440x900      74.98  
   1280x800      74.93  
   1152x720      74.94  
   960x600       74.84  
   928x580       74.92  
   800x500       74.87  
   768x480       74.71  
   720x480       74.51  
   640x400       74.23  
   320x200       73.70  
   2048x1152     74.97  
   1920x1080     74.99  
   1600x900      75.01  
   1368x768      74.90  
   1280x720      74.78  
   1024x576      74.80  
   864x486       74.89  
   720x400       74.89  
   640x350       74.53  
DP-2 connected 2560x1440+2560+0 (normal left inverted right x axis y axis) 600mm x 340mm
   2560x1440     74.98*+
   1920x1440     74.95  
   1600x1200     74.98  
   1440x1080     74.92  
   1400x1050     74.87  
   1280x1024     74.90  
   1280x960      74.86  
   1152x864      74.82  
   1024x768      74.90  
   800x600       74.91  
   640x480       74.77  
   320x240       73.82  
   1920x1200     75.01  
   1680x1050     74.89  
   1440x900      74.98  
   1280x800      74.93  
   1152x720      74.94  
   960x600       74.84  
   928x580       74.92  
   800x500       74.87  
   768x480       74.71  
   720x480       74.51  
   640x400       74.23  
   320x200       73.70  
   2048x1152     74.97  
   1920x1080     74.99  
   1600x900      75.01  
   1368x768      74.90  
   1280x720      74.78  
   1024x576      74.80  
   864x486       74.89  
   720x400       74.89  
   640x350       74.53
UjinT34 commented 1 month ago
Screen 0: minimum 16 x 16, current 4920 x 2160, maximum 32767 x 32767
DP-3 connected 3840x2160+2160+0 (normal left inverted right x axis y axis) 600mm x 340mm
   3840x2160    143.94*+
DP-2 connected 1080x1920+3840+0 left (normal left inverted right x axis y axis) 520mm x 290mm
   1920x1080     59.96*+ 

DP-2 has scale 2 and transform 1

Monitor DP-3 (ID 1):
        3840x2160@143.99899 at 0x0
Monitor DP-2 (ID 0):
        3840x2160@59.99700 at -1081x-500

Xwayland app parts that are on the left half of the DP-3 do not receive mouse input. Seems to be "covered" by DP-2

vaxerski commented 1 month ago

yes can someone try patch

UjinT34 commented 1 month ago

With patch Initial

Screen 0: minimum 16 x 16, current 6000 x 2160, maximum 32767 x 32767
DP-2 connected 1080x1920+0+0 left (normal left inverted right x axis y axis) 520mm x 290mm
   1920x1080     59.96*+
DP-3 connected 3840x2160+2160+0 (normal left inverted right x axis y axis) 600mm x 340mm
   3840x2160    143.94*+

DP-2 switched off

Screen 0: minimum 16 x 16, current 6000 x 2160, maximum 32767 x 32767
DP-3 connected 3840x2160+2160+0 (normal left inverted right x axis y axis) 600mm x 340mm
   3840x2160    143.94*+

On again

Screen 0: minimum 16 x 16, current 4920 x 2160, maximum 32767 x 32767
DP-3 connected 3840x2160+2160+0 (normal left inverted right x axis y axis) 600mm x 340mm
   3840x2160    143.94*+
DP-2 connected 1080x1920+3840+0 left (normal left inverted right x axis y axis) 520mm x 290mm
   1920x1080     59.96*+

Initial: DP-3 is placed on the right of DP-2 (correct) but the offset takes into account only rotation and ignores the scale. DP-2 off: DP-3 keeps the offset. Should be moved to +0+0? DP-2 on: DP-2 is placed on the right of DP-3 (incorrect) and the offset doesn't take into account the incorrect offset of DP-3

Ghosthree3 commented 1 month ago

I managed to reproduce the bug earlier somehow, but am again unable to, no idea what has changed to make it so inconsistent (it was guaranteed before). The moment I can figure out how to repro reliably I'll test the patch. It definitely still exists for me, it's just conditional now?

vaxerski commented 1 month ago

patch.txt how about this then

UjinT34 commented 1 month ago

patch.txt how about this then

Same.

Also with this bug steam starting splash is placed on the right edge of the screen instead of the center. Might be related to https://github.com/hyprwm/Hyprland/issues/6921

alba4k commented 1 day ago

Is this still being looked at? extremely annoying with steam games

vaxerski commented 1 day ago

I tagged it for 0.43.0. I am working on various stuff, but not this atm. If anyone else wants to try to fix this, feel free