Merge pull request #2953 from CyberShadow/focus_wrapping

Add "focus_wrapping" option
This commit is contained in:
Michael Stapelberg
2017-09-27 09:31:39 -07:00
committed by GitHub
10 changed files with 137 additions and 25 deletions

View File

@ -49,6 +49,7 @@ CFGFUN(workspace_layout, const char *layout);
CFGFUN(workspace_back_and_forth, const char *value);
CFGFUN(focus_follows_mouse, const char *value);
CFGFUN(mouse_warping, const char *value);
CFGFUN(focus_wrapping, const char *value);
CFGFUN(force_focus_wrapping, const char *value);
CFGFUN(force_xinerama, const char *value);
CFGFUN(disable_randr15, const char *value);

View File

@ -137,15 +137,24 @@ struct Config {
* comes with i3. Thus, you can turn it off entirely. */
bool disable_workspace_bar;
/** Think of the following layout: Horizontal workspace with a tabbed
* con on the left of the screen and a terminal on the right of the
* screen. You are in the second container in the tabbed container and
* focus to the right. By default, i3 will set focus to the terminal on
* the right. If you are in the first container in the tabbed container
* however, focusing to the left will wrap. This option forces i3 to
* always wrap, which will result in you having to use "focus parent"
* more often. */
bool force_focus_wrapping;
/** When focus wrapping is enabled (the default), attempting to
* move focus past the edge of the screen (in other words, in a
* direction in which there are no more containers to focus) will
* cause the focus to wrap to the opposite edge of the current
* container. When it is disabled, nothing happens; the current
* focus is preserved.
*
* Additionally, focus wrapping may be forced. Think of the
* following layout: Horizontal workspace with a tabbed con on the
* left of the screen and a terminal on the right of the
* screen. You are in the second container in the tabbed container
* and focus to the right. By default, i3 will set focus to the
* terminal on the right. If you are in the first container in the
* tabbed container however, focusing to the left will
* wrap. Setting focus_wrapping to FOCUS_WRAPPING_FORCE forces i3
* to always wrap, which will result in you having to use "focus
* parent" more often. */
focus_wrapping_t focus_wrapping;
/** By default, use the RandR API for multi-monitor setups.
* Unfortunately, the nVidia binary graphics driver doesn't support

View File

@ -133,6 +133,15 @@ typedef enum {
POINTER_WARPING_NONE = 1
} warping_t;
/**
* Focus wrapping modes.
*/
typedef enum {
FOCUS_WRAPPING_OFF = 0,
FOCUS_WRAPPING_ON = 1,
FOCUS_WRAPPING_FORCE = 2
} focus_wrapping_t;
/**
* Stores a rectangle, for example the size of a window, the child window etc.
* It needs to be packed so that the compiler will not add any padding bytes.