The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

Strange focus behaviour on multi-monitor setup

asked 2014-07-07 16:08:18 +0000

tigrezno gravatar image

updated 2014-07-07 16:09:52 +0000

Currently I have this problem:

monitor0             monitor1
0:hdmi               1:term
(empty)              (xterm1, xterm2, xterm3)

When I switch focus left while in the "xterm1" container, my focus is moved to workspace "0:hdmi" in monitor0, even when it's empty.

I can't understand this behaviour. If I only use one monitor, the focus is not switched to other workspaces when you reach the last container. But the behaviour (strangely IMHO) changes to a "shared focus space" when you plug other outputs.

Is there a way to limit my commands to the current workspace? I want to work in a single workspace at a time.

Also, I've seen that floating windows will open in my other monitor, so it looks like both workspaces are like active and shared at the same time.

It's really confusing and frustrating, because it's a problem when my HDMI output is switched off but dialogs are opened there.

tl;dr: I don't want shared workspaces/screens. Can I change that?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-07-14 08:50:07 +0000

Adaephon gravatar image

(Partial) Workaround

There is no way to completely deactivate this behaviour, but you can alleviate it somewhat by setting force_focus_wrapping yes in your config. This will keep the cursor inside a container. As long as you have at least two containers side by side it will not leave the current container or workspace. To leave a container you have to do focus parent first. The drawback is that it affects any container and thus obviously may require some adaption in your workflow.

To prevent windows from opening on a switched off output, you have to disable the display with xrandr --output NAME --off and possibly reload/restart i3.


Why does it even behave this way?

Workspaces have three possible focus states: 'focused', 'active' and 'inactive'. The workspace you are currently working on is 'focused'. If you have multiple outputs the other visible workspaces are 'active'. Any other workspace is 'inactive'.

The focusing behaviour of i3 is designed to be intuitive. So if you call focus left i3 will try to focus the next thing to the left of your current position. In your case that is the active workspace '0:hdmi'. With only one output i3 does not switch workspaces because there are no other active workspaces.

As for the dialogs: Usually i3 will place on the currently focused workspace floating right in the middle. (Sadly) some programs seem to try to (re)position the dialogs themselves and sometimes come to strange conclusions about sensible placement. Although you switched off your display it is still active in your X server and may thus be percieved as the perfect position for a dialog window.

edit flag offensive delete link more

Comments

Thanks for the explanation!

tigrezno gravatar imagetigrezno ( 2014-07-14 13:00:23 +0000 )edit

Question Tools

Stats

Asked: 2014-07-07 16:08:18 +0000

Seen: 339 times

Last updated: Jul 14 '14