[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Shift_to_monitor follows shift



On Thu, Jan 24, 2013 at 03:17:01PM -0800, Tyler Thomas Hart wrote:
> eto on irc brought my attention (again) to the fact that
> shift_to_monitor does not follow shift. Since
> focus_follows_shift was removed, I think that the behavior
> of all shift commands should be similar.

Yes. In my opinion this means: The window is focused on the tag. But the
currently focused tag/monitor doesn't change.

> The following patch focuses the monitor/frame/window of the
> target. Note that the old behavior can be easily scripted if
> using a relative index by calling
> 
> $ hc chain , shift_to_monitor +$X , focus_monitor -$X
> 
> which requires less scripting than the current way to
> produce the 'correct' behavior.

This exactly the same scripting effort then currently:

$ hc chain , shift_to_monitor +$X , focus_monitor +$X

> +    monitors_lock();
> +    tag_move_focused_client((monitor_with_index(monitor))->tag);
> +    monitor_focus_by_index(monitor);
> +    monitors_unlock();

This only focuses the monitor, but the window itself is not focused on
the target monitor, which is the actual annoying thing! (It happens if
the target frame wasn't empty before).

So IMO the fixup is: focus the window within the new monitor, but don't
switch the monitor focus. (I just added it as 0c158ae).

Regards,
Thorsten