New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focus does not follow window with directional move when focus_follows_mouse is enabled #3518

Open
JonnyHaystack opened this Issue Nov 10, 2018 · 19 comments

Comments

Projects
None yet
5 participants
@JonnyHaystack

JonnyHaystack commented Nov 10, 2018

I'm submitting a…

[x] Bug
[ ] Feature Request
[ ] Documentation Request
[ ] Other (Please describe in detail)

Expected Behavior

I have the following bindings:
bindsym $mod+Control+H move left
bindsym $mod+Control+L move right

When I use these to move a window from e.g. workspace 1 on my laptop display to workspace 2 on my monitor, I would expect the focus to follow the window as it moves. It is the usual behaviour for focus to follow the window as you move it left and right within a workspace, so I think it's reasonable to expect this to apply when moving it across a workspace with "move left" or "move right" (or even up and down if you have that kind of monitor layout).

Current Behavior

If in my example scenario, there is already one or more windows in workspace 2, the window focus ends up on one of them instead of the one I'm moving. This behaviour is quite annoying because I then have to pause to find out where the focus has moved to, then move it back to the window I was moving so I can continue moving it to the desired location. It's really not very intuitive.

Reproduction Instructions

To replicate:

  • 2 displays needed
  • Open one window on a workspace in primary display
  • Open a second window on another workspace in the secondary display
  • Use "move <left|down|up|right>" to move the window on the primary display to the workspace on the secondary display
  • Observe that focus has not followed the window being moved per the usual behaviour

Environment

Output of i3 --moreversion 2>&-:

i3 version: 4.16
i3 config: https://pastebin.com/mgE6BRwr
- Linux Distribution & Version: Ubuntu 18.04, Linux 4.15.0-38-generic
- Are you using a compositor (e.g., xcompmgr or compton): No

I also see that this issue has been raised before in #2257 (but not #809 which is a completely separate issue), and it seems it is definitely not the intended behaviour #2257 (comment) and yet it still remains...

Many thanks,
Jonathan

@i3bot

This comment has been minimized.

i3bot commented Nov 10, 2018

I don’t see a link to logs.i3wm.org. Did you follow https://i3wm.org/docs/debugging.html? (In case you actually provided a link to a logfile, please ignore me.)

@i3bot

This comment has been minimized.

i3bot commented Nov 10, 2018

Sorry, we can only support the latest major version. Please upgrade from 4.14 to 4.16, verify the bug still exists, and re-open this issue.

@JonnyHaystack

This comment has been minimized.

JonnyHaystack commented Nov 10, 2018

Sorry, we can only support the latest major version. Please upgrade from 4.14 to 4.16, verify the bug still exists, and re-open this issue.

Okay, done. But how do I re-open it...

@Airblader

This comment has been minimized.

Member

Airblader commented Nov 10, 2018

I could reopen it, but you already identified it as a duplicate, so there's no reason to have the same issue open twice. :)

@JonnyHaystack

This comment has been minimized.

JonnyHaystack commented Nov 10, 2018

@Airblader That's fair, but I think if the issues could be merged in some way that would be good because I took the time to write proper reproduction instructions. Also the other issue has been lying around for years without being resolved and I'm unsure of why that's happened. I can provide logs too if you think that will help.

@orestisf1993

This comment has been minimized.

Member

orestisf1993 commented Nov 10, 2018

Also the other issue has been lying around for years without being resolved and I'm unsure of why that's happened

Because it is not reproducible for any of us. Focus moves with the window being moved.

@orestisf1993

This comment has been minimized.

Member

orestisf1993 commented Nov 10, 2018

ohh, it only happens with focus_follows_mouse = yes?

@JonnyHaystack

This comment has been minimized.

JonnyHaystack commented Nov 10, 2018

@orestisf1993 quite possibly. I do use that option.

@orestisf1993 orestisf1993 changed the title from Focus ends up in the wrong place when moving windows across monitors to Focus does not follow window with directional move when focus_follows_mouse is enabled Nov 10, 2018

@orestisf1993 orestisf1993 reopened this Nov 10, 2018

@orestisf1993

This comment has been minimized.

Member

orestisf1993 commented Nov 10, 2018

Reopening to keep it separate from #2257 in case the causes are different. I also think that the behavior with mouse_warping is a bit problematic.

@Airblader

This comment has been minimized.

Member

Airblader commented Nov 10, 2018

Just to address this, I was gonna move the description to the other issue (since as you said you provided much better information, thanks!), but if we do keep this one open I won't do that now. :-)

@JonnyHaystack

This comment has been minimized.

JonnyHaystack commented Nov 10, 2018

Just to address this, I was gonna move the description to the other issue (since as you said you provided much better information, thanks!), but if we do keep this one open I won't do that now. :-)

Alright, thanks 😄 it's hard to know if it's the same cause or not because we don't know what the person who created the other issue had in his config file. Hopefully after resolution that could be sorted out.

@orestisf1993

This comment has been minimized.

Member

orestisf1993 commented Nov 10, 2018

In the video in #2257 it seems that they use focus_follows_mouse. It happens when the mouse ends up above a different window because of the directional move. I am pretty sure that they are the same issue now.

@orestisf1993

This comment has been minimized.

Member

orestisf1993 commented Nov 10, 2018

My current i3 session is in a "broken state", like #2257 mentions. The difference from a new, correctly functional session is that event_is_ignored in

i3/src/handlers.c

Lines 135 to 140 in cf553ce

/* Some events are not interesting, because they were not generated
* actively by the user, but by reconfiguration of windows */
if (event_is_ignored(event->sequence, XCB_ENTER_NOTIFY)) {
DLOG("Event ignored\n");
return;
}
returns false.

@JonnyHaystack

This comment has been minimized.

JonnyHaystack commented Nov 10, 2018

My current i3 session is in a "broken state", like #2257 mentions. The difference from a new, correctly functional session is that event_is_ignored in

i3/src/handlers.c

Lines 135 to 140 in cf553ce

 /* Some events are not interesting, because they were not generated 
  * actively by the user, but by reconfiguration of windows */ 
 if (event_is_ignored(event->sequence, XCB_ENTER_NOTIFY)) { 
     DLOG("Event ignored\n"); 
     return; 
 } 

returns false.

Should the "broken state" be reset when I do a regular i3 restart? Because the bug always happens for me.

EDIT: Also, for me it seems to be that it's when focus_follows_mouse and mouse_warping are both enabled. If I disable either one then it works fine, at least for as long as I tested it.

@ersi-dnd

This comment has been minimized.

ersi-dnd commented Nov 18, 2018

EDIT: Also, for me it seems to be that it's when focus_follows_mouse and mouse_warping are both enabled. If I disable either one then it works fine, at least for as long as I tested it.

Yes. I have the same issue and it's a major problem. I want

  • the mouse pointer to move along window by window as I put focus by keybind on different tiled windows in a multi-monitor setup AND
  • windows to receive focus upon mouseover.

Unfortunately this is not possible when the config says:
focus_follows_mouse yes
mouse_warping output

I think it's mouse_warping output that does not allow the pointer to move along window by window by keybind. There should be more options to mouse_warping, for example "window".

@JonnyHaystack

This comment has been minimized.

JonnyHaystack commented Nov 18, 2018

EDIT: Also, for me it seems to be that it's when focus_follows_mouse and mouse_warping are both enabled. If I disable either one then it works fine, at least for as long as I tested it.

Yes. I have the same issue and it's a major problem. I want

  • the mouse pointer to move along window by window as I put focus by keybind on different tiled windows in a multi-monitor setup AND
  • windows to receive focus upon mouseover.

Unfortunately this is not possible when the config says:
focus_follows_mouse yes
mouse_warping output

I think it's mouse_warping output that does not allow the pointer to move along window by window by keybind. There should be more options to mouse_warping, for example "window".

I think mouse_warping output should be cancelled if you moved the window to the other output by using move up/down/left/right. Either that or focus_follows_mouse should be cancelled when the cursor is moved by mouse_warping.
It seems what's happening is that you move a window to another monitor with move and then the mouse is warped to the centre of the new monitor, and then focus_follows_mouse causes the window "underneath" the cursor's new position to be focused.

And yeah I think your idea for a mouse_warping window option is a good one.

@Airblader

This comment has been minimized.

Member

Airblader commented Nov 18, 2018

Let's please not turn a bug report into a feature request. Behavior should be sensible with the existing feature set, adding new options is a topic that we'd need to discuss separately from this. :-)

@JonnyHaystack

This comment has been minimized.

JonnyHaystack commented Nov 18, 2018

@Airblader Yes, you're quite right sorry haha.
Let me know if there's any extra info needed for the bug fix though 👌

@JonnyHaystack

This comment has been minimized.

JonnyHaystack commented Nov 23, 2018

Okay so now it's happening for me even with mouse_warping off.. And in that situation it doesn't focus the window under the mouse but it focused the last focused window on the display that the window was moved from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment