diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2021-01-02 23:27:41 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2021-01-02 23:27:41 -0800 |
commit | bb59bfd71ec1731587467f64625c7c6818c973dc (patch) | |
tree | af475dc412cbea3519e5a128641b38057327b247 /src/vwm.h | |
parent | d08f5671db08de077e271c3e1d3b6b45e11c9ecc (diff) |
*: replace the "shelf" with "contexts"
This is unfortunately a bit of a large commit, but it's at least
pretty much all on-topic for the generalized "contexts" feature.
Rather than waste time trying to split this further into smaller
commits, I'm just landing it as-is, now that I've lived with the
interaction model long enough to not completely hate it.
I fully expect to revisit this in the future. One TODO item in
particular I'd like to note is "sending" windows to contexts
always creates a new virtual desktop for the sent window in the
destination context. What should really happen is the
destination context should be checked for an empty desktop, and a
new desktop created only when there isn't an empty one to be
reused for receiving the sent window. Note this only affects
non-migrate sends, as migrates (modified by Shift) explicitly use
the existing focused desktop at the destination context.
See the README for more information on how contexts work and
what's different about the interaction model. It's fairly
minimal, most of what you already know how to do should keep
working as-is. The only oddity would be Mos1-s no longer
"shelves" windows, it's now a modifier to turn "migrates" into
"sends", and by itself is a noop now.
Colors used for contexts haven't been refined and are enumerated
in src/context_colors.def.
Diffstat (limited to 'src/vwm.h')
-rw-r--r-- | src/vwm.h | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -32,6 +32,15 @@ typedef struct _vwm_window_t vwm_window_t; typedef struct _vwm_desktop_t vwm_desktop_t; +/* this contortion is currently just to get VWM_CONTEXT_COLOR_MAX defined */ +typedef enum _vwm_context_color_t { +#define color(_num, _str) \ + VWM_CONTEXT_COLOR_ ## _num, +#include "context_colors.def" +#undef color + VWM_CONTEXT_COLOR_MAX +} vwm_context_color_t; + typedef struct _vwm_t { vwm_xserver_t *xserver; /* global xserver instance */ vwm_charts_t *charts; /* golbal charts instance */ @@ -45,24 +54,26 @@ typedef struct _vwm_t { int xinerama_screens_cnt; int done; /* global flag to cause vwm to quit */ + list_head_t contexts; /* global list of all contexts in spatial created-in order */ + list_head_t contexts_mru; /* global list of all contexts kept in MRU order */ list_head_t desktops; /* global list of all (virtual) desktops in spatial created-in order */ list_head_t desktops_mru; /* global list of all (virtual) desktops in MRU order */ list_head_t windows_mru; /* global list of all managed windows kept in MRU order */ list_head_t xwindows; /* global list of all xwindows kept in the X server stacking order */ + vwm_window_t *console; /* the console window */ vwm_window_t *focused_origin; /* the originating window in a grabbed operation/transaction */ - vwm_desktop_t *focused_desktop; /* currently focused (virtual) desktop */ - vwm_window_t *focused_shelf; /* currently focused shelved window */ - vwm_context_t focused_context; /* currently focused context */ + vwm_desktop_t *focused_desktop; /* currently focused desktop */ int priority; /* scheduling priority of the vwm process, launcher nices relative to this */ unsigned long fence_mask; /* global mask state for vwm_win_focus_next(... VWM_FENCE_MASKED_VIOLATE), - * if you use vwm on enough screens to overflow this, pics or it didn't happen. */ + * if you use vwm on enough screens to overflow this, pics or it didn't happen. */ struct colors { #define color(_sym, _str) \ XColor _sym ## _color; #include "colors.def" #undef color } colors; + XColor context_colors[VWM_CONTEXT_COLOR_MAX]; } vwm_t; #endif |