pop-os / beta

Pop!_OS Beta
356 stars 19 forks source link

Window previews can cause dock to hide and not reappear #361

Closed keftie22 closed 2 years ago

keftie22 commented 2 years ago

How did you upgrade to 22.04? (Fresh install / Upgrade)

Fresh install

Related Application and/or Package Version (run apt policy $PACKAGE NAME):

gnome-shell-extension-cosmic-dock: Installed: 72\~ubuntu2pop0\~1648682391\~22.04\~adbb0bb

Issue/Bug Description:

Clicking on an application with more than one instance open in order to see the window previews results in the dock disappearing immediately while the previews remain floating.

https://user-images.githubusercontent.com/101351551/161379971-b962a74d-e724-440e-abcb-273545a3eab2.mp4

Steps to reproduce (if you know):

  1. Enable "Always hide" or "Intelligently hide" in the dock settings
  2. Set icon click action to "Launch, Minimize, or Preview Windows" in the dock settings
  3. Open more than one instance of a GUI program
  4. (If intelligently hidden) have a window open such that the dock is minimized behind it
  5. Move mouse toward the dock to show it
  6. Click on a program with multiple instances to see the window previews appear while the dock disappears

Expected behavior:

Dock will not disappear when the windows previews appear.

Other Notes:

jasonrhansen commented 2 years ago

This also happens when right-clicking on the dock. The right-click menu appears, but the dock hides. When trying to select an item, the menu shifts down.

https://user-images.githubusercontent.com/1126521/162338015-862c7d0a-f33d-460c-8303-914ccdb86a47.mp4

jasonrhansen commented 2 years ago

After updating today, the popup menu no longer shifts down when clicking on it.

jasonrhansen commented 2 years ago

And now it's happening again.

n3m0-22 commented 2 years ago

This appears to have been fixed so I'm closing it, but we can always reopen if you are still having the issue.

jasonrhansen commented 2 years ago

It's still happening for me after I updated.

When the dock is set to "Always Hide" or "Intelligently Hide" and there is an application window overlapping the dock area, the dock disappears for both the window previews, and the right-click popup menu.

As for the popup menu shifting down when trying to click on it, this seems to only happen sometimes. Strangely, the only way I can reliably reproduce the issue is to have an Alacritty terminal window overlap the dock. In fact my video in a comment above shows it happening with Alacritty open.

jasonrhansen commented 2 years ago

I suspect this change to gnome-shell is what caused the problem: https://gitlab.gnome.org/GNOME/gnome-shell/-/commit/63725ef0eff42a586fdcd13e862eeeae2313256e

In cosmic dock blockSourceEvents is set to true, but from the change above you can see it doesn't do anything anymore. https://github.com/pop-os/cosmic-dock/blob/404e4f264c71de44f4b586b0aef4ce7ac643a925/appIcons.js#L907-L908

keftie22 commented 2 years ago

It's not fixed for me either. It's still behaving exactly way as when I first opened the issue.

keftie22 commented 2 years ago

@n3m0-22 This is still not fixed, can we please reopen it.

n3m0-22 commented 2 years ago

I'm looking into it.

n3m0-22 commented 2 years ago

So far I have tested this with several debug ISOs as well as beta 2 and 3. I have tried updating packages one at a time restarting gnome in between, but it hasn't helped narrow down exactly what is causing this. I have tried everything I can think of in terms of enabling and disabling extensions and their settings, but it has been no help. The closest I've come to identifying the problem is changing a line in the docking.js file in the cosmic-dock extension directory.

    _hoverChanged() {
        if (!this._ignoreHover) {
            // Skip if dock is not in autohide mode for instance because it is shown
            // by intellihide.
            if (this._autohideIsEnabled) {
                if (this._box.hover)
                    this._show();
                else
                    this._hide();
            }
        }
    }

Change this

                else
                    this._hide();

to this

                else
                    this._show();

after that the dock will stay showing in Always Hide mode with a right click for the menu, but still disappears if you click an icon with multiple windows for Preview Windows. I'll keep looking into it and see if anyone else has any thoughts. Please update here if you notice any changes in behavior after running sudo apt update && sudo apt upgrade.

jasonrhansen commented 2 years ago

@n3m0-22 I messed around with the code a bit and came up with something that works. I'm not familiar with Gnome Shell extension development so it's entirely possible there's a better way fix this, but I opened a PR for cosmic-dock. It seems to be working well for me.

n3m0-22 commented 2 years ago

@jasonrhansen I'll check this out this weekend.