bakkeby / dwm-flexipatch

A dwm build with preprocessor directives to decide which patches to include during build time

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why there are same statement in the if-else block? Is this correct or not? I'm not sure.

ysl2 opened this issue · comments

    #if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH
    shifted.ui = selmon->tagset[selmon->seltags];
    #else
    shifted.ui = selmon->tagset[selmon->seltags];
    #endif // SCRATCHPADS_PATCH

#if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH
shifted.ui = selmon->tagset[selmon->seltags];
#else
shifted.ui = selmon->tagset[selmon->seltags];
#endif // SCRATCHPADS_PATCH

Good question.

Looking at the changes in 20692be it seems that the shiftboth, shiftswaptags and shifttag functions had this code / issue, while shifttagclients, shiftview and shiftviewclients had this:

	#if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH
	shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK;
	#else
	shifted.ui = selmon->tagset[selmon->seltags];
	#endif // SCRATCHPADS_PATCH

So I think the first case should have that & ~SPTAGMASK added to it. I suppose it is a good example of how much fuzz it creates when one decides to add special tags to hold scratchpad clients (and why the named scratchpads patch causes a lot less conflicts).

Thanks for your kind explain! You are really a patient person, and you have done excellent work for dwm community!! Thank you :-)