G-dH / advanced-alttab-window-switcher

A highly customizable replacement for Gnome Shell's Alt-Tab window and app switchers.
GNU General Public License v3.0
163 stars 11 forks source link

Option to disable minimized window rearrange #11

Closed Knud3 closed 2 years ago

Knud3 commented 2 years ago

Thanks for this awesome extensions.

Unfortunately I have get used to minimize windows frequently, but I don't want that to effect alt tabbing.

Now if window is minimized it get moved bottom of the alt-tab list and icon get opacity.

It would be really nice to have option to ignore this.

G-dH commented 2 years ago

Hi, minimized windows at the end of the tab list are hard-coded into the window manager which generates the list. Each Meta.Window has stable sequence id, but I can't find any MRU sequence id. Unfortunately, I don't see an easy solution for this.

Knud3 commented 2 years ago

I see. Thanks for reply. Have to look how to build one without it then. Already done that for xfwm4, but I would like to try gnome. Or I try to change gnome window manager to xfwm4.

Or do you have any recommendations?

G-dH commented 2 years ago

You can't replace window manager in GNOME Shell. The only way I see is tracking windows from the extension code in order to get custom MRU list.

Knud3 commented 2 years ago

Thats goes beyond my understanding. So, maybe I stick with xfce4, because I already got it working. Can't change my 20 year old habit :)

G-dH commented 2 years ago

My bad, I overlooked the user-time window property, that means I can add the option.

G-dH commented 2 years ago

And now it's available in the repository.

Knud3 commented 2 years ago

Wow, nice! I tested it immediately. It have little bug:

Lets say I have windows A,B,C,D in alttab. A is active window and I minimize it. I activate window B. Now alttab order is still A,B,C,D so tapping alt+tab once just activate window what already was active. Expected order would be B,A,C,D.

And some feature request to add:

Huge thanks for this addition!

G-dH commented 2 years ago

Thanks for the test and the feedback! I'm unable to reproduce the bug - tested on (Ubuntu) GS 3.36 and (Fedora) GS 41.

Knud3 commented 2 years ago

I tested it with Fedora 35 Workstation live-cd. All settings default. Here is terrible quality screencapture: https://1drv.ms/v/s!AkB2BxNSQ4E2kvUTfrUEXdtTrZX3Wg?e=p9O5wO

G-dH commented 2 years ago

Did you try to click into the window before you used the AltTab switcher? On my installs this step is usually not necessary, but if the window is not really focused, the timestamp is not updated..

Knud3 commented 2 years ago

Yes, I also tried that and it won't change alttab behaviour.

G-dH commented 2 years ago

Even on Live Fedora 35 the sorting is fine..

Knud3 commented 2 years ago

I dig this little deeper... Most apps works, which is nice. It seems that there are some exeptions like this Extensions app where it does not work like it is intended. It also looks like these window exeptions are little faded for some reason in alttab and does not have minimize button. See screenshot: https://1drv.ms/u/s!AkB2BxNSQ4E2kvUUhekzbY15njamOw?e=pLOarb

Can you find out how are these windows different and maybe even fix this bug (which is very narrow fortunately).

G-dH commented 2 years ago

These "faded" windows are windows with attached modal windows/dialogs and AltTab switcher lists only the main window. But again, your screenshot is showing different behavior than any of my systems, where Prefs windows opened from the Extensions app are always listed in the AltTab switcher as separate windows.

GNOME Shell is designed to use workspaces instead of minimizing windows, GNOME app windows have only Close button, minimize is available from the header bar context menu, in the latest versions as Hide instead of Minimize. I don't use minimizing at all.

Knud3 commented 2 years ago

I hate workspaces. I tried to change my workflow to those once, but no... Minimizing is my second nature. I have never even thought why I do it, but it is just so deep in my workflow that I can't get out of it. I do not even use desktop, so that is not the reason. Maybe I just like to see my wallpaper (which is all black screen) :D

Maybe you need to market your extension more now, because I googled this feature for hours and found hundred threads where people asked this for Gnome.

Maybe I give Gnome now a chance. I have liked XFCE a lot, but panel functions are not very reliable, so I have search replacement. And native Fedora comes with Gnome.

Thanks again for making this happen!

You have any idea when this is available in https://extensions.gnome.org ?

Knud3 commented 2 years ago

It also have this little bug/feature. Let's say that we again have windows A, B, C, D.

I minimize A, so B comes active. I click C, so it comes active. Now order is C, A, B, D. Expected would be C, B, A, D. So, it did not register B for some reason without clicking it.

Maybe I can live with this. Can't tell now. I see it in use.

G-dH commented 2 years ago

Again, I'm unable to reproduce the bug you're reporting on any installed or live system. The AATWS uses timestamps provided by the window manager to sort the windows for the switcher, I don't see any room for mistake on my side. Do you have any other extension enabled?

Knud3 commented 2 years ago

No. I just did USB stick with https://getfedora.org/fmw/FedoraMediaWriter-win32-latest.exe, booted and loaded this one extension.

I can try it again later.

G-dH commented 2 years ago

Hi, any news to the issue?

Knud3 commented 2 years ago

I'm swapping computers. I can try in couple of days with fresh system.

Knud3 commented 2 years ago

Problem exist at least with extension app: https://1drv.ms/v/s!AkB2BxNSQ4E2kvUdfLl2oiYR72-EMA?e=IiZ2hj

Also some addittional feature proposals:

And found one misspell: "Close Aall Windows of Selected App"

G-dH commented 2 years ago

The problem are modal windows - those attached to other window. The focused window with AATWS prefs is not even listed in the switcher if I see it correctly, it seems to be modal of Extensions app window. Window manager updates timestamp of the focused window but not the one of it's parent. On my systems, extension preferences windows launched from the Extensions app appear in the AATWS list like normal windows, unlike dialog windows.

Thanks for the typo and please open new issues for the feature requests.

Knud3 commented 2 years ago

Yes. You are right. But if I switch to Extension window it brings AATWS prefs. And Dash does show it is active: https://1drv.ms/u/s!AkB2BxNSQ4E2kvUeAE_LqkHCkVifag?e=yBYx7X

G-dH commented 2 years ago

Indeed, the order is broken because I've added the sorting of minimized windows by the time stamp and that moves the parent window, which was previously moved to the position of its child, back to its original position in the list. I'll fix it and also add an option that allows to include modal windows to the list.

Knud3 commented 2 years ago

Superb!

G-dH commented 2 years ago

Available in the repository. https://github.com/G-dH/advanced-alttab-window-switcher/commit/57f334b7216c155f6ebfe2bde05fd7279dd171f9

Knud3 commented 2 years ago

For some reason window switching stopped working. App switching still works. No matter if I change hotkey. Reboot did not help. If I disable this extension then native window switching works.

Where does it saves settings? I am using Fedora, if it matters. I will try to reset settings first.

G-dH commented 2 years ago

You can open a terminal and execute the following command to see what's going on:

journalctl /usr/bin/gnome-shell -f -o cat

Settings are stored by the GSettings, you can access it using dconf Editor. Search for advanced-alt-tab.

G-dH commented 2 years ago

I'm testing the code from the repository on 3 different systems and GS versions, including Ubuntu 20.04 with GS 3.36 and Fedora Rawhide with GS 42.beta, and all works.

Knud3 commented 2 years ago
[knude@LCND1457CH5` ~]$ journalctl /usr/bin/gnome-shell -f -o cat
Can't update stage views actor <unnamed>[<ClutterText>:0x563ad333f890] is on because it needs an allocation.
cogl_framebuffer_set_viewport: assertion 'width > 0 && height > 0' failed
Can't update stage views actor <unnamed>[<StLabel>:0x563ad4b26cd0] is on because it needs an allocation.
Can't update stage views actor <unnamed>[<ClutterText>:0x563ad333f890] is on because it needs an allocation.
cogl_framebuffer_set_viewport: assertion 'width > 0 && height > 0' failed
Can't update stage views actor <unnamed>[<StLabel>:0x563ad4b26cd0] is on because it needs an allocation.
Can't update stage views actor <unnamed>[<ClutterText>:0x563ad333f890] is on because it needs an allocation.
cogl_framebuffer_set_viewport: assertion 'width > 0 && height > 0' failed
Can't update stage views actor <unnamed>[<StLabel>:0x563ad4b26cd0] is on because it needs an allocation.
Can't update stage views actor <unnamed>[<ClutterText>:0x563ad333f890] is on because it needs an allocation.
Can't update stage views actor <unnamed>[<MetaWindowGroup>:0x563ad363a300] is on because it needs an allocation.
Can't update stage views actor <unnamed>[<MetaWindowActorX11>:0x563ad53d4b10] is on because it needs an allocation.
Can't update stage views actor <unnamed>[<MetaSurfaceActorX11>:0x563ad53d8a30] is on because it needs an allocation.
JS ERROR: TypeError: pattern is null
_getCustomWindowList@/home/knude/.local/share/gnome-shell/extensions/advanced-alt-tab@G-dH.github.com/windowSwitcherPopup.js:2493:9
_getSwitcherList@/home/knude/.local/share/gnome-shell/extensions/advanced-alt-tab@G-dH.github.com/windowSwitcherPopup.js:574:33
show@/home/knude/.local/share/gnome-shell/extensions/advanced-alt-tab@G-dH.github.com/windowSwitcherPopup.js:501:33
_startSwitcher@resource:///org/gnome/shell/ui/windowManager.js:1711:23

JS ERROR: TypeError: this._switcherList is null
fadeAndDestroy@/home/knude/.local/share/gnome-shell/extensions/advanced-alt-tab@G-dH.github.com/windowSwitcherPopup.js:819:17
vfunc_key_release_event@/home/knude/.local/share/gnome-shell/extensions/advanced-alt-tab@G-dH.github.com/windowSwitcherPopup.js:1320:26
G-dH commented 2 years ago

I need to see the beginning of the event, leave it running and try to open the switcher again, please.

Knud3 commented 2 years ago

It was included.

Key press:

JS ERROR: TypeError: pattern is null
_getCustomWindowList@/home/knude/.local/share/gnome-shell/extensions/advanced-alt-tab@G-dH.github.com/windowSwitcherPopup.js:2493:9
_getSwitcherList@/home/knude/.local/share/gnome-shell/extensions/advanced-alt-tab@G-dH.github.com/windowSwitcherPopup.js:574:33
show@/home/knude/.local/share/gnome-shell/extensions/advanced-alt-tab@G-dH.github.com/windowSwitcherPopup.js:501:33
_startSwitcher@resource:///org/gnome/shell/ui/windowManager.js:1711:23

Key release:

JS ERROR: TypeError: this._switcherList is null
fadeAndDestroy@/home/knude/.local/share/gnome-shell/extensions/advanced-alt-tab@G-dH.github.com/windowSwitcherPopup.js:819:17
vfunc_key_release_event@/home/knude/.local/share/gnome-shell/extensions/advanced-alt-tab@G-dH.github.com/windowSwitcherPopup.js:1320:26
G-dH commented 2 years ago

Thanks I found it too. Fixed...

Knud3 commented 2 years ago

Thanks it works!

It looks like that "Include Modal Windows" option do not do anything. No matter enabled or disabled modal windows are showed and alt tab working in same way. Also Gnome Tweak "Attach Modal Dialogs" do not affect this.

Also original problem does not only occur with modal windows. Here are example (now in better quality): https://1drv.ms/v/s!AkB2BxNSQ4E2kvUjCpIz4nDrIDpjyA?e=cECxQy

G-dH commented 2 years ago

Did you update all AATWS files?

Knud3 commented 2 years ago

Yes. I have always removed whole extension directory, cloned it again from repo and restarted.

G-dH commented 2 years ago

Tested on Fedora 35 and the option works - if active, modal windows are listed. Btw, it's the only system where prefs windows launched from the Extensions app are really modal, usually these windows behave like semi-modal (despite of its Tweaks setting), which complicates their use because it lets you launch another instance of prefs window which is irresponsive until you close the previous one.

Knud3 commented 2 years ago

I do not find any difference between these options. There was reboot between just in case. And this is quite vanilla setup. Just applied those extensions which shown in screenshots and Gnome theme.

https://1drv.ms/u/s!AkB2BxNSQ4E2kvUhXIy7R37SKlMClQ?e=jeeF0c

https://1drv.ms/u/s!AkB2BxNSQ4E2kvUifUC8RuZg__hjRA?e=97xI7B

Anyway... That is just secondary problem. More problematic is that windows which activates after minimizing windows does not affect alt tab order. Like presented here: https://1drv.ms/v/s!AkB2BxNSQ4E2kvUjCpIz4nDrIDpjyA?e=cECxQy (reuploaded because original show just first 4 seconds)

G-dH commented 2 years ago

I've found that the differences makes the Wayland session, works as expected with X11. I'll try to fix it.

Knud3 commented 2 years ago

I am using x11.

I did not get custom resolutions working with Wayland so x11 is way to go for now at least.

G-dH commented 2 years ago

Interesting, I had to switch to Wayland to reproduce at least the Include Modals option bug....

G-dH commented 2 years ago

The problem with the sorting occurs only if I don't click to the window that is being focused after the minimization of the first window, in this case the window manager doesn't update the time stamp without user interaction with the window. I can then activate another window and my history will not be affected by the automatically focused window which I didn't really wanted to activate. This is expected behavior.

Knud3 commented 2 years ago

eg. XFCE and Windows change order even when no interaction with window. It might be expected behavior for others who comes from different desktop environments.

Many times I'm just looking something from window and not interacting with them. Then the order is wrong next time when I try to look that window again.

G-dH commented 2 years ago

Open looking glass (Alt+F2, lg, Enter), from the lg execute this:

global.display.connect('notify::focus-window', ()=>{ let win = global.display.get_focus_window(); if (win) Main.activateWindow(win); })

and then try to reproduce your sorting issue.

Knud3 commented 2 years ago

Super cool! Looks like it "fixes" the issue/feature. I tried the one before you edited your message.

G-dH commented 2 years ago

The edit handles exceptions when the focus changes to null if there is no focus window (empty workspace).

G-dH commented 2 years ago

Ok, I've added the option to Misc page.

Knud3 commented 2 years ago

This works now more or less just what I like. Fantastic! Where I can buy you a coffee?

Modal window option is still mysterious. In my Fedora 35 x11 setup that option do not do anything as seen in these screencaps: https://1drv.ms/u/s!AkB2BxNSQ4E2kvUhXIy7R37SKlMClQ?e=jeeF0c https://1drv.ms/u/s!AkB2BxNSQ4E2kvUifUC8RuZg__hjRA?e=97xI7B

I know I should make new feature requests of these, but they do not concern me that much. Take to your todo list if you like :)

Here is my settings listed if someone care:

- Common
  - Behavior
    Placement: Center
    [ ] Search Mode as Default
  - Appearance
    [ ] Show Tooltip Title
    [ ] Show Hotkeys F1-F12 for Direct Activation
    [ ] Show Status
- Window Switcher
  - Behavior
    [ ] Distinguish Minimized Windows
    [ ] Minimized Windows Last
  - Appearance
    [ ] Show Workspace Index
- Misc
  - Windows Manager
    [X] Always activate Focused Window

Thanks!

G-dH commented 2 years ago

Thanks for your feedback and suggestions, I will try to find some time to fix it and improve. You can buy me a coffee here. Thank you!

G-dH commented 2 years ago

Thanks again for the coffee Mika! Can I ask you what exactly do you mean by "I found that some Window Switcher settings affect App Switcher and vise versa."?