GNOME Bugzilla – Bug 725369
Overlay scrub bar (slider) disappears while using it
Last modified: 2014-04-15 02:08:38 UTC
The slider disappears while sliding through the document. How to reproduce it? Slowly slide through a large document. Looks like the timeout happens regardless of whether the slider is being used or not.
I forgot to mention that next/previous page overlay buttons don't disappear if mouse is over them. That's the behaviour one also wants for scrub bar.
I'm not able to reproduce that bug here (3.10.1) - the navigation bar doesn't actually disappear until you click away from it. Can you confirm exactly which version you are running?
This bug was introduced in the 3.11 development cycle when behavior regarding visibility of navigation bar was changed. The change was discussed in #720518 and commited in 487ec071d54b0d33458b908f8f0de31e9d82f869.
Thanks for the quick response! I agree with the bug reporter - the time out to hide the navigation bar should only start once you have released the seek slider.
Maybe it would be even better if the time out started only once pointer left the navigation bar area. If I have pointer over navigation bar I usually want to do something with the navigation bar (move to some other page, see TOC) and it feels kinda strange if the navigation bar disappears while I'm making up my mind on what exactly to do. A movie player I'm using (mpv) starts to count time for timeout only after the pointer leaves navigation bar and I like that behavior. It doesn't "break the context" of user's intent.
(In reply to comment #5) > Maybe it would be even better if the time out started only once pointer left > the navigation bar area. If I have pointer over navigation bar I usually want > to do something with the navigation bar (move to some other page, see TOC) and > it feels kinda strange if the navigation bar disappears while I'm making up my > mind on what exactly to do. A movie player I'm using (mpv) starts to count time > for timeout only after the pointer leaves navigation bar and I like that > behavior. It doesn't "break the context" of user's intent. Good point - makes a lot of sense.
I think that the timer is already set to start when pointer leaves the navigation bar. I look a little bit into it and I think that I found a root of the problem. Slider disappears while sliding through the document because the signals 'enter-notify-event' and 'leave-notify-event' connected to this.bar_widget are not received. While next/previous page buttons receive those signals and react with corresponding behaviour. The reason slider shows this behaviour is because GtkBox doesn't have associated X window (while GtkButton has) so it cannot receive events. The fix could be to use GtkEventBox, becuase it will provide an X window to its child widget. When I implemented the new solution with the GtkEventBox I realized that if we connect the signals to the GtkEventBox (which has buttons and slider on top of it) those signals will be triggered whenever we hover widgets with the X window. This is the problem since we only want to trigger those events when the pointer goes out of the navigation area. I came up with two possibile solutions for this problem: 1. Connect the signal only to the slider (just the small area around the slider will have the functionality we want). 2. Override the enter_notify_event and leave_notify_event handlers. In enter_notify_event set the state to prelight. In leave_notify_event check the pointers position (if it has left the EventBox, or hover other widgets).
Created attachment 273198 [details] [review] Implements GtkEventBox for navigation bar to provide X window Since GtkBox doesn't have associated X window it doesn't receive signals inherited from GtkWidget ('enter_notify_event' and 'leave_notify_event'). In this approach signals are connected to the GtkScale so when the pointer enters scale area 'enter_notify_event' will be triggered and 'leave_notify_event' when it leaves the scale area. The function called on the signal 'leave_notify_event' will set the timeout after which navigation bar will disappear. I'm also working on the second solution I proposed in the previous message, which might be better because then the whole area of the navigation bar would have the behaviour we want (when the cursor leaves it sets the timeout).
The fix was not that simple, as you guessed :-) I pushed now an implementation of this to git master - thanks for the patch anyway! You can find a longer explaination of the code in the commit message.