Skip to content
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

Change focused container #1112

Closed
i3bot opened this issue Nov 9, 2013 · 7 comments
Closed

Change focused container #1112

i3bot opened this issue Nov 9, 2013 · 7 comments
Assignees

Comments

@i3bot
Copy link

i3bot commented Nov 9, 2013

[Originally reported by udvzsolt@…]
(I think it would be nice if can change the current container. See a thread here: https://faq.i3wm.org/question/2809/focus-between-and-inside-containers/

@i3bot
Copy link
Author

i3bot commented Nov 9, 2013

[Original comment by TonyC]

I think what you want is some kind of conditional focus command, where if the command fails to change focus, it should pick the most intuitive alternative based on the current layout.

This kind of intuition is extremely difficult to describe in logical terms precise enough to translate into computer code. I wouldn't even suggest you try to write a script for this. It would be easier to key the sequence of commands that does exactly what you want each time.

@i3bot
Copy link
Author

i3bot commented Nov 9, 2013

[Original comment by udvzsolt@…]

No, I think should not be a complicated focus command. I think would be a 'focus' command and a 'focus_container' command, with same parameters ('focus left' works as now, and 'focus_container left' change focus to the container to left).
Check 'notion': http://notion.sourceforge.net/notionkeys.html - Frames and Clients. Mod1+key change selected frame, "Mod1+K key" change the focused client. I hope it's clear what I'm thinking.

@stapelberg
Copy link
Member

I don’t yet understand how a focus_container command would help in your situation, given that it is effectively the same as “focus parent; focus $direction”. I.e., the focus_container command would not magically work on windows that are not within a split container, which is — AFAIU — where the trouble starts for you.

@i3bot
Copy link
Author

i3bot commented Nov 11, 2013

[Original comment by Zsolt Udvari <udvzsolt@…>]

No, not exactly.

If you've two windows in a container and you don't have anything else, "focus parent; focus $direction" doesn't work. In this case I think "focus_container left" shouldn't do anything - because of non-existent container on left.
With "''focus parent; focus $direction''" both windows will selected - because "focus parent" will focus parent (what else? :) ), but in this case "focus right" doesn't select another container - because there isn't another container! So "''focus parent; focus right''" is equivalent with "focus parent" and it's an undesired result: you can't do anything you'll need a mouse/touchpad to select only one window (''focus $direction'' doesn't work).

@stapelberg
Copy link
Member

Replying to comment 4 by Zsolt Udvari <udvzsolt@…>:

No, not exactly.

If you've two windows in a container and you don't have anything else, "focus parent; focus $direction" doesn't work. In this case I think "focus_container left" shouldn't do anything - because of non-existent container on left.
So you want to introduce a new command that sometimes does “focus parent; focus $direction”, but sometimes does nothing.

Why don’t you just use “focus parent; focus $direction” when it’s appropriate and directly ”focus” when it’s not? :)

@i3bot
Copy link
Author

i3bot commented Nov 12, 2013

[Original comment by Zsolt Udvari <udvzsolt@…>]

It seems simple :) But when I press ''focus_container-hotkey'' in bad situation I should use mouse to correct the mistake. But in "bad situation" the focus_container would does nothing so doesn't need correct the mistake :)

@stapelberg
Copy link
Member

To fix the situation, you can use “focus child” (not bound in the default config). If that doesn’t work, it’s a separate bug.

I’m closing this ticket since I don’t believe focus_container is a worthwhile thing to introduce, see my earlier comments.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants