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
20k stars 851 forks source link

Strange cursor shift bug #6418

Closed DADA30000 closed 1 week ago

DADA30000 commented 3 months ago

Bug or Regression?

Bug

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit 1423707dbefc0329e80895451903a77ab684f7ea (). Date: 2024-06-09 Tag: , commits: flags: (if any) System Information: System name: Linux Node name: nixos Release: 6.6.32 Version: #1-NixOS SMP PREEMPT_DYNAMIC Sat May 25 14:22:56 UTC 2024 GPU information: Flags: bus master, VGA palette snoop, 66MHz, medium devsel, latency 64, NUMA node 0, IOMMU group 11 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU117 [GeForce GTX 1650] [10de:1f82] (rev a1) (prog-if 00 [VGA controller]) os-release: ANSI_COLOR="1;34" BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues" BUILD_ID="24.11.20240607.051f920" DOCUMENTATION_URL="https://nixos.org/learn.html" HOME_URL="https://nixos.org/" ID=nixos IMAGE_ID="" IMAGE_VERSION="" LOGO="nix-snowflake" NAME=NixOS PRETTY_NAME="NixOS 24.11 (Vicuña)" SUPPORT_URL="https://nixos.org/community.html" VERSION="24.11 (Vicuña)" VERSION_CODENAME="vicuña" VERSION_ID="24.11" plugins: hyprexpo by Vaxry ver 1.0 ======Config-Start====== Config File: /home/l0lk3k/.config/hypr/hyprland.conf: Read Succeeded exec-once = /nix/store/bnipzdfv788l7yvgn7k7s7gp76sd1zpz-dbus-1.14.10/bin/dbus-update-activation-environment --systemd DISPLAY HYPRLAND_INSTANCE_SIGNATURE WAYLAND_DISPLAY XDG_CURRENT_DESKTOP && systemctl --user stop hyprland-session.target && systemctl --user start hyprland-session.target plugin=/nix/store/s145q9rlxxdrn6y1n2j63l6izglyhggs-hyprexpo-0.1/lib/libhyprexpo.so env = GTK_THEME,Materia-dark env = XCURSOR_THEME,Bibata-Modern-Classic env = ENABLE_VKBASALT,1 env = FZF_DEFAULT_COMMAND,locate ~ env = QT_STYLE_OVERRIDE,kvantum env = GDK_BACKEND,wayland,x11 env = CLUTTER_BACKEND,wayland env = MOZ_ENABLE_WAYLAND,1 env = MOZ_DISABLE_RDD_SANDBOX,1 env = _JAVA_AWT_WM_NONREPARENTING=1 env = QT_AUTO_SCREEN_SCALE_FACTOR,1 env = QT_QPA_PLATFORM,wayland;xcb env = LIBVA_DRIVER_NAME,nvidia env = GBM_BACKEND,nvidia-drm env = __GLX_VENDOR_LIBRARY_NAME,nvidia #env = WLR_NO_HARDWARE_CURSORS,1 env = __NV_PRIME_RENDER_OFFLOAD,1 env = __VK_LAYER_NV_optimus,NVIDIA_only env = PROTON_ENABLE_NGX_UPDATER,1 env = NVD_BACKEND,direct env = __GL_GSYNC_ALLOWED,1 env = __GL_VRR_ALLOWED,1 env = WLR_DRM_NO_ATOMIC,1 env = WLR_USE_LIBINPUT,1 env = MOZ_X11_EGL,1 env = VDPAU_DRIVER,nvidia env = EDITOR,nvim env = VISUAL,nvim env = __GL_MaxFramesAllowed,1 env = TERMINAL,kitty bind=ALT,R,submap,passthrough submap=passthrough bind=,escape,submap,reset submap=reset monitor=Unknown-1,disabled monitor=HDMI-A-1,1920x1080@60,0x0,1 windowrule=animation [popin] ([default]), ^(wlogout)$ windowrulev2 = immediate, class:^(org.freedesktop.Xwayland)$ windowrule=windowdance,title:^(Rhythm Doctor)$ windowrule=noanim, class:^(ueberzugpp)$ windowrule=noanim, title:^(ueberzugpp)$ windowrule=forceinput,title:^(Rhythm Doctor)$ windowrule=float,^(org.kde.polkit-kde-authentication-agent-1)$ #windowrulev2 = opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$ #windowrulev2 = noanim,class:^(xwaylandvideobridge)$ #windowrulev2 = nofocus,class:^(xwaylandvideobridge)$ #windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$ #windowrulev2 = noborder,fullscreen:1 windowrule=opacity 0.99 0.99,^(Thunderbird)$ # windowrule=xray on,^(VencordDesktop)$ #windowrulev2 = forcergbx, class:firefox #windowrule=xray on,^(firefox)$ #windowrule = opacity 0.85 override 0.85 override, title:^(.*)$ windowrule = opacity 0.99 override 0.99 override, ^(firefox)$ windowrule = opacity 0.99 override 0.99 override, ^(floorp)$ windowrule = opacity 0.99 override 0.99 override, ^(mercury-default)$ windowrule = opacity 0.99 override 0.99 override, ^(filezilla)$ exec-once = ulimit -c 0 exec-once = /nix/store/$(echo $(ls -la /nix/store | grep polkit-gnome | grep '^d' | awk '{print $9}') | cut -d ' ' -f 1)/libexec/polkit-gnome-authentication-agent-1 # exec-once = /usr/bin/swaylock --screenshots --config ~/.config/swaylock/config exec-once = /usr/lib/xdg-desktop-portal-hyprland & waybar & hyprpaper & firefox & swaync & vesktop --enable-blink-features=MiddleClickAutoscroll --enable-features=UseOzonePlatform --ozone-platform=wayland exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP exec-once = sleep 10; gpu-screen-recorder -w screen -q ultra -a "$(pactl get-default-sink).monitor" -f 60 -r 300 -c mp4 -o ~/Games/Replays # exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 exec-once = wl-paste --type text --watch cliphist store #Stores only text data exec-once = wl-paste --type image --watch cliphist store #Stores only image data # exec = killall mpvpaper; mpvpaper -p -o "no-audio loop" HDMI-A-1 wallpapers/wall2.mp4 #exec-once = killall swww-daemon -9; swww init; ~/.config/hypr/process-wallpaper/wallpaper.sh #exec-once = /usr/bin/swaylock --screenshots --config ~/.config/swaylock/config env = XCURSOR_SIZE,24 env = LIBVA_DRIVER_NAME,nvidia env = XDG_SESSION_TYPE,wayland env = GBM_BACKEND,nvidia_drm env = __GLX_VENDOR_LIBRARY_NAME,nvidia input { kb_layout = us,ru kb_variant = kb_model = kb_options = grp:alt_shift_toggle kb_rules = repeat_delay = 200 follow_mouse = 1 touchpad { natural_scroll = false } sensitivity = 1 # -1.0 - 1.0, 0 means no modification. # force_no_accel = true accel_profile = flat } general { gaps_in = 5 gaps_out = 5 border_size = 0 col.active_border = rgb(4575da) rgb(6804b5) col.inactive_border = rgb(595959) layout = dwindle allow_tearing = false } decoration { rounding = 10 blur { enabled = true popups = true popups_ignorealpha = 0.0 ignore_opacity = true size = 10 brightness = 0.8 passes = 3 noise = 0 vibrancy = 0 } drop_shadow = yes shadow_range = 4 shadow_render_power = 3 col.shadow = rgba(1a1a1aee) } animations { enabled = true first_launch_animation = true bezier = slidein, 0.39, 0.575, 0.565, 1 bezier = myBezier, 0.05, 0.9, 0.1, 1.05 bezier = linear, 0.0, 0.0, 0.0, 0.0 bezier = woosh, 0.445, 0.05, 0, 1 # animation = borderangle, 1, 40, linear, loop animation = windowsMove, 1, 5, default # 7 animation = layers, 1, 2, woosh, slide animation = windowsIn, 1, 2, woosh, slide # 3 animation = windows, 1, 7, default, slide # 7 animation = windowsOut, 1, 5, woosh, slide # 7 animation = fadeSwitch, 1, 7, default # 7 animation = fadeOut, 1, 5, linear # 5 animation = workspaces, 1, 4, woosh, slide # 8 } debug { enable_stdout_logs = false disable_logs = true } 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_is_master = true } gestures { # See https://wiki.hyprland.org/Configuring/Variables/ for more workspace_swipe = false } misc { enable_swallow = true animate_manual_resizes = false animate_mouse_windowdragging = false swallow_regex = ^(kitty|lutris|alacritty)$ swallow_exception_regex = ^(ncspot)$ force_default_wallpaper = 2 # Set to 0 to disable the anime mascot wallpapers } binds { scroll_event_delay = 50 } $mainMod = SUPER bind = $mainMod_CTRL, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy bind = , Print, exec, hyprshot -m region bind = SHIFT, Print, exec, hyprshot -m window bind = ALT, Print, exec, hyprshot -m output bind = CTRL, Print, exec, hyprshot -m region -r | swappy -f - bind = CTRL_SHIFT, Print, exec, hyprshot -m window -r | swappy -f - bind = CTRL_ALT, Print, exec, hyprshot -m output -r | swappy -f - bind = $mainMod, F1, exec, gamemode.sh bind = $mainMod, F2, exec, sheesh.sh bind = $mainMod_CTRL, Q, exec, neovide --frame none +term +startinsert "+set laststatus=0 ruler" "+set cmdheight=0" "+map :tabnew +term" bind = $mainMod, O, exec, killall -SIGUSR1 .waybar-wrapped bind = $mainMod, Q, exec, kitty bind = $mainMod_CTRL, C, exec, hyprctl kill bind = $mainMod, C, killactive, bind = $mainMod, M, exec, wlogout -b 2 -L 500px -R 500px -c 30px -r 30px, bind = $mainMod, E, exec, nemo bind = $mainMod, V, togglefloating, bindr = $mainMod, $mainMod_L, exec, pkill rofi || $(rofi -show drun -show-icons) #ulauncher-toggle #pkill ulauncher || $(exec $(ulauncher)) bindr = $mainMod_CTRL, $mainMod_L, exec, pkill rofi || $(rofi -show run) #pkill tofi || $(tofi-run) # bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle bind = $mainMod_CTRL, R, exec, killall -SIGUSR1 gpu-screen-recorder && notify-send "GPU-Screen-Recorder" "Повтор успешно сохранён" bind = $mainMod, F, exec, hyprctl dispatch fullscreen bind = $mainMod_CTRL, F, fakefullscreen bind = $mainMod, Space, hyprexpo:expo, toggle bind = $mainMod_ALT, mouse_down, exec, hyprctl keyword misc:cursor_zoom_factor "$(hyprctl getoption misc:cursor_zoom_factor | grep float | awk '{print $2 + 1}')" bind = $mainMod_ALT, mouse_up, exec, hyprctl keyword misc:cursor_zoom_factor "$(hyprctl getoption misc:cursor_zoom_factor | grep float | awk '{print $2 - 1}')" bind = $mainMod_CTRL, mouse_down, exec, hyprctl keyword misc:cursor_zoom_factor "$(hyprctl getoption misc:cursor_zoom_factor | grep float | awk '{print $2 + 100}')" bind = $mainMod_CTRL, mouse_up, exec, hyprctl keyword misc:cursor_zoom_factor "$(hyprctl getoption misc:cursor_zoom_factor | grep float | awk '{print $2 - 100}')" bind = $mainMod, left, movefocus, l bind = $mainMod, right, movefocus, r bind = $mainMod, up, movefocus, u bind = $mainMod, down, movefocus, d 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 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, S, togglespecialworkspace, magic bind = $mainMod SHIFT, S, movetoworkspace, special:magic bind = $mainMod, mouse_down, workspace, e+1 bind = $mainMod, mouse_up, workspace, e-1 bindm = $mainMod, mouse:272, movewindow layerrule = blur,waybar layerrule = blur,swaync-notification-window bindm = $mainMod, mouse:273, resizewindow exec-once=hyprctl setcursor Bibara-Modern-Classic 24 layerrule = ignorezero, waybar layerrule = ignorezero, swaync-notification-window layerrule = blur, swaync-control-center layerrule = ignorezero, swaync-control-center layerrule = ignorezero, rofi layerrule = blur, notifications layerrule = blur, gtk-layer-shell layerrule = blur, logout_dialog layerrule = blur, launcher layerrule = blur, wofi layerrule = noanim, selection layerrule = blur, rofi layerrule = animation [slidevert], swaync-control-center plugin { hyprexpo { columns = 3 gap_size = 5 bg_col = rgb(111111) workspace_method = first 1 # [center/first] [workspace] e.g. first 1 or center m+1 enable_gesture = true # laptop touchpad, 4 fingers gesture_distance = 300 # how far is the "max" gesture_positive = true # positive = swipe down. Negative = swipe up. } } ======Config-End======== ```

Description

When I first start a game, the cursor works normally, but when I switch to another workspace and then go back, this bug happens

How to reproduce

https://drive.google.com/file/d/1ZjKEWt0yB9huvo2CbWzvQ9EW95-9tIds/view?usp=sharing

Crash reports, logs, images, videos

No response

varris1 commented 3 months ago

duplicate? https://github.com/hyprwm/Hyprland/issues/4867

DADA30000 commented 3 months ago

duplicate? #4867

nope, that issue is about games not locking cursor, in my issue problem is that when I click, the cursor teleports to other location, as seen when I, for example, try to open settings in cyberpunk after switching workspaces

DADA30000 commented 3 months ago

duplicate? #4867

and my issue can be reproduced every time, it's not an occasional issue

DADA30000 commented 3 months ago

duplicate? #4867

and my issue can be reproduced every time, it's not an occasional issue

Okay, I was actually wrong about this, I can't replicate this right now, maybe these issues are similar

DADA30000 commented 3 months ago

Oh, and it's here again, this bug is kinda random

GamaunG commented 3 months ago

same problem: https://youtu.be/BWujP4T6bKk my Hyprland config is here had to remove cursor_inactive_timeout = 0, hide_cursor_on_touch = true, cursor_zoom_factor = 1.0, cursor_zoom_rigid = false after the update.

Seercat3160 commented 3 months ago

It seems that it only occurs (the cursor moves) when I click a mouse button. It only started happening on v0.41.0.

I've observed it in Team Fortress 2 and Warfork, both running fullscreen. I have not observed it when not running a program fullscreen.

DADA30000 commented 3 months ago

It seems that it only occurs (the cursor moves) when I click a mouse button. It only started happening on v0.41.0.

It seems that it only occurs (the cursor moves) when I click a mouse button. It only started happening on v0.41.0.

yeah, I tried to show that in my video, forgot to actually write about it

lucasreis1 commented 3 months ago

I've seen something similar on firefox after v0.41 where the cursor skips some frames and even ignores some mouse movements altogether. Also running on nvidia. It seems that disabling the hardware cursor has helped:

cursor {
  no_hardware_cursors = true
}
Liassica commented 3 months ago

I also get this issue in Team Fortress 2 whenever I click and in Morrowind whenever I close my inventory or a container.

DADA30000 commented 3 months ago

I've seen something similar on firefox after v0.41 where the cursor skips some frames and even ignores some mouse movements altogether. Also running on nvidia. It seems that disabling the hardware cursor has helped:

cursor {
  no_hardware_cursors = true
}

I think that's a separate issue

vaxerski commented 3 months ago

can someone bisect this?

Seercat3160 commented 3 months ago

https://github.com/hyprwm/Hyprland/commit/addd3e7f1aeb670dd91d26005aaeccce3efb1ae7 is the first bad commit

Liassica commented 3 months ago

addd3e7 is the first bad commit

The issues I was having still happen on the commit before this.

Seercat3160 commented 3 months ago

The issues I was having still happen on the commit before [addd3e7].

I can't reproduce that, personally.

nadomodan commented 3 months ago

Is this the same bug? Also happens after workspace switching. Dark Souls Remastered, Steam https://files.catbox.moe/ievto2.mp4 I can move camera using mouse movement just fine but when I press mouse button to perform the sword swing the camera suddenly snaps to another direction, more visible in the second half of video.

Similar in Hades, can't record a video but here's explanation. hades First I press mouse button with cursor at red dot, attack is launched towards that position (correct) Then I move mouse cursor to yellow dot position, press keyboard key to launch another attack but instead of being aimed there it still launches toward last mouse click position (red dot)

fixed in v0.41.2 for me

nkeor commented 3 months ago

I also see this on Apex Legends, sometimes going back and forth between workspaces several times temporarily fixes it. Clicking any mouse button seems to reset the cursor origin, making the view spin.

kennyaja commented 3 months ago

From my own testing, commit 2566d81 seems to have fixed this issue.

Here are the results of my testing on osu!lazer running under XWayland (results remain the same with the game in fullscreen)


(notice the cursor magically teleporting when clicking after I move to another workspace and back)

https://github.com/hyprwm/Hyprland/assets/121273982/afd40a6b-b000-420e-a055-2939510b5e7e


(notice the cursor now working properly when I do the same thing as above)

https://github.com/hyprwm/Hyprland/assets/121273982/937e337b-a424-437d-b5c7-a9c8ab881921

DADA30000 commented 3 months ago

I can't test this right now because every game after switching workspaces just freezes for me lol (except osu, I didn't have this problem with cursor in osu even before tho, I think because I actually use it in wayland mode)

Seercat3160 commented 3 months ago

I can't reproduce anymore in v0.41.2, personally

DADA30000 commented 3 months ago

I guess the issue is resolved, closing the issue

Liassica commented 3 months ago

The issue I'm having with Morrowind still happens as of latest git (718afe271ecebfe6711453b9cfee90fa49a7e761) and occurs even if I don't switch workspaces, so perhaps my issue is similar but unrelated. Luckily I'm able to work around it using Gamescope, so it's not a big deal.

https://github.com/hyprwm/Hyprland/assets/115422798/57e5b6df-5eee-46fb-b919-2885e327a703

FlafyDev commented 3 months ago

Still experiencing this issue on 9c5dd59d4b1927b7d88e8e3c2e260eb01d95794b. happening with Minecraft and Overwatch.

FlafyDev commented 3 months ago

@DADA30000 can this be reopened?

DADA30000 commented 3 months ago

@DADA30000 can this be reopened?

Oh ok, reopening

Cloudperry commented 1 month ago

This Kwin MR seems to have fixed some problems with games running under Wine Xwayland. I used to have a problem with Apex Legends where the camera snaps to the ground, but I think that MR fixed it on Plasma. Could Hyprland do something similar to fix some of these problems?

Cloudperry commented 1 month ago

@vaxerski Is the fix in that Kwin MR above relevant for Hyprland? I think it fixed many issues especially with weird camera snapping in FPS games.

vaxerski commented 1 month ago

IIRC we already do this

DADA30000 commented 1 month ago

This Kwin MR seems to have fixed some problems with games running under Wine Xwayland. I used to have a problem with Apex Legends where the camera snaps to the ground, but I think that MR fixed it on Plasma. Could Hyprland do something similar to fix some of these problems?

you sure you're on git?