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

Widgets stay hovered when mouse leaves #372

Open
LilleAila opened this issue Mar 30, 2024 · 4 comments · May be fixed by #397
Open

Widgets stay hovered when mouse leaves #372

LilleAila opened this issue Mar 30, 2024 · 4 comments · May be fixed by #397

Comments

@LilleAila
Copy link

When I use the :hover property in css for a system tray icon, it still stays hovered when the mouse leaves if I enter the menu, then close it without clicking the icon, as demonstrated in this video:

recording.mp4

This and this is the code for the system tray.

@LilleAila
Copy link
Author

The video did not upload properly. Here is the same video:

recording.1.mp4

@coolstrong
Copy link

Same here. This bug happens for me only when I assign opening menu to primary click, just like you did; If a menu is opened with secondary click, it works correctly. So as a temporary workaround you can do the same.

@sl33nyc
Copy link

sl33nyc commented Apr 19, 2024

In my experience, onHoverLost seems to work when the mouse hover is lost over the containing window. If the mouse hover is lost outside of the containing window, the onHoverLost is not executed.

@sl33nyc
Copy link

sl33nyc commented Apr 28, 2024

The culprit seems to be ags's Widget.isHovered. Bug affects Widget.EventBox and Widget.Button.

Workaround:

const child = Widget.Label({label: "or any other Widget"});
const eventBox = new Widget.EventBox({
    child,
    onHover: event => {
        // this works :)
    },
    onHoverLost: event => {
        // this doesn't work :(
    },
});
eventBox.connect('leave-notify-event', (_, event) => {
    // this works :)
});
return eventBox;

@sl33nyc sl33nyc linked a pull request Apr 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants