Skip to content
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

Display the current window on the bottom of the list instead of on top #24

Closed
HellBrick opened this issue Jan 15, 2015 · 10 comments
Closed
Milestone

Comments

@HellBrick
Copy link
Contributor

Currently when Switcheroo overlay is displayed, the top window in the list (and the one that's focused by default) is exactly the same window that has just been focused. This default makes no sense: if user wants to switch to another window, he'll select a different window in some way, and if user wants to close the current window, he or she will just hit Alt+F4 without invoking Switcheroo.

However, if the current window is moved to the bottom of the list, the top item will be the previous window. Which exactly matches the behavior of Alt+Tab. This way switching to the previous window could be done simply by Alt+Space -> Enter and Alt+Tab wouldn't be needed anymore.

@kvakulo
Copy link
Owner

kvakulo commented Jan 20, 2015

There's a tiny difference between Alt+Space and Alt+Tab.

Alt+Space has the current window in the top of the list and focused.

Alt+Tab has the current window in the top of the list, but the next window focused (and Alt+Shift+Tabhas the previous window focused).

This comes mostly from my own usage: I use Alt+Tab when changing between two windows, but Alt+Space when searching for another window.

Maybe it would make more sense to do as you describe; to move the current window to the bottom of the list, and have the next window focused in the top of the list, or to keep the current window in the top of the list, but having the next window focused regardless of Switcheroo is activated with Alt+Tab or Alt+Space.

I do however imagine future features where it's useful to have the current window first in the list and focused; e.g. when assigning a shortcut to a window (#9) that I've been working on for a while but haven't come around to finish yet.

I'll keep this issue open and await further comments or pull requests :)

/Regin

@HellBrick
Copy link
Contributor Author

Alt+Tab has the current window in the top of the list, but the next window focused (and Alt+Shift+Tab has the previous window focused).

Wow, I didn't know that =) I tried enabling hijacking Alt+Tab and it looks like the behavior that I want. So I guess I'm happy with using Switcheroo's version of Alt+Tab from now on.

(By the way, this looks like another case of the feature discovery problem. Alt+Tab override is not enabled by default, and it's not clear that it would work in a different way. For example, I specifically did NOT turn it on to save the possibility to use system Alt+Tab to make a fast switch to the previous window. Maybe using Alt+Tab behavior as the default one is actually a good idea?)

@kvakulo
Copy link
Owner

kvakulo commented Jan 20, 2015

Yes, it's a subtle difference :)

You are probably right that it would make sense to use the Alt+Tab behaviour also when Switcheroo is activated with Alt+Space. I'll try it out.

(I didn't want to hijack Alt+Tab as default as it's a pretty core feature in the operating system, and Switcheroo's implementation is a bit different in that you still have to press Enter to actually change window)

/Regin

@kvakulo
Copy link
Owner

kvakulo commented Feb 21, 2015

I didn't work more on this issue yet, but I just wanted make a note about this:

Currently when the Alt-Tab integration is enabled in Switcheroo, and you press Alt+Tab then the second window in the list is always displayed, however that is not always the correct behavior. E.g. if the current focused window is not the window list.

Try this scenario while having the Alt tab-integration on:

  1. Focus a window (e.g. Notepad)
  2. Right click the Switcheroo icon in the notification area and click Options
  3. Click Alt+Tab
  4. The Options window do not appear in the window list (this is expected, because it has the window style ToolWindow)
  5. But unexpectedly it's not the Notepad window that's highlighted in Switcheroo, but the following window

I guess the solution is to check if the current focused window equals the first window in the list or if it is a child hereof, before highlighting the next window in the list.

/Regin

kvakulo added a commit that referenced this issue Feb 23, 2015
This should improve the speed when switching between windows, because
it's no longer necessary to press arrow down first.
@kvakulo
Copy link
Owner

kvakulo commented Feb 23, 2015

Here's a fix to move the the window currently in front to the bottom of the list.

It seems to make more sense this way as @HellBrick originally pointed out. This change means that it should be faster to switch back and forth between two windows regardless of the use of Alt+Space or Alt+Tab.

@HellBrick if you get a chance, you are welcome to check it out and see if you like it.

/ Regin

@HellBrick
Copy link
Contributor Author

Sounds interesting, I'll give it a shot tomorrow.

@HellBrick
Copy link
Contributor Author

It seems 'tomorrow' can sometimes be a very elusive thing =) I'm giving it a try and so far it works great, even better than the old Alt+Tab option. I especially like the fact that even if I'm typing something, the current window stays at the bottom of the list and does not steal the selection.

@HellBrick
Copy link
Contributor Author

Just one thing though: I believe the parameter order at 14e082f#diff-17e17c16240e8dd0eadaa57fbf8bd973R251 may be wrong. It looks like you're checking if the foreground window is owned by the first window, while it should probably be the opposite of that. Because of that the first window is not pushed to the bottom in at least one scenario that I found, and swapping the parameters solves that.

kvakulo added a commit that referenced this issue Mar 3, 2015
This should improve the speed when switching between windows, because
it's no longer necessary to press arrow down first.
@kvakulo
Copy link
Owner

kvakulo commented Mar 3, 2015

You are right the parameters were wrong. Nice catch! :)

After further experimentation I actually think that a less strict check is necessary to determine if the first window should be moved to the bottom of the list. It's now just checked if the first window is the same as the foreground window, or if they belongs to the same process.

This change also fixes Shift+Alt+Tab that were broken after the previous commit.

I did a force push on this (sorry!), so you might need to do a git reset if you want to try out this change.

/Regin

@kvakulo
Copy link
Owner

kvakulo commented Mar 17, 2015

Merged into master

@kvakulo kvakulo closed this as completed Mar 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants