-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Odd behaviour with shiftviewclients and scratchpads patch #12
Comments
That's because the two patches are not compatible with each other out of the box. The shiftviewclient patch comes with integration hints though: You can just delete the code you don't need (lines 49, 52, 53, 54). |
Thanks a lot! Didn't realize the integration hints were for this incompatibility :P |
For some reason, the scratchpads still do appear when cycling through tags. Not sure why :( . This is my current void
shiftviewclients(const Arg *arg)
{
Arg shifted;
Client *c;
unsigned int tagmask = 0;
for (c = selmon->clients; c; c = c->next)
if (!(c->tags & SPTAGMASK))
tagmask = tagmask | c->tags;
shifted.ui = selmon->tagset[selmon->seltags];
if (arg->i > 0) // left circular shift
do {
shifted.ui = (shifted.ui << arg->i)
| (shifted.ui >> (LENGTH(tags) - arg->i));
} while (tagmask && !(shifted.ui & tagmask));
else // right circular shift
do {
shifted.ui = (shifted.ui >> (- arg->i)
| shifted.ui << (LENGTH(tags) + arg->i));
} while (tagmask && !(shifted.ui & tagmask));
view(&shifted);
} |
I see, there was a second integration hint that is missing from the patch: I'll update it. |
As per your latest commit, I updated void
shiftviewclients(const Arg *arg)
{
Arg shifted;
Client *c;
unsigned int tagmask = 0;
for (c = selmon->clients; c; c = c->next)
if (!(c->tags & SPTAGMASK))
tagmask = tagmask | c->tags;
shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK;
if (arg->i > 0) // left circular shift
do {
shifted.ui = (shifted.ui << arg->i)
| (shifted.ui >> (LENGTH(tags) - arg->i));
} while (tagmask && !(shifted.ui & tagmask));
else // right circular shift
do {
shifted.ui = (shifted.ui >> (- arg->i)
| shifted.ui << (LENGTH(tags) + arg->i));
} while (tagmask && !(shifted.ui & tagmask));
view(&shifted);
} However, I'm still facing the same issue. :( |
OK, assuming you didn't forget to compile and/or restart dwm, could you talk me through how you replicate this issue? I see the change is not there in your build, but that's likely just because you didn't commit or push it yet. Other than that your build seems fine. |
Naturally with no scratchpads open i.e. not running in the background, the patch works fine. However, let me go through the following workflow:
I have pushed the updated function as mentioned in my earlier post. |
Hi @paniash, I tried this in your build, but I can't replicate the behaviour you are describing.
-Stein |
@bakkeby Have you tried going back and forth between the tags using |
Also, I realized something right now. I have 3 scratchpads generally in use:
The issue seems to persist only if I have the plain At the end of the day, all the scratchpads are |
That's interesting, I'll have another look. |
Nah, I still can't replicate this. I know it is stupid, but are you absolutely sure that you have recompiled, installed, and restarted dwm? |
Yes, just to make sure once again, I compiled & restarted it and have the same issue. I guess I'll have to live with it. Thanks for all your help @bakkeby! |
Hmm, it is bizarre though that I'm not able to replicate it. Would be interesting if someone else would. Unrelated, but the scratchpads patch has a few holes. E.g. { MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, The ~ is a binary operator which means inverse, so ~0 becomes a binary 111111111.. etc. When you have the scratchpads patch you'll want this to be There are other places in the code where ~0 is used as well to select all tags (and subsequently all scratchpads as well). |
I tried changing it to Let me see if this issue still persists with other scratchpad patches or is it just my system for some reason. |
Just to be sure that we're on the same page, here's a screenshot of my issue: |
That is clearer, tag 1 is occupied by other clients as well. |
Hi @paniash, that bit shifting is a bit funky, can you try this? void
shiftviewclients(const Arg *arg)
{
Arg shifted;
Client *c;
unsigned int tagmask = 0;
for (c = selmon->clients; c; c = c->next)
if (!(c->tags & SPTAGMASK))
tagmask = tagmask | c->tags;
shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK;
if (arg->i > 0) // left circular shift
do {
shifted.ui = (shifted.ui << arg->i)
| (shifted.ui >> (LENGTH(tags) - arg->i));
shifted.ui &= ~SPTAGMASK; // <--- add this
} while (tagmask && !(shifted.ui & tagmask));
else // right circular shift
do {
shifted.ui = (shifted.ui >> (- arg->i)
| shifted.ui << (LENGTH(tags) + arg->i));
shifted.ui &= ~SPTAGMASK; // <--- add this
} while (tagmask && !(shifted.ui & tagmask));
view(&shifted);
} Seems to do the trick with my preliminary testing.
-Stein |
Hey @bakkeby! This seems to have done the trick! Thank you very much! btw were you able to replicate the issue after I posted the screenshots? Thanks, |
Hi @paniash, yes I was. I was trying to replicate only opening the scratchpad on tag 1, then moving to tag 3, opening an application and then using shiftviewclients to move back to 1. That it only affected the first scratchpad and not the others is a bit circumstantial, likely the others would also be affected depending on what tags are selected when you shift.
-Stein |
That's great! Thank you once again. :) |
Thank you for reporting. Getting to the bottom of issues like this helps everyone who takes / uses these patches. |
On my current build, I'm using the scratchpads patch. When patched along with
shiftviewclients
and cycling through non-empty tags, the hidden scratchpads appear on the screen. I don't suppose this is the intended behaviour.The text was updated successfully, but these errors were encountered: