qtile icon indicating copy to clipboard operation
qtile copied to clipboard

cursor_warp makes impossible to put back a browser tab on chrome window (maybe any other browse)

Open erlonbie opened this issue 3 years ago • 45 comments

Issue description

When using multi monitors, I find it very useful to change cursor position when changing focus of workspaces and windows.

But as you can see in the video, that's an undesired behavior. As the title already says, I can't put it back.

Other minor issues

When I click, holding CTRL, on a link to open a new tab inside a browser, for example, the cursor goes back to the center of that window.

If i click on someone's profile picture inside telegram-desktop, the cursor also goes back to the center of the window (in this case is indeed a new window because of the way telegram handles this situation specifically).

Thee might be a lot of other examples, but that's the general idea.

Wish list

It would be very nice (at least for me) if we could change this behavior on specifics windows, or if I could invoke a function (with lazy?) that centers the cursor manually when switch to a window or workspace.

Other

If there is documentation for the issue that I'm pointing here, I apologize, but I did a little bit of research before posting this issue.

I'm not demanding the devs to solve my problem, and by the fact that english is not my native language, I'm afraid I'm being a little rude.

https://user-images.githubusercontent.com/50176483/147363025-07b54054-bd96-4fe3-8024-ea7803bb35a2.mp4

Configuration

My config is very long and I don't want to pollute this post, but I can confirm that cursor_warp = True

erlonbie avatar Dec 24 '21 16:12 erlonbie

Hi @erlonbie ,

Don't worry, you're not being rude at all!

I'll be honest, however, I can't see anything in your video at all so I'm not sure what the problem is. The video is just a black screen for me.

elParaguayo avatar Dec 24 '21 16:12 elParaguayo

@elParaguayo I just noticed that, sorry! In the preview tab was everything normal. How can I upload the video?

can you access this link? https://user-images.githubusercontent.com/50176483/147363025-07b54054-bd96-4fe3-8024-ea7803bb35a2.mp4

erlonbie avatar Dec 24 '21 16:12 erlonbie

Thanks. That video works.

Yes, that behaviour does look very annoying!

I'll see if I can take a look later. Hopefully there's an easy fix for it.

elParaguayo avatar Dec 24 '21 16:12 elParaguayo

Thanks. That video works.

Yes, that behaviour does look very annoying!

I'll see if I can take a look later. Hopefully there's an easy fix for it.

Thank you in advance!

erlonbie avatar Dec 24 '21 16:12 erlonbie

I just realized that I posted an issue in Christmas eve, I'm very sorry about that! 😅

(Merry Christmas to all of you and thank you for the great work in qtile! 🎄)

erlonbie avatar Dec 24 '21 16:12 erlonbie

Boas Festas!

elParaguayo avatar Dec 24 '21 17:12 elParaguayo

I just saw this and decided to try it, i can't replicate that behavior in firefox.

Also thanks for the part of the config that i needed to change for the cursor to move when i change focus, i was just seeking for that

Lunatik00 avatar Dec 24 '21 18:12 Lunatik00

i think an important part of your configuration here is the keybindings, that might be the reason for this behavior

Lunatik00 avatar Dec 24 '21 18:12 Lunatik00

Ok, i did find a weird behavior, i went and moved windows from one screen to the other, when i was in the middle of the second screen it moved my cursor, it also did the same when trying to change windows, i think it might be trying to warp the cursor in events that are undesirable, like while dragging something from one screen to another, or when changing focus of windows, i hope my testings help a little

Lunatik00 avatar Dec 24 '21 18:12 Lunatik00

If I set cursor_warp=True I get this behaviour.

elParaguayo avatar Dec 24 '21 18:12 elParaguayo

I tried a few more things, finally i get that, if i set

follow_mouse_focus = False
bring_front_click = False
cursor_warp = True

i get most issues kinda solved, but i still get that the window on top would not change when i try to use another window, if i add bring_front_click = True then i might or might not be able to change windows, depending on if i have a widow maximized or not that leads me to believe it is more about the different configurations interacting with each other, i have not read the code enough to make a good conclusion, but now i can add that the behavior changes depending on other configuration parameters

Lunatik00 avatar Dec 24 '21 19:12 Lunatik00

Yeah. It's to do with windows being focused.

elParaguayo avatar Dec 24 '21 19:12 elParaguayo

That's how this parameters are set for me.

image

(just in case my image does not loads properly) follow_mouse_focus = True bring_front_click = False cursor_warp = True

If I change bring_front_click = True, I still get the same behavior.

erlonbie avatar Dec 24 '21 19:12 erlonbie

Try changing follow_mouse_focus to True, that one is the one that caused more unexpected behavior, there also might be other options interacting, those where the ones i tried

Lunatik00 avatar Dec 24 '21 19:12 Lunatik00

Have found another time when this is annoying: triple-clicking to select all text in LibreOffice Calc warps the cursor back to the centre!

elParaguayo avatar Dec 24 '21 19:12 elParaguayo

I have follow_mouse_focus = False so maybe that is linked to this.

EDIT: no. Still happens if I set this to True.

elParaguayo avatar Dec 24 '21 19:12 elParaguayo

I think this is to do with handling of the focus event. The cursor warps when the window is told to focus but we probably only want to do this if the window isn't already focused.

elParaguayo avatar Dec 24 '21 19:12 elParaguayo

I think this is to do with handling of the focus event. The cursor warps when the window is told to focus but we probably only want to do this if the window isn't already focused.

This would already solve a lot of annoyances !

erlonbie avatar Dec 24 '21 19:12 erlonbie

Have posted a fix for this. Would be great if someone could test (no rush - enjoy time with families etc.!)

elParaguayo avatar Dec 25 '21 06:12 elParaguayo

Hello @elParaguayo , I've updated to 0.19.1.dev6+g12efb431 (running qtile --version). Nothing has changed apparently.

erlonbie avatar Dec 25 '21 14:12 erlonbie

It's not committed. You'd need to apply the PR and test locally.

elParaguayo avatar Dec 25 '21 14:12 elParaguayo

How do I do this? I've never done that before.

In last case, I might change it manually since is just a few lines of code that need to be modified.

EDIT: It solved the issues that I pointed, but cursor_warp is not functioning as it should be.

image

For example: If I switch to other workspace (lazy.next_screen()), the cursor should center that workspace. The same applies to lazy.group.next_window(), it should center the focused window, but that's not happening.

erlonbie avatar Dec 25 '21 15:12 erlonbie

Yeah. It's not working properly. I'll keep looking.

elParaguayo avatar Dec 25 '21 17:12 elParaguayo

Hopefully I've got it this time.

elParaguayo avatar Dec 26 '21 22:12 elParaguayo

Hopefully I've got it this time.

image

I did the changes you made, but it didn't solve it for me. Now is occurring new bugs xD

I'll show up in the next message

erlonbie avatar Dec 27 '21 02:12 erlonbie

https://user-images.githubusercontent.com/50176483/147427386-5346b5f3-29dd-4fdf-a537-b6709193575b.mp4

  1. Windows are not growing until some window is focused
  2. Same issue of not being able to put a chrome tab back
  3. In the end if you look at the top left corner, you'll see I'm switching workspace (calling lazy.next_screen() and lazy.prev_screen()), but the mouse cursor stays in the same place.

Ctrl+click to open a new tab is working fine though

I'm feeling a little bad about this issue, I don't know if it is taking too much of your time, sorry!

(off topic: these default emojis are bad, they're just there because every oh-my-bash update restores them to default )

erlonbie avatar Dec 27 '21 02:12 erlonbie

Don't feel sad - let's see if we can fix it!

elParaguayo avatar Dec 27 '21 08:12 elParaguayo

OK - try this next approach.

As for putting Chrome tabs back. I can't actually do this if I have cursor_warp set to False. Did it ever work for you?

elParaguayo avatar Dec 27 '21 08:12 elParaguayo

I tried here and is working almost as expected!

If I set cursor_warp = False, I'm able to put chrome tabs in place normally.

If I set cursor_warp = True, I'm not able to put chrome tabs in place (the issue persists). But, for this specific issue I think we should not focus so much effort, because (I just discovered) you're able to put it back with a right click on the "alone" tab, and select an option to move to an already existing window (I'm pretty satisfied with that).

The only missing thing is when I change workspace with lazy.next_screen() and lazy.prev_screen(), the mouse cursor should change position to the focused window in that specific workspace, but it is not moving/changing.

In other hand, lazy.group.next_window() and lazy.group.prev_window() are working as they should! The same applies to lazy.screen.next_group() and lazy.screen.prev_group()

erlonbie avatar Dec 27 '21 17:12 erlonbie

Great. We're getting closer! Let me try a few more things.

elParaguayo avatar Dec 27 '21 21:12 elParaguayo