Skip to content

floating-bar: Fix hiding on hover

Ignacy Kuchciński requested to merge ignapk/nautilus:floating-bar-fixes into master

Marked as draft as I'm not sure if this is the best way to handle the situation.

Before the move to GdkEventControllerMotion in 48c083e9, the code that set timeout for check_pointer_timeout function that hid the floating bar was inside functions that were called either on entering the floating bar itself (overlay_enter_notify_cb), or had a check at the beginning to make sure the event was in fact entering the floating bar (overlay_event_cb). After that move that was made in preparation for GTK4, that code is inside a function (on_event_controller_motion_enter) that is called on entering the parent of the floating bar, not itself, which results in the floating bar hiding on hover only when hovered from below the window.

Since switching to GTK4 the floating bar no longer automatically hides while hovering the pointer over it. This is because in GTK 4 entering the child area (floating bar in our case) isn't treated as leaving the parent, so fix this situation by moving the relevant code to the on_event_controller_motion_motion() that is called on every motion inside the parent of the floating bar.

Other potential solution I could think of would be to set the controller for the floating bar instead of the parent widget, and then in check_pointer_timeout get the parent pointer coordinates in some other way.

Moreover, ever since the start of hiding the floating bar on hover in e66d3ca6, it has been possible to keep the bar hidden even when not hovering on its place by moving the cursor to the left. This is because only the y coordinate has been checked in appropriate functions, so check for the x coordinate as well.

Fixes #2100 (closed)

Edited by António Fernandes

Merge request reports