mate-desktop / marco

MATE default window manager
https://mate-desktop.org
GNU General Public License v2.0
193 stars 86 forks source link

Feature: Add setting to raise windows on alt+tab popup #713

Closed sparkida closed 1 year ago

sparkida commented 2 years ago

I would like to propose adding a setting for raising the window during the alt+tab cycling to accommodate the difficulty of identifying which window is being chosen. When I have multiple terminals running it currently requires a lot of mental power to identify which terminal I actually want and by raising the window we add a useful visual indicator.

raveit65 commented 2 years ago

https://app.travis-ci.com/github/mate-desktop/marco/jobs/555752722#L7627 Can you please rebase against our master to get this commit https://github.com/mate-desktop/marco/commit/cb274b4b3fe7dad642fe27a58a1f4955bcb21e1d into PR? This should fix the build issue with debian for CI.

raveit65 commented 2 years ago

Beside from the build warning i like this new behavior.

sparkida commented 2 years ago

@raveit65 not really sure what to do at this point to handle those warnings, all the previous occurrences are and have been logging that same warning, so if we want to get rid of them I'm guessing it will require some reworking of the MetaTabEntryKey and the meta_ui_tab_popup_get_selected function. Do you see an easy solution here?...because I am not that knowledgeable with C

raveit65 commented 2 years ago

I can confirm that https://github.com/mate-desktop/marco/pull/718 fixes the -Wbad-function-cast in master. So, you like to update your PR when the other one is merged?

raveit65 commented 2 years ago

Btw, i found out that alt+esc and alt+f6 does basically the same as your PR without the alt-tab popup.

sparkida commented 2 years ago

Btw, i found out that alt+esc and alt+f6 does basically the same as your PR without the alt-tab popup.

The alt+esc is nice that it brings the window back to the same spot in the stack rather than keeping it raised after leaving as in my PR. I guess it would be best to have that same functionality, but with the popup. What do you think?

raveit65 commented 2 years ago

Btw, i found out that alt+esc and alt+f6 does basically the same as your PR without the alt-tab popup.

The alt+esc is nice that it brings the window back to the same spot in the stack rather than keeping it raised after leaving as in my PR. I guess it would be best to have that same functionality, but with the popup. What do you think?

Yeap, i agree with you, that might be the best behavior to leave the stack as it is with alt-tab popup too, ihmo. And you are using a gsettings key to enable it, which avoid to change the default for other users. Personal this would be my new default, but i've learned in 10 years of developing Mate that changing a default can trigger a big shitstorm ;) Any way, i am not sure if most users will see that change, so let the team decide if that would be the new default or not, after your PR is finished.

raveit65 commented 2 years ago

@sparkida Other PR is merged https://github.com/mate-desktop/marco/commit/480cc60e3b3596a7fa8e196a08974b6086217bf0

vkareh commented 2 years ago

@raveit65 @sparkida I really like this new feature. I think we should add a checkbox in the Window Preferences dialog to make it a bit more prominent.

The only issue I find with this behaviour is when using Alt+Tab, then Esc before releasing Alt+Tab, the raised window is now on top of the stack, but not active. I think pressing Esc should either raise the active window or make the currently raised window active, rather than keeping an active window lower in the stack.

Other than that this looks really good and I'm also using it as my new default :)

vkareh commented 2 years ago

I found another issue (possibly related to my previous post). If I have 3 windows, as I cycle through them the second one in the stack is raised, then the third. If I select the third window, now I have the second one above the first one. For example,

This is the initial state: Screenshot at 2022-03-22 14-48-49

I Alt+Tab (and press Tab once more to select calculator), this is the final state: Screenshot at 2022-03-22 14-49-05

This means that the stack order is now entirely changed.

I think that the solution here is to retain the original stack order and once a window is selected, move only that window to the top of the stack.

sparkida commented 1 year ago

@vkareh @raveit65 I fixed the issues and simplified the implementation a lot, really only a couple lines of functional changes at this point. I've been using it for a few months now and not seeing any issues. Thanks for helping identify things and improve this!

raveit65 commented 1 year ago
[rave@mother marco]$ git pull https://github.com/sparkida/marco.git feat/alt-tab-raise-windows
From https://github.com/sparkida/marco
 * branch              feat/alt-tab-raise-windows -> FETCH_HEAD
fatal: Not possible to fast-forward, aborting.

Can you please rebase with master?

zhuyaliang commented 1 year ago

@vkareh Whether code can be merged ?