-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix filmstrip: keyboard shortcuts apply to wrong image #19782
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
base: master
Are you sure you want to change the base?
Conversation
|
From a quick test, it looks like that fixes it. |
|
@dterrahe : I'd like you review on this if possible. TIA. |
|
This fixes the issue on my side too. |
|
I can't properly test this week, sorry. The thing to look out for is what happens when you move directly from hovering over a "gadget" within the thumbnail to outside the thumbnail. For example when the gadget (a star or something) is bordering the thumbnail or if the mouse move is so quick that there's no intermediate position where it is outside the gadget but still inside the thumbnail. In that case, does the thumbnail leave get called? Does everything reset correctly? In gtk4 the enter/leave stuff is rejigged so that (I think) the outermost object always gets notified when you leave, but in gtk3 I remember we had issues around this. |
|
If you move the cursor from the "stars" from left to right in the reject of another image, the ID does not change. Working with it. I haven't found any other errors yet. |
|
Another option would be to get rid of the 1px of space between the thumbs (or make that space part of the thumb widget somehow), wouldn't it? |
There's a different problem - the overlays don't cover the thumbnail entirely. But there is no gap between the thumbnail (this is indicated by the correct operation of the tooltip). They'll make a commit soon, which I haven't identified any problems on yet (I'm testing at the moment) |
Fixes darktable-org#19775 Problem: When the mouse cursor is over a thumbnail in the filmstrip (especially over overlay elements like stars or reject button), keyboard shortcuts for rating, color labels, etc. were being applied to the currently open image in darkroom instead of the image under the cursor. Additionally, fast transitions between overlay elements of different thumbnails didn't update mouse_over_id correctly. Root cause: Keyboard events trigger spurious GDK_LEAVE_NOTIFY events with GDK_NOTIFY_ANCESTOR detail in GTK. The thumbnail's leave event handlers were resetting mouse_over_id to NO_IMGID when receiving these events, causing dt_act_on_get_images() to fall back to using active_images instead of the hovered image. before updating mouse_over_id, which prevented updates during fast transitions between overlay elements of different thumbnails. Solution: 1. Remove mouse_over_id resets from thumbnail-level leave handlers. The proper place to reset mouse_over_id is in thumbtable's leave handler (_event_leave_notify in thumbtable.c), which correctly distinguishes between leaving the thumbnail for another thumbnail (GDK_NOTIFY_INFERIOR) and actually leaving the thumbtable area. ensure mouse_over_id is updated on every enter event, enabling proper tracking during fast mouse movements between thumbnails. 3. Add mouse_over_id update to _event_btn_enter_leave for overlay buttons (reject, color labels, etc.) to handle transitions to these elements. 4. Add proper darktable.control->element reset in leave handler for reject button to ensure hover state is cleared correctly. Changes: _event_image_enter_leave, and _event_star_enter - Added mouse_over_id update to _event_btn_enter_leave enter handler - Added darktable.control->element reset to _event_btn_enter_leave leave handler for reject button - Removed _event_main_leave function and its signal connection entirely as it served no purpose after removing the mouse_over_id reset
98ebe19 to
0c8724f
Compare
|
Updated the fix to handle additional edge cases:
These changes address the feedback about fast mouse movements between overlay elements while maintaining the original fix for keyboard shortcuts. |
|
I'm a bit uneasy for this in 5.4. The issue it fixes is not that bad and I fear some possible regression with this as it touches a delicate part. |
|
Yes, there's a vicious circle - fixing one problem brings back another. If the move to gtk4 is just around the corner, then let it stay as it is? |
|
Yes, either that or merge this early in 5.6 cycle to at least get good field testing. You're call on this, if you prefer closing this let me know. |
Let's do this |
Fixes #19775
Problem:
When the mouse cursor is over a thumbnail in the filmstrip (especially over overlay elements like stars or edges), keyboard shortcuts for rating, color labels, etc. were being applied to the currently open image in darkroom instead of the image under the cursor.
Root cause:
Keyboard events trigger spurious GDK_LEAVE_NOTIFY events with GDK_NOTIFY_ANCESTOR detail in GTK. The thumbnail's leave event handlers (_event_box_enter_leave, _event_btn_enter_leave, _event_star_leave, _event_main_leave) were resetting mouse_over_id to NO_IMGID when receiving these events, causing dt_act_on_get_images() to fall back to using active_images instead of the hovered image.
Solution:
Remove the mouse_over_id resets from thumbnail-level leave handlers. The proper place to reset mouse_over_id is in thumbtable's leave handler (_event_leave_notify in thumbtable.c), which correctly distinguishes between leaving the thumbnail for another thumbnail (GDK_NOTIFY_INFERIOR) and actually leaving the thumbtable area.
Changes: