paperwm / PaperWM

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

Scratchpad windows vanish while scrolling with Dash to Panel #646

Closed Thesola10 closed 1 year ago

Thesola10 commented 1 year ago

Is your feature request related to a problem? Please describe. Scratchpad windows are a great feature, which is often required for certain apps such as Firefox's Picture-in-Picture. However it is jarring and impractical that they just blink out of view when scrolling through a workspace, when doing so is such a core part of the PaperWM experience

Describe the solution you'd like Would it be possible to keep scratchpad windows displayed while scrolling through the workspace (and changing workspaces since scratchpad is common to all workspaces by default), maybe with reduced opacity?

Thesola10 commented 1 year ago

Likely related to #25

jtaala commented 1 year ago

Hey @Thesola10,

Hmm - do you mean scrolling / swiping windows and switching spaces in PaperWM?

It should remain visible:

https://github.com/paperwm/PaperWM/assets/30424662/c1ae8e3a-ca9e-4ecb-9bc8-cfcc0b7ffe91

Thesola10 commented 1 year ago

Oh, is that so? Well, on my system, they disappear during touchpad gestures.

For reference my install has #643 applied, but that doesn't affect touchpad scrolling.

Capture vidéo du 2023-10-28 11-51-29.webm

Thesola10 commented 1 year ago

Oh, it's related to "Show scratch windows in overview" being set to "Only". Setting it to "Never" fixes it once, switching back brings back the issue permanently, even when set to "Never" again. It's very unreliable.

Nevermind, fix worked once and never again.

jtaala commented 1 year ago

Hmm - I'm not seeing this at all. Can you please run './gather-system-info.sh'?

I'll need to replicate and reproduce exactly what you're seeing to isolate the issue.

@Lythenas - you ever seen this issue?

Thesola10 commented 1 year ago
Distribution: Arch Linux
GNOME Shell 45.0
Display server: Wayland
PaperWM branch/tag: develop
PaperWM commit: 1872c2446b6db0298249c90ccb6431859536fe94
Enabled extensions:
- drive-menu@gnome-shell-extensions.gcampax.github.com
- trayIconsReloaded@selfmade.pl
- arcmenu@arcmenu.com
- nightthemeswitcher@romainvigier.fr
- paperwm@paperwm.github.com
- dash-to-panel@jderose9.github.com
- mediacontrols@cliffniff.github.com
- quick-settings-tweaks@qwreey
- quick-settings-avatar@d-go
- caffeine@patapon.info
- reboottouefi@ubaygd.com
- guillotine@fopdoodle.net
- quicksettings-audio-devices-renamer@marcinjahn.com
- gsconnect@andyholmes.github.io
- vertical-workspaces@G-dH.github.com
Thesola10 commented 1 year ago

Also, I presume you may want a dconf dump as well?

[/]
disable-scratch-in-overview=false
disable-topbar-styling=true
edge-preview-scale=0.0
has-installed-config-template=true
horizontal-margin=20
only-scratch-in-overview=true
override-hot-corner=false
pressure-barrier=true
restore-attach-modal-dialogs='true'
restore-edge-tiling='false'
restore-keybinds='{"cancel-input-capture":{"bind":"[\\"<Super><Shift>Escape\\"]","schema_id":"org.gnome.mutter.keybindings"},"restore-shortcuts":{"bind":"[\\"<Super>Escape\\"]","schema_id":"org.gnome.mutter.wayland.keybindings"},"switch-applications":{"bind":"[\\"<Super>Tab\\",\\"<Alt>Tab\\"]","schema_id":"org.gnome.desktop.wm.keybindings"},"switch-to-workspace-left":{"bind":"[\\"<Super>Page_Up\\"]","schema_id":"org.gnome.desktop.wm.keybindings"},"move-to-monitor-down":{"bind":"[\\"<Super><Shift>Down\\"]","schema_id":"org.gnome.desktop.wm.keybindings"},"switch-applications-backward":{"bind":"[\\"<Shift><Super>Tab\\",\\"<Shift><Alt>Tab\\"]","schema_id":"org.gnome.desktop.wm.keybindings"},"switch-to-workspace-1":{"bind":"[\\"<Super>Home\\"]","schema_id":"org.gnome.desktop.wm.keybindings"},"switch-to-workspace-right":{"bind":"[\\"<Super>Page_Down\\"]","schema_id":"org.gnome.desktop.wm.keybindings"},"switch-to-workspace-last":{"bind":"[\\"<Super>End\\"]","schema_id":"org.gnome.desktop.wm.keybindings"},"switch-group-backward":{"bind":"[\\"<Shift><Super>Above_Tab\\",\\"<Shift><Alt>Above_Tab\\"]","schema_id":"org.gnome.desktop.wm.keybindings"},"move-to-monitor-right":{"bind":"[\\"<Super><Shift>Right\\"]","schema_id":"org.gnome.desktop.wm.keybindings"},"move-to-monitor-left":{"bind":"[\\"<Super><Shift>Left\\"]","schema_id":"org.gnome.desktop.wm.keybindings"},"move-to-monitor-up":{"bind":"[\\"<Super><Shift>Up\\"]","schema_id":"org.gnome.desktop.wm.keybindings"},"switch-group":{"bind":"[\\"<Super>Above_Tab\\",\\"<Alt>Above_Tab\\"]","schema_id":"org.gnome.desktop.wm.keybindings"},"shift-overview-down":{"bind":"[\\"<Super><Alt>Down\\"]","schema_id":"org.gnome.shell.keybindings"},"focus-active-notification":{"bind":"[\\"<Super>n\\"]","schema_id":"org.gnome.shell.keybindings"},"shift-overview-up":{"bind":"[\\"<Super><Alt>Up\\"]","schema_id":"org.gnome.shell.keybindings"}}'
restore-workspaces-only-on-primary='false'
show-window-position-bar=false
show-workspace-indicator=false
swipe-friction=[0.30000000000000004, 0.40000000000000002]
swipe-sensitivity=[3.5000000000000013, 4.0]
topbar-follow-focus=false
use-default-background=true
vertical-margin=34
vertical-margin-bottom=6
window-gap=25
winprops=['{"wm_class":"com.github.rafostar.Clapper","scratch_layer":true}', '{"wm_class":"com.vixalien.sticky","scratch_layer":true}', '{"wm_class":"firefox","title":"Incrustation vidéo","scratch_layer":true}', '{"wm_class":"firefox","title":"Firefox - Indicateur de partage","scratch_layer":true}', '{"wm_class":"gcolor3","scratch_layer":true}', '{"wm_class":"gsconnect","scratch_layer":true}', '{"wm_class":"io.bassi.Amberol","scratch_layer":true}', '{"wm_class":"org.gnome.design.Contrast","scratch_layer":true}', '{"wm_class":"org.kde.kruler","scratch_layer":true}', '{"wm_class":"steam","scratch_layer":true}', '{"wm_class":"Vlc","scratch_layer":true}', '{"wm_class":"zenity","scratch_layer":true}', '{"wm_class":"waydroid.*","scratch_layer":true}']

[keybindings]
close-window=['<Super>q']
switch-down-workspace=['<Super>Page_Down']
switch-up-workspace=['<Super>Page_Up']
toggle-scratch=['<Super>d']

[workspaces]
list=['bc5d8ac8-9430-4482-9070-8f0ad468441d', '78e36ce7-5b4f-4ef4-92d0-5ea8b561e83a', '1ac74b32-e039-4a37-9067-d96c78318bed', '92c64e86-eb1a-404e-bb43-c89a6b17e6a1', 'bfb03386-200d-4021-b9bd-5e251236668e', 'deacc062-6110-484a-a191-6cf27860eca2', '62f1a3c2-7b04-4e74-86d9-0c8734bd9a1d', 'd5312e75-d7e2-44cf-acf6-facabd73d76e']

[workspaces/1ac74b32-e039-4a37-9067-d96c78318bed]
index=2
name='🖵  3'

[workspaces/62f1a3c2-7b04-4e74-86d9-0c8734bd9a1d]
index=6
name='🖵  5'

[workspaces/78e36ce7-5b4f-4ef4-92d0-5ea8b561e83a]
index=1
name='🖵  2'

[workspaces/92c64e86-eb1a-404e-bb43-c89a6b17e6a1]
index=3
name='🖵  4'

[workspaces/bc5d8ac8-9430-4482-9070-8f0ad468441d]
directory='/home/karim'
index=0
name='🖵  1'
show-top-bar=true

[workspaces/bfb03386-200d-4021-b9bd-5e251236668e]
index=5
name='🖵  7'

[workspaces/d5312e75-d7e2-44cf-acf6-facabd73d76e]
index=7
name='🖵  6'

[workspaces/deacc062-6110-484a-a191-6cf27860eca2]
index=4
name='🖵  8'
Thesola10 commented 1 year ago

Also of interest, while running journalctl -f /bin/gnome-shell the following message always appears when scratch windows vanish:

clutter_actor_insert_child_below: assertion 'sibling == NULL || (CLUTTER_IS_ACTOR (sibling) && sibling->priv->parent == self)' failed
jtaala commented 1 year ago

Very strange. I'll checkout your branch and see if I can reproduce.

In the meantime, can you confirm / test by disabling all other extensions (only have PaperWM enabled) and logout/login?

Just to rule out any weird extension clash.

jtaala commented 1 year ago

Hmm - I'm on your branch but can't reproduce. I've set it to different Show scratch windows in overview settings.

I'll put a few tags on this and see if anyone else is seeing this.

jtaala commented 1 year ago

Okay, found the cause - it's dash-to-panel extension. Disabling that stop the window from disappearing.

Thesola10 commented 1 year ago

it's always dash-to-panel isn't it does that mean you can remove the can't reproduce badge? Also, switch "enhancement" with "bug"?

jtaala commented 1 year ago

Hmm - yeah, not sure what dash-to-panel is doing there - maybe it's treating our scratch windows as hidden windows to something?

I was looking for a setting or something in it but couldn't find anything that changed that behaviour.

Thesola10 commented 1 year ago

On a semi-unrelated note, Dash-to-Panel seems to have its own way of restoring windows -- for instance, there's a bug with osu!lazer + fractional scaling + wayland + GNOME 45 where the window is shifted to the bottom quadrant and the rest of the screen is black, but when restoring the window from Dash-to-Panel the issue doesn't occur.

All this may have something to do with Dash-to-Panel's own window previews or window peeking, when hovering over an open app icon, a la Windows 7+. Or not. Tried disabling it, no dice.

jtaala commented 1 year ago

that is so interesting! That semi-related bug you mentioned sounds like something @capsel is seeing in #638.

jtaala commented 1 year ago

The semi-related bug - is there a link for anything for a bug report?

Thesola10 commented 1 year ago

I don't think it's a ppy/osu issue since it only started with GNOME 45. Full-screen max-ing any window causes it to momentarily flash in the bottom right quadrant before fixing itself, while osu! doesn't.

jtaala commented 1 year ago

Anyways, hmm - not sure what to do there then. We don't really have the resources to try address other extension conflict issues (and I don't use dash-to-panel, but have it installed as I check it when others are seeing weird stuff and I can't reproduce).

jtaala commented 1 year ago

momentarily flash in the bottom right quadrant

Yeah, I fixed an animation issue in the latest PaperWM release that was seeing the flashing bottom quadrant issue - but still seeing some issues in Gnome 45 re that stuff.

I'll do some digging next week.

Thesola10 commented 1 year ago

Oh, that's very interesting:

https://github.com/paperwm/PaperWM/blob/ac86435e9692417a2fc153c491705921506aa1f1/scratch.js#L220

According to this line, the panel is used as reference for invoking the scratch clone. Guess what component Dash-to-Panel completely replaces?

Thesola10 commented 1 year ago

Yeah, seems panelBox just doesn't show up in Main.uiGroup's children under Looking Glass when Dash to Panel is active. Thus, Clutter complains that Main.layoutManager.panelBox isn't a neighbor we can add children below.

Could be fixed by finding a component we know isn't thrown away by Dash to Panel in Main.uiGroup, like the scroll view's own shadow clone? This would make PaperWM much more self-contained.

jtaala commented 1 year ago

Nice find! That makes sense. Give it a go and see if it can be worked around.

Thesola10 commented 1 year ago
diff --git a/scratch.js b/scratch.js
index 8f7e3f0..547eace 100644
--- a/scratch.js
+++ b/scratch.js
@@ -217,7 +217,7 @@ export function animateWindows() {
     for (let w of ws) {
         let parent = w.clone.get_parent();
         parent && parent.remove_child(w.clone);
-        Main.uiGroup.insert_child_below(w.clone, Main.layoutManager.panelBox);
+        Main.uiGroup.insert_child_above(w.clone, global.window_group);
         let f = w.get_frame_rect();
         w.clone.set_position(f.x, f.y);
         Tiling.animateWindow(w);

this works for me, just placing scratch windows above the global.window_group, taking inspiration from liveAltTab.js