Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window preview in taskbar disappears while moving mouse to click on it #2169

Open
etkaar opened this issue Sep 8, 2024 · 3 comments
Open
Labels

Comments

@etkaar
Copy link

etkaar commented Sep 8, 2024

There is a bug which leads to the previews being closed even if the user has opened the previews and the mouse is still within the previews area. Unfortunately there is another bug in GNOME which leads to the pointer being not visible when recording, so I was required to record it using a smartphone. I am using two monitors, one with 60 Hz and one with 165 Hz, both with a resolution of 2560x1440. Which one is used doesn't make a difference for me.

Screenshots / Video captures

https://www.youtube.com/watch?v=gPpXwq75fcc

Analysis
I did some analysis. First look at this code in windowPreview.js:

    _onHoverChanged() {
        this._endOpenCloseTimeouts();

        if (this.currentAppIcon && !this.menu.hover) {
            this._addCloseTimeout();
            this._endPeek();
        }
    }

I suspect that the bug comes from St.Widget, since this.menu.hover ererroneously returns false, even if the mouse is on the preview. I don't know why St.Widget has problems with setting the correct hover state, but as a workaround it seems that a sync_hover() on this.menu before checking the current hover state fixes it:

    _onHoverChanged() {
        this._endOpenCloseTimeouts();
		
        if (this.currentAppIcon) {
		this.menu.sync_hover();
			
		if (!this.menu.hover) {
			this._addCloseTimeout();
			this._endPeek();
		}
        }
    }

The St.Widget docs says about hover tracking:

Note that currently it is not possible to correctly track the hover
state when another actor has a pointer grab. You can use
St.Widget.sync_hover to update the property manually in this
case.

Maybe I got luck and this is the right way to fix it, but as I don't have much knowledge about GNOME at all, I refrained from creating a pull-request. Would be great though if someone could confirm and fix this issue :)

Linux distribution and version
Zorin OS 17

GNOME Shell version
GNOME Shell 43.9

@charlesg99
Copy link
Member

Can you explain what's happening in your video and how to reproduce it?

@etkaar
Copy link
Author

etkaar commented Sep 18, 2024

Can't you see the video?

@charlesg99
Copy link
Member

I can, I just can't reproduce what I'm seeing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants