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/screen.c | |
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/screen.c')
-rw-r--r-- | src/screen.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/screen.c b/src/screen.c index 32a0fc7..4449fb5 100644 --- a/src/screen.c +++ b/src/screen.c @@ -169,23 +169,20 @@ _out: int vwm_screen_is_empty(vwm_t *vwm, const vwm_screen_t *scr, vwm_xwindow_t *ignore_xwin) { vwm_xwindow_t *xwin; - int is_empty = 1; list_for_each_entry(xwin, &vwm->xwindows, xwindows) { if (xwin == ignore_xwin || !xwin->client_mapped) continue; - if (!xwin->managed || (xwin->managed->desktop == vwm->focused_desktop && !xwin->managed->shelved)) { + if (!xwin->managed || xwin->managed->desktop == vwm->focused_desktop) { /* XXX: it may make more sense to see what %age of the screen is overlapped by windows, and consider it empty if < some % */ /* This is just seeing if any window is predominantly within the specified screen, the rationale being if you had a focusable * window on the screen you would have used the keyboard to make windows go there; this function is only used in determining * wether a new window should go where the pointer is or not. */ - if (vwm_screen_overlaps_xwin(vwm, scr, xwin) >= 0.05) { - is_empty = 0; - break; - } + if (vwm_screen_overlaps_xwin(vwm, scr, xwin) >= 0.05) + return 0; } } - return is_empty; + return 1; } |