Skip to content

Commit

Permalink
Added better stackpriority documentation + cache miss thing (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerjenigeUberMensch authored Sep 24, 2024
1 parent 198cd32 commit 6aa04fc
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/desktop.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,12 @@ stackpriority(Client *c1, Client *c2)
const u32 ewmhflags = ewmhflag1 ^ ewmhflag2;
const u32 flags = flags1 ^ flags2;

/* Due to the lack of virtual desktop handling this is no used by default.
*/
if(ewmhflags & WTypeFlagDesktop)
{ ASSUME(false);
}

if(ewmhflags & WStateFlagBelow)
{ return __stack_priority_helper_below(ewmhflag1, WStateFlagBelow);
}
Expand All @@ -483,9 +489,11 @@ stackpriority(Client *c1, Client *c2)
if(ewmhflags & WStateFlagAbove)
{ return __stack_priority_helper_above(ewmhflag1, WStateFlagAbove);
}
if(c1->desktop->layout != Floating && c2->desktop->layout != Floating)
{
if(flags & ClientFlagFloating)

if(flags & ClientFlagFloating)
{
/* possible cache miss if reverse order due to desktop pointer indirection */
if(c1->desktop->layout != Floating && c2->desktop->layout != Floating)
{ return __stack_priority_helper_above(flags1, ClientFlagFloating);
}
}
Expand Down

0 comments on commit 6aa04fc

Please sign in to comment.