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

raise windows on windowwalk (aka alt-tab) #313

Closed
foobar0815 opened this Issue May 16, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@foobar0815

It would be nice to actually see the windows (or a preview of it) on walking through the window stack, especially if you got lots of open windows (e.g. terminals), to make it easier to find the one you are looking for.

I had a look at the code (clientlist.c) myself and played around a little bit by moving the raise/restore part from StopWindowWalk to WalkWindowStack. If a window is in minimized state, this information is saved in a variable (previousClientMinimized) and restored before moving to the next window.

if(previousClientMinimized) {
  MinimizeClient(np, 1);
  previousClientMinimized = 0;
}

[...]

if(np) {
   if(np->state.status & STAT_MINIMIZED) {
      RestoreClient(np, 1);
      previousClientMinimized = 1;
    } else {
      RaiseClient(np);
   }
}

I hope you get the idea.
This basically works pretty nice, BUT because of the restacking which takes place on every raise/restore, the window stack gets messed up during the windowwalk. A possible solution to this would be making the restacking in the respective functions optional.

These are just my personal and pretty loose thoughts on that matter... please feel free to close this issue if you don't agree that this would be a reasonable enhancement.

@joewing joewing added the enhancement label May 18, 2016

@joewing

This comment has been minimized.

Show comment
Hide comment
@joewing

joewing May 18, 2016

Owner

This would be nice to have. I think it's probably pretty easy to implement as well (though I haven't tried yet): just use XRaiseWindow during the walk and RestackClients to restore JWM's idea of what the stacking order should be.

Owner

joewing commented May 18, 2016

This would be nice to have. I think it's probably pretty easy to implement as well (though I haven't tried yet): just use XRaiseWindow during the walk and RestackClients to restore JWM's idea of what the stacking order should be.

joewing added a commit that referenced this issue May 18, 2016

@joewing

This comment has been minimized.

Show comment
Hide comment
@joewing

joewing May 18, 2016

Owner

Snapshot 1527 attempts to implement this. The stacking order appears to get messed up during the walk, but it is fixed once you release the modifier. I actually don't mind that behavior (maybe it's fine as is). Making it keep the stacking order correct while showing the current window would take a little more thought, but should be doable.

Owner

joewing commented May 18, 2016

Snapshot 1527 attempts to implement this. The stacking order appears to get messed up during the walk, but it is fixed once you release the modifier. I actually don't mind that behavior (maybe it's fine as is). Making it keep the stacking order correct while showing the current window would take a little more thought, but should be doable.

@foobar0815

This comment has been minimized.

Show comment
Hide comment
@foobar0815

foobar0815 May 18, 2016

Now that was quick. Thanks!

The on-liner works pretty much as expected, although it doesn't raise minimized windows during the walk of course. Stacking order seems correct to me.

Interesting fact: the raise has no effect on client-side decorated windows (e.g. gedit).

Now that was quick. Thanks!

The on-liner works pretty much as expected, although it doesn't raise minimized windows during the walk of course. Stacking order seems correct to me.

Interesting fact: the raise has no effect on client-side decorated windows (e.g. gedit).

@joewing

This comment has been minimized.

Show comment
Hide comment
@joewing

joewing May 19, 2016

Owner

Snapshot 1530 fixes a few things. It should raise all windows now and restore the stacking order after showing each window. I took your suggestion and made it restore minimized clients to show them. It seems to work well.

Owner

joewing commented May 19, 2016

Snapshot 1530 fixes a few things. It should raise all windows now and restore the stacking order after showing each window. I took your suggestion and made it restore minimized clients to show them. It seems to work well.

@foobar0815

This comment has been minimized.

Show comment
Hide comment
@foobar0815

foobar0815 May 19, 2016

Works really really well, thanks again!

Works really really well, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment