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
21.22k stars 895 forks source link

Focus doesn't follow mouse on workspace switch #8232

Closed winkelnp closed 2 days ago

winkelnp commented 2 days ago

Already reported ? *

Regression?

No

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit 4520b30d498daca8079365bdb909a8dea38e8d55 (version: bump to 0.44.1). Date: Wed Oct 9 12:54:39 2024 Tag: v0.44.1, commits: 5309 built against aquamarine 0.4.3 flags: (if any) System Information: System name: Linux Node name: archlinux Release: 6.11.5-arch1-1 Version: #1 SMP PREEMPT_DYNAMIC Tue, 22 Oct 2024 18:31:38 +0000 GPU information: 03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Phoenix4 [1002:1901] (rev c2) (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/winkel/.config/hypr/hyprland.conf: Read Succeeded # This is an example Hyprland config file. # # Refer to the wiki for more information. # # Please note not all available settings / options are set here. # For a full list, see the wiki # Some default env vars. envd = XCURSOR_SIZE,24 envd = QT_QPA_PLATFORMTHEME,qt6ct # change to qt6ct if you have that # Source a file (multi-file configs) source = ~/.config/hypr/monitors.conf # generated by nwg-displays source = ~/.config/hypr/exec.conf source = ~/.config/hypr/bind.conf source = ~/.config/hypr/windowrules.conf # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input { kb_layout = de,gb # kb_variant = nodeadkeys, kb_model = kb_options = kb_rules = numlock_by_default = true resolve_binds_by_sym = false # this means that all binds will act like first layout is active repeat_delay = 600 # ms follow_mouse = 1 touchpad { natural_scroll = true tap-to-click = true drag_lock = true tap-and-drag = true disable_while_typing = true scroll_factor = 1.0 } sensitivity = 0 # -1.0 - 1.0, 0 means no modification. # accel_profile # [adaptive/flat/custom] # force_no_accel = false left_handed = false } general { border_size = 2 no_border_on_floating = false gaps_in = 5 gaps_out = 20 gaps_workspaces = 0 # stacks with gaps_out col.inactive_border = rgba(595959aa) col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg no_focus_fallback = false resize_on_border = false extend_border_grab_area = 15 hover_icon_on_border = true resize_corner = 0 # for floating windows, which corner is resized from layout = dwindle # layout = master # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on allow_tearing = false } decoration { # See https://wiki.hyprland.org/Configuring/Variables/ for more rounding = 10 active_opacity = 1.0 inactive_opacity = 1.0 fullscreen_opacity = 1.0 drop_shadow = false # power saving # drop_shadow = true # shadow_range = 4 # shadow_render_power = 3 # shadow_ignore_window = true # col.shadow = rgba(1a1a1aee) # col.shadow_inactive # unset by default # shadow_offset = [0,0] # shadow_scale = 1.0 dim_inactive = false dim_strength = 0.5 dim_special = 0.2 dim_around = 0.4 # screen_shader # path to a custom shader blur { enabled = false # power saving :/ # enabled = true # size = 10 # passes = 1 # ignore_opacity = false # new_optimizations = true # xray = true # noise = 0.0117 # contrast = 0.8916 # 0.0-2.0 # brightness = 0.8172 # 0.0-2.0 # vibrancy = 0.1696 # vibrancy_darkness = 0.0 # special = false # popups = false # popups_ignorealpha = 0.2 } } animations { enabled = true # 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 force_split = 0 # [0,1,2] = [mouse,left/up,right/down] preserve_split = true # you probably want this smart_split = false # split each window in direction of mouse smart_resizing = true no_gaps_when_only = 0 # [0,1,2] = [off,no border, with border] use_active_for_splits = true default_split_ratio = 1.0 # 0.1-1.9 # split_bias = 0 # [0,1,2] = [positional,current,opening] } master { # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more new_status = inherit } gestures { # See https://wiki.hyprland.org/Configuring/Variables/ for more workspace_swipe = true workspace_swipe_fingers = 3 workspace_swipe_min_fingers = false workspace_swipe_distance = 300 # px workspace_swipe_touch = false workspace_swipe_invert = true # on touchpad workspace_swipe_touch_invert = true # on touchscreen workspace_swipe_min_speed_to_force = 30 workspace_swipe_cancel_ratio = 0.5 workspace_swipe_create_new = true workspace_swipe_direction_lock = true workspace_swipe_direction_lock_threshold = 10 workspace_swipe_forever = false workspace_swipe_use_r = false # if false, skip empty workspaces } misc { # See https://wiki.hyprland.org/Configuring/Variables/ for more force_default_wallpaper = 0 disable_splash_rendering = false col.splash = rgb(0,0,0) font_family = Sans # splash_font_family vrr = 0 # variable refresh rate [0,1,2] = [off,on,fullscreen-only] vfr = true # Power Saving # mouse_move_enables_dpms = true # key_press_enables_dpms = true always_follow_on_dnd = true # follow focus on drag'n'drop animate_manual_resizes = false animate_mouse_windowdragging = false disable_autoreload = false # if true, reload with hyprctl reload focus_on_activate = false # focus on window that requests to be mouse_move_focuses_monitor = true allow_session_lock_restore = false # allow restarting locker close_special_on_empty = true new_window_takes_over_fullscreen = 2 # [0,1,2] = [behind,takeover,unfullscreen] exit_window_retains_fullscreen = false # closing fullscreen window makes next one fullscreen initial_workspace_tracking = 1 # [0,1,2] = [off,single-shot,persistent] middle_click_paste = true render_unfocused_fps = 15 } binds { disable_keybind_grabbing = false # if true, windows cant grab keybinds window_direction_monitor_fallback = true } xwayland { enabled = true use_nearest_neighbor = true force_zero_scaling = true # disable scaling } render { explicit_sync = 2 # [0,1,2] = [no,yes,auto] explicit_sync_kms = 2 direct_scanout = false } Config File: /home/winkel/.config/hypr/monitors.conf: Read Succeeded # Generated by nwg-displays on 2024-10-10 at 04:19:18. Do not edit manually. monitor=eDP-1,1920x1200@60.0,1920x296,1.25 monitor=HDMI-A-1,1920x1080@60.0,0x0,1.0 Config File: /home/winkel/.config/hypr/exec.conf: Read Succeeded # Execute your favorite apps at launch exec-once = waybar # exec-once = swaybg -i /usr/share/backgrounds/gnome/adwaita-d.jpg exec-once = hyprpaper # exec-once = wlsunset -t 3200 -S 9:00 -s 19:30 exec-once = wlsunset -t 3200 -l 49 -L 8 # exec-once = sh ~/.config/hypr/scripts/sleep exec-once = hypridle exec-once = dunst # exec-once = /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=whatsapp-for-linux --file-forwarding com.github.eneshecan.WhatsAppForLinux @@u %u @@ exec-once = /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=zapzap --file-forwarding com.rtosta.zapzap @@u %u @@ #exec-once = exec --no-startup-id /usr/lib/pam_kwallet_init #exec-once = sleep 15 && DESKTOP_SESSION=kde KDE_SESSION_VERSION=5 "/usr/bin/nextcloud" --background exec-once = sleep 15 && "/usr/bin/nextcloud" --background exec-once = /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=signal-desktop --file-forwarding org.signal.Signal --start-in-tray @@u %U @@ exec-once = flatpak run --command=/app/libexec/deja-dup/deja-dup-monitor org.gnome.DejaDup #exec-once = /usr/bin/emacs --daemon && sleep 0.2 && emacsclient -c -e "(save-buffers-kill-terminal)" exec-once = kdeconnect-indicator exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 exec-once = xwaylandvideobridge exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP DISPLAY SWAYSOCK XAUTHORITY QT_QPA_PLATFORMTHEME=qt6ct #exec-once = gnome-keyring-daemon --start --components=secrets exec-once = sh ~/.config/hypr/scripts/monitorConnect # exec-once = steam # Rebind copilot key to right control exec-once = sudo evsieve --input "/dev/input/by-path/platform-i8042-serio-0-event-kbd" grab persist=reopen --hook key:leftmeta key:leftshift key:f23 sequential period=0.032 send-key=key:rightctrl --withhold key:leftmeta key:leftshift key:f23 --output create-link="/dev/input/by-path/platform-i8042-serio-0-event-kbd-evsieve" # Set programs that you use $terminal = kitty $fileManager = dolphin --new-window $menu = wofi $browser = firefox $mail = flatpak run org.mozilla.Thunderbird $home = dolphin ~ $calc = gnome-calculator exec-once = hyprctl dispatch focusmonitor 1 exec-once = [workspace 2 silent] $home exec-once = [workspace 4 silent] $browser exec-once = [workspace 1 silent] $terminal -e btop exec-once = [workspace 5 silent] $mail exec-once = hyprctl dispatch workspace 3 Config File: /home/winkel/.config/hypr/bind.conf: Read Succeeded # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainMod, Q, exec, $terminal bind = $mainMod, w, killactive, bind = $mainmod ALT, Delete, exec, nwg-bar bind = $mainMod, Delete, exec, nwg-bar bind = $mainMod, E, exec, $fileManager bind = $mainMod, V, togglefloating, bind = $mainMod, R, exec, $menu bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, T, togglesplit, # dwindle bind = $mainMod, a, pin bind = $mainMod, adiaeresis, exec, emacsclient -nc -a '' bind = $mainMod, b, exec, $browser bind = $mainMod, m, exec, $mail # bind = $mainMod, i, exec, XDG_CURRENT_DESKTOP=gnome gnome-control-center bind = $mainMod, c, exec, networkmanager_dmenu # Move focus with mainMod + arrow keys bind = $mainMod, h, movefocus, l bind = $mainMod, j, movefocus, d bind = $mainMod, k, movefocus, u bind = $mainMod, l, movefocus, r bind = $mainMod, Tab, cyclenext, bind = $mainMod, Tab, bringactivetotop, bind = $mainMod, Space, exec, hyprctl switchxkblayout at-translated-set-2-keyboard next bind = $mainMod, Space, exec, hyprctl switchxkblayout logitech-wireless-keyboard-pid:4023 next # Move windows with mainMod + Shift + vim keys bind = $mainMod SHIFT, h, movewindow, l bind = $mainMod SHIFT, j, movewindow, d bind = $mainMod SHIFT, k, movewindow, u bind = $mainMod SHIFT, l, movewindow, r bind = $mainMod SHIFT, o, centerwindow bind = $mainMod, f, fullscreen bind = $mainMod SHIFT, f, fullscreenstate, 0 2 # Resize windows with mainMod + Control + vim keys bind = $mainMod CTRL, h, resizeactive, -50 0 bind = $mainMod CTRL, j, resizeactive, 0 50 bind = $mainMod CTRL, k, resizeactive, 0 -50 bind = $mainMod CTRL, l, resizeactive, 50 0 bind = $mainMod CTRL, o, splitratio, exact 1 # Switch workspaces with mainMod + [0-9] 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 # Move active window to a workspace with mainMod + SHIFT + [0-9] 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 CTRL, 1, movetoworkspacesilent, 1 bind = $mainMod CTRL, 2, movetoworkspacesilent, 2 bind = $mainMod CTRL, 3, movetoworkspacesilent, 3 bind = $mainMod CTRL, 4, movetoworkspacesilent, 4 bind = $mainMod CTRL, 5, movetoworkspacesilent, 5 bind = $mainMod CTRL, 6, movetoworkspacesilent, 6 bind = $mainMod CTRL, 7, movetoworkspacesilent, 7 bind = $mainMod CTRL, 8, movetoworkspacesilent, 8 bind = $mainMod CTRL, 9, movetoworkspacesilent, 9 bind = $mainMod CTRL, 0, movetoworkspacesilent, 10 # Move Current Workspace to Monitor bind = $mainMod ALT, 1, movecurrentworkspacetomonitor, 0 bind = $mainMod ALT, 2, movecurrentworkspacetomonitor, 1 # Example special workspace (scratchpad) bind = $mainMod, S, togglespecialworkspace bind = $mainMod SHIFT, S, movetoworkspace, special # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, mouse_down, workspace, e-1 bind = $mainMod, mouse_up, workspace, e+1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow # Right click menu # bind = , mouse:273, exec, $menu # Media Control bind = , XF86AudioRaiseVolume, exec, sh ~/.config/hypr/scripts/volume --inc bind = , XF86AudioLowerVolume, exec, sh ~/.config/hypr/scripts/volume --dec bind = , XF86AudioMicMute, exec, sh ~/.config/hypr/scripts/volume --toggle-mic bind = , XF86AudioMute, exec, sh ~/.config/hypr/scripts/volume --toggle bind = , XF86AudioPlay, exec, playerctl play-pause bind = , XF86AudioPause, exec, playerctl play-pause bind = , XF86AudioStop, exec, playerctl stop bind = , XF86AudioNext, exec, playerctl next bind = , XF86AudioPrev, exec, playerctl previous # Special Keyboard Buttons bind = , XF86Calculator, exec, $calc bind = , XF86Mail, exec, $mail bind = , XF86HomePage, exec, $home bind = , XF86Sleep, exec, systemctl suspend # Screenshot bind = , Print, exec, grimblast --notify --freeze copysave output $HOME"/Pictures/Screenshots/Screenshot from "$(date '+%Y-%m-%d')" "$(date '+%H-%M-%S.png') bind = SHIFT, Print, exec, grimblast --notify --freeze copysave area $HOME"/Pictures/Screenshots/Screenshot from "$(date '+%Y-%m-%d')" "$(date '+%H-%M-%S.png') # Clipboard exec-once = wl-paste --watch cliphist store # bind = $mainMod SHIFT, v, exec, cliphist list | wofi --dmenu | cliphist decode | wl-copy bind = $mainMod SHIFT, v, exec, nwg-clipman # Other Function keys # bind = , code:133, exec, swaylock -f -c 000000 bind = , XF86MonBrightnessDown, exec, sh ~/.config/hypr/scripts/backlight dec bind = , XF86MonBrightnessUp, exec, sh ~/.config/hypr/scripts/backlight inc #bind = $mainMod, P, exec, nwg-displays # Disable Laptop Display when lid is closed # bindl = ,switch:off:Lid Switch,exec, hyprctl keyword monitor "eDP-1,1920x1200@60.0,1920x296,1.25" # bindl = ,switch:on:Lid Switch,exec, hyprctl keyword monitor "eDP-1,disable" Config File: /home/winkel/.config/hypr/windowrules.conf: Read Succeeded # Example windowrule v1 # windowrule = float, ^(kitty)$ windowrule = float, Calculator # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more windowrulev2 = suppressevent maximize, class:.* # You'll probably like this. windowrulev2 = workspace 1 silent, monitor 0, class:^(gnome-system-monitor)$ windowrulev2 = workspace 1 silent, monitor 0, class:^(btop)$ windowrulev2 = float,,title:^(Bluetooth Devices)$ windowrulev2 = float,,title:^(blueman-manager)$ windowrulev2 = float,,title:^(Nextcloud)$ windowrulev2 = stayfocused,,title:^(Nextcloud)$ # Game Windows windowrulev2 = tile,,title:^(Xbox Cloud Gaming)(.*) windowrulev2 = tile,,title:^(Fallout Shelter)$ windowrulev2 = float,,title:^(Progress)$ # Steam windowrulev2 = float,,title:^(Steam Setup)$ # Thunderbird's annoying notifications, fixed (left in in case they come back) #windowrulev2 = float,class:^(org.mozilla.Thunderbird)$,title:^()$ #windowrulev2 = pin,class:^(org.mozilla.Thunderbird)$,title:^()$ #windowrulev2 = move 100%-w-10 40,class:^(org.mozilla.Thunderbird)$,title:^()$ windowrulev2 = float,,title:^(Picture-in-Picture)$ windowrulev2 = pin,,title:^(Picture-in-Picture)$ windowrulev2 = float,,title:^(About ) #windowrulev2 = float,,title:^(About Mozilla Firefox)$ #windowrulev2 = float,,title:^(About Mozilla Thunderbird)$ windowrulev2 = idleinhibit fullscreen, fullscreen:1 windowrulev2 = stayfocused,class:^(wofi)$ windowrulev2 = float,class:^(nm-connection-editor)$,title:^(Editing) windowrulev2 = stayfocused,class:^(org.kde.dolphin)$,title:^(Folder Already Exists) # xwaylandvideobridge (from wiki) windowrulev2 = opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$ windowrulev2 = noanim,class:^(xwaylandvideobridge)$ windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$ windowrulev2 = maxsize 1 1,class:^(xwaylandvideobridge)$ windowrulev2 = noblur,class:^(xwaylandvideobridge)$ windowrulev2 = float,class:^(xwaylandvideobridge)$ windowrulev2 = workspace 1 silent, monitor 0,class:^(xwaylandvideobridge)$ ======Config-End======== ```

Description

On switching workspaces to and back focus returns to original focused window, but cursor doesn't follow.

focus only moves to the hovered window when mouse is moved

what I'd've expected to happen would be either the mouse snaps to centre of original focused window or the focus moves to the hovered window.

How to reproduce

  1. Open multiple windows in a workspace
  2. Use keybind to switch to another (empty) workspace
  3. Move cursor to what would be another window in the original workspace
  4. Switch back to original workspace with keybind

Crash reports, logs, images, videos

https://github.com/user-attachments/assets/db462bf0-c6ea-4c54-b0d3-458092812220

vaxerski commented 2 days ago

this is expected behavior. It focuses the last window focused on that workspace.

winkelnp commented 2 days ago

I guess that would make this a feature request: would it be possible for the mouse to then snap to that window?

vaxerski commented 2 days ago

feel free to open an issue for that