paperwm / PaperWM

Tiled scrollable window management for Gnome Shell
GNU General Public License v3.0
3k stars 127 forks source link

Instant "Switch to Window." #940

Closed Plyply99 closed 1 month ago

Plyply99 commented 1 month ago

Currently when using hotkeys to switch to a different window there is a pause and the unfocused windows darken.

Would it be possible to make the switch instant? Here is a clip of what I mean. Note the switch to another window is instant with no delays.

https://github.com/user-attachments/assets/f6d7ff5a-284d-43e0-8b7f-77b81c13a64c

jtaala commented 1 month ago

Would it be possible to make the switch instant? Here is a clip of what I mean. Note the switch to another window is instant with no delays.

Yes. So, the darkening non-selected windows is linked to the showing of the minimap (which you might not use). I suppose we could separate the delays for showing the minimap and darkening windows (and could make both timeouts user-settable (e.g. add them to advanced settings in PaperWM).

Anyways, you can change this timeout here (currently set to 200ms):

https://github.com/paperwm/PaperWM/blob/2c3e76a63951fa2f278e89ffc9cacfa59e5fe994/navigator.js#L333

Feel free changing this to 0 and see how it feels.

Plyply99 commented 1 month ago

I tried setting it to 0 millisecs and it seems a bit better maybe. Feels like the switch focus is tied to the release of the super key. I use Super+Arrows to move window focus. Here is another clip.

https://github.com/user-attachments/assets/122f2af5-b331-49fd-b360-e143f92b71db

What I want is for the focus to change instantly with no darkening and not be tied to release of Super key.

jtaala commented 1 month ago

What I want is for the focus to change instantly with no darkening and not be tied to release of Super key.

So, switching is instant (always has been), darkening is linked to the minimap (which has a delay). Darkening can be disabled too btw (see that to 0):

image

I can't see any delay in your videos though (since I can't see when you're pressing a button).

for the focus to change instantly with no darkening and not be tied to release of Super key.

That's exactly what happens, it isn't bound to the release - if that isn't happening for you, then it sounds like there's something interfering with that keybind.

jtaala commented 1 month ago

Can you change the keybind as a test? Also what happens if you hold the keybind down? (just checking if it quickly moves through all windows or stops?).

Plyply99 commented 1 month ago

Thank you for the dimming to 0! That helps. Tried changing to different key bind and same result. 1) Hold modifier key and use arrows to change focus. 2) While modifier key is held down it puts windows in a alternate state, (not sure how to say this) until modifier key is released. It's quite noticeable when using transparency.

https://github.com/user-attachments/assets/037b88d1-238d-41e0-a7f7-919fef67452c

jtaala commented 1 month ago

Okay, quick one, did you specifically turn off the mini-map? (I notice it's not showing).

For testing, can you please enable the minimap (which is the default setting) - you should see the instant windows switch, then 200ms later the minimap should appear (if you're still holding the super key down).

That'll help me see if it operating as it should be (or if there's something interfering with it). Here's how to set the minimap size (setting to 0 disables the minimap):

image

Plyply99 commented 1 month ago

Yes I had minimap turned off. Here is turned on.

https://github.com/user-attachments/assets/f7cd48f1-d829-4cfd-86ab-b403b130894e

jtaala commented 1 month ago

I see, something is happening there that's not normal PaperWM behaviour. First up, can you please paste info from the about tab in settings (so I can see version etc.). E.g.

image

Plyply99 commented 1 month ago

Distribution: Fedora Linux 40 (Workstation Edition) GNOME Shell: 46.4 Display server: Wayland PaperWM version: 46.17.0 Enabled extensions:

jtaala commented 1 month ago

Thanks - for testing purposes (to rule out extension conflicts, which I'm thinking may be the issue here), can you disable all other extensions (again, to try isolate the issue) and just have paperwm enabled - then logout/login (important as need to unload all other extension code).

For reference, windows should be actually activated (not just selected and then activated on key-release) when switching, e.g.:

https://github.com/user-attachments/assets/1fecb43b-fbc0-43f2-bb6c-46b0ffa24bac

Another thing to test (and rule out) is focus-follows-mouse or focus-on-hover behaviours (e.g. just try switching to default Click to Focus just to see if still can reproduce the switching issue here).

Plyply99 commented 1 month ago

All extensions off except PaperWM, getting same results. EDIT: Focus on hover is off also.

https://github.com/user-attachments/assets/c5ae2cb7-7db1-4ba8-8dfc-b499e29c3f96

jtaala commented 1 month ago

Hmmm - can't reproduce (and haven't seen this before). But def something is stopping the full activation of windows on selection on your setup (which is not normal paperwm behaviour).

Unfortunately, when we get to this point, and we can't reproduce, it's often some non-extension changes or other customisations for the environment.

If you get a chance (and have the motivation), I'd suggest creating a new user (just for testing and trying to isolate the issue) - log into that new user (should then be running vanilla gnome with default settings), just install paperwm and check you are still seeing the same thing.

Let me know if you have any luck in finding any other hints/tips that I can try to reproduce this.

I thought it might be something in Fedora 40, but I've got it up and running on my vm, and still can't reproduce what you're seeing.

Plyply99 commented 1 month ago

I'll keep testing it. I do appreciate very much your time. PaperWM is still awesome!

Plyply99 commented 1 month ago

Ok setup new user and getting same results. I have to let go of Modifier Key.

https://github.com/user-attachments/assets/42a8d031-59a9-4e12-ad58-365ec9281748

jtaala commented 1 month ago

Wait, that one looks fine (it at least different from your previous video).

You'll note in your previous video (easier to see when minimap is up), that switching to a window with keybind didn't change the white border to the selected window until you released the keybind (and the minimap closed).

In the new user video, it changes instantly as you select a window (as it should).

jtaala commented 1 month ago

The border indicates which window is selected/activated, and should be updated to the new selected window instantly (no delay).

I may be misunderstanding what you mean or are after then.

Plyply99 commented 1 month ago

Right the border moves instantly. But the actual focus change happens after release of Modifier Key. You can see that by the color change of the app when in focus. As an example, I use hotkeys for my most used apps. 1) I change window focus with Super+Arrow 2) While still holding down Super also press T to open my text editor Emacs. It will not work. I first have to release Super for the focus change to complete. Then I can Super+T to open Emacs.

jtaala commented 1 month ago

I see, sounds like you want to destroy the navigator and keyboard modal hold on each window selection.

Plyply99 commented 1 month ago

Yes! That's it.

jtaala commented 1 month ago

That'll make window switching a one-shot operation, and now makes sense why you don't use the minimap (since a one-shot operation would close the minimap, or just make it not applicable).

Will leave this one up as a request. But a well placed Navigator.getNavigator().finish() at the end of the tiling.switch method would probably do this.

Plyply99 commented 1 month ago

I found an extension that only does switch window focus and it works perfectly with PaperWM. https://extensions.gnome.org/extension/4627/focus-changer/

Thanks again for your help jtaala.

jtaala commented 1 month ago

Nice find! That extension work very well if you want this kind of switching in PaperWM. So much so, that I wouldn't implement this type of switching into PaperWM specificall (I don't use it, and would need new options and probably some keybind modal refactoring etc).

Will close this one now.