mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-07-09 00:06:46 -04:00
opt: optimize focus stack judge
This commit is contained in:
parent
3c1a247892
commit
763ca89257
1 changed files with 9 additions and 6 deletions
|
|
@ -391,10 +391,13 @@ bool client_is_in_same_stack(Client *sc, Client *tc, Client *fc) {
|
|||
|
||||
uint32_t id = sc->mon->pertag->ltidxs[sc->mon->pertag->curtag]->id;
|
||||
|
||||
if (id != SCROLLER && id != VERTICAL_SCROLLER && id != TILE &&
|
||||
id != VERTICAL_TILE && id != DECK && id != VERTICAL_DECK &&
|
||||
id != CENTER_TILE && id != RIGHT_TILE)
|
||||
return false;
|
||||
if ((id != SCROLLER && id != VERTICAL_SCROLLER) && tc->mon != selmon &&
|
||||
(tc->isfullscreen || tc->ismaximizescreen))
|
||||
return true;
|
||||
|
||||
if (id == MONOCLE) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (id == SCROLLER || id == VERTICAL_SCROLLER) {
|
||||
Client *source_stack_head = scroll_get_stack_head_client(sc);
|
||||
|
|
@ -434,11 +437,11 @@ bool client_is_in_same_stack(Client *sc, Client *tc, Client *fc) {
|
|||
}
|
||||
|
||||
Client *get_focused_stack_client(Client *sc, Client *custom_focus_client) {
|
||||
if (!sc || sc->isfloating)
|
||||
if (!sc || sc->isfloating || !selmon)
|
||||
return sc;
|
||||
|
||||
Client *tc = NULL;
|
||||
Client *fc = custom_focus_client ? custom_focus_client : focustop(sc->mon);
|
||||
Client *fc = custom_focus_client ? custom_focus_client : selmon->sel;
|
||||
|
||||
if (fc->isfloating || sc->isfloating)
|
||||
return sc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue