Git Product home page Git Product logo

Comments (9)

BrianCArnold avatar BrianCArnold commented on June 17, 2024 1

Also, +1 to this as an issue, although I would actually prefer to be able to have my cursor warp between windows when changing between windows in a workspace. Basically, I want "Always warp" rather than "Never warp".

Ideally, a configuration option to allow configuration along the lines of hy3:cursor_warp with at least 3 settings:

  • 0: No cursor warping
  • 1: Cursor Warping between workspaces
  • 2: Cursor Warping between workspaces and windows.

from hy3.

outfoxxed avatar outfoxxed commented on June 17, 2024 1

that clears this up some, along with the comment. this would be because we use a custom dispatcher which dosen't do the same thing as the normal one. @BrianCArnold it would probably make sense to bring all 3 into hyprland itself and just use the same setting.

from hy3.

BrianCArnold avatar BrianCArnold commented on June 17, 2024

Note: This is actually called "Cursor Warping", rather than "Cursor Wrapping". The configuration variable is called general:no_cursor_warps

(Adding this comment both for correctness and so that other users will be able to find it by searching)

from hy3.

AhuracMusic avatar AhuracMusic commented on June 17, 2024

Note: This is actually called "Cursor Warping", rather than "Cursor Wrapping". The configuration variable is called general:no_cursor_warps

(Adding this comment both for correctness and so that other users will be able to find it by searching)

No way I'm realizing this now, how come I have been saying the wrong word for so long...

from hy3.

BrianCArnold avatar BrianCArnold commented on June 17, 2024

I actually think I was wrong with the three settings, I believe the standard settings as they stand in Hyprland may functionally mirror the settings desired, switching workspaces without warping the cursor doesn't seem to make much sense.

When switching from an active workspace to another workspace, I can't imagine there would often be a scenario where the desired behavior is leaving focus on the previous workspace and window.

In single display environments, when switching to a different workspace, the cursor is already effectively "changing position" because the window it was previously over would have already disappeared, as it was only visible on the other workspace.

In multiple display environments, it would be possible for the previous workspace to remain visible, however I would think that changing workspaces would (nearly) always imply changing window focus.

If the hy3 plugin simply changed to obey the existing warping setting, and warped the cursor to (any|the most recently focused window on that workspace) the two functional modes would be "cursor follows window focus on workspace change" and "cursor always follows window focus". I believe this should mirror both Sway and Hyprland functionality.

This approach would also not necessitate any additional settings in the schema, only requiring users who despire disabling warping to add the setting.

from hy3.

BrianCArnold avatar BrianCArnold commented on June 17, 2024

Note: [...]

No way I'm realizing this now, how come I have been saying the wrong word for so long...

Honestly, I've made the same mistake MANY times, it's kind of natural because of how close the words are. I think "cursor jumping" might have ended up causing less confusion, but for all I know that's a different feature I'm not using.

from hy3.

BrianCArnold avatar BrianCArnold commented on June 17, 2024

@AhuracMusic Here's my workaround to warp the mouse:

In your binds (something like this, salt to taste):

bind = $mainMod, left, exec, ~/.config/hypr/scripts/MoveFocus.sh l
bind = $mainMod, right, exec, ~/.config/hypr/scripts/MoveFocus.sh r 
bind = $mainMod, down, exec, ~/.config/hypr/scripts/MoveFocus.sh d 
bind = $mainMod, up, exec, ~/.config/hypr/scripts/MoveFocus.sh u 

~/.config/hypr/scripts/MoveFocus.sh

#!/bin/bash

hyprctl dispatch hy3:movefocus $1 >/dev/null

X=$(hyprctl activewindow -j | jq '(.size[0]/2 | floor) + .at[0]')
Y=$(hyprctl activewindow -j | jq '(.size[1]/2 | floor) + .at[1]')

hyprctl dispatch movecursor $X $Y >/dev/null

(note that this does require installing jq, but that should be in your distribution's repo, and if it isn't, you're running something esoteric enough that you know how to build it from source)

from hy3.

outfoxxed avatar outfoxxed commented on June 17, 2024

Added in 311939d.

from hy3.

AhuracMusic avatar AhuracMusic commented on June 17, 2024

Thanks a lot for adding this feature!

from hy3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.