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.9k stars 849 forks source link

Keyboard focus follow movetoworkspace #575

Open spikespaz opened 2 years ago

spikespaz commented 2 years ago

I have follow_mouse = 2, where keyboard focus stays with the focused window but mouse focus moves with the mouse. The only reason I want this is so that my scroll wheel works on the browser, but I can still type in the editor on another monitor.

Unfortunately I've noticed some issues with this. The Rofi window looses focus if for example, Discord is launching behind it. I can elaborate if needed, but this is a digression.

The actual feature request I want to make is as follows.

When no_cursor_warps = true, moving a window to another workspace behaves as expected, and the cursor retains its position. That is fine, because the mouse cursor has follow_mouse = 2 anyway. But I would like keyboard focus to move with the window, so that I can continue using the bind without needing to re-focus the window. This only happens when the window moves to another minitor's workspace AFAIK.

I have a hard time describing the issue because I'm not sure how the innards work. But here are the settings I believe to be relevant:

    monitor = eDP-1,preferred,1080x1920,1
    monitor = DP-1,preferred,0x1920,1
    monitor = ,preferred,auto,1

    general {
      no_cursor_warps = true
    }

    input {
      follow_mouse = 2
      float_switch_override_focus = false
    }

    bind = SUPERSHIFT,mouse_up,movetoworkspace,e+1
    bind = SUPERSHIFT,mouse_down,movetoworkspace,e-1

    bind = SUPERSHIFT,page_down,movetoworkspace,e+1
    bind = SUPERSHIFT,page_up,movetoworkspace,e-1
vaxerski commented 2 years ago

in short: focus follows mouse 2 and no warps, if movey window to another workspace with a keybindo, it no retaino focuso, yes?

spikespaz commented 2 years ago

Correct

spikespaz commented 2 years ago

What is the code for mouse button 5 and 4? Not able to find it in XCB

vaxerski commented 2 years ago

use wev

spikespaz commented 2 years ago

Is VFR buggy? When I use movewindow with the arrow keys it seems that the screen only updates when I move the cursor. New issue or known?

vaxerski commented 2 years ago

probably issue on your side. for me it works fine. the only known issue with VFR is #351

spikespaz commented 2 years ago

I like you, good human

izmyname commented 2 weeks ago

Is it still actual?