Version: 4.7 (using KDE 4.7.3) OS: Linux Using Oxygen the theme, the slider is not centered under the mouse and it exibits behaviour that lack precision. Reproducible: Always Steps to Reproduce: 1. Open any media in VLC 2. Use the time slider to make a small adjustment by eather: a. Clicking (and holding down the mouse) anywhere on the slider "rail" or b. Clicking (and holding down the mouse) on the position indicator. Actual Results: The selected position is not centered under the mouse, the actual position is skewed a few pixels to the left of the position indicator. This makes it unpredictable and very hard to make small adjustments in the slider position. And the results is not fully consistent eather. (Try dragging the slider from different positions on the slider indicator and its position relative to the mouse is not consistant.) Expected Results: The slider set position should be exactly centered under the mouse, further it should be possible to adjust the slider with maximum precision. There is two ways to fix this bug 1. Easy fix: make the position always centered under the mouse pointer. 2. I would like to propose a better way of handling the slider: When clicking on the position marker (and continuing holding down the mouse) at first the position is not changed at all (before the drag operation begins). The change in position is the delta mouse move from the point where the mouse was clicked to the point where the mouse was released. If you begin dragging the left side of the indicator, this is where you will end up holding it when the drag finishes. This will make it much easier to make slight adjustments to the slider position, and give no unpredicted results. This is the same behaviour that the scrollbars exibit, which will make the user experience more consistent, when you first start dragging the scrollbar it does not change position until there is a delta. To illustrate this point, we imagine a scenario where the user would like to shift the slider ever so slightly to the left/right. The minimal change would be one pixel (which for a skilled mouse user is well achievable). In order to make this adjusement, the user first have to guess where the actual center of the ball is (this is hard even if this point actually had been centered, and depending on if the ball has even or uneven diameter, the might not even be a center point) as to not get a scewed starting position for the adjustment, then make the adjustment and release the button.
Point 2: has nothing to do with oxygen. This is the behavior of the widget itself and should be dealt with by vlc. (right ?) as for point 1: I'll investigate. In principle we just draw the slider position where we are asked too but I might have screwed the metrics. Will double check.
Ok. I can reproduce the "off by a few pixels to the right" issue. It is actually also true with all other sliders in other apps. In fact the issue seems more complicated: the slider is off center to the left when on the left side of the widget; and to the right when on the right side. Seems like a scaling issue to me ... Will keep you posted.
(In reply to comment #1) > Point 2: has nothing to do with oxygen. This is the behavior of the widget > itself and should be dealt with by vlc. (right ?) I'm sorry, your right, I just confirmed this using Qt Designer, should of curse have done this before reporting. I'll try and see if I can bring point 2 to the VLC developers instead. Using a slider 1000px wide with values from 1 to 1000 (1:1 ratio) I find it to be off by +-5px at each end, that is when the slider is at position 1, I drag the slider 5 pixels to the right without moving the slider. Upon further investigation, I find the issue to also affect Motif and CDE. CDE also suffers from a rounding error, sometimes it will jump two pixels and sometimes it will skip a jump. Using the same 1000px slider this what I get with the widget-styles avaliable on my system: Oxygen Scaling-error: -5px Rounding-error: not detected Motif Scaling-error: +2px Rounding-error: not detected CDE Scaling-error: +1px Rounding-error: yes MS Windows 9x Scaling-error: not detected Rounding-error: not detected Clearlooks Scaling-error: not detected Rounding-error: not detected GTK+ Style Scaling-error: not detected Rounding-error: not detected
Yes, I confirm that I can see the same issue with other widget styles, although less pronounced than with oxygen. Now, I think I have fixed the oxygen rounding issue, and am about to commit the fix. So that's good news ! Will keep you posted. Thanks for the detailed investigation !
The motif and cde part, I will not fix. In fact this is Qt code (they are built-in Qt widget styles), and this should be reported to them. As a matter of fact I believe there is a bug inside Qt directly (though it can be fixed at the widget style level), in the sense that the conversion from Mouse Position to Slider position does not use the CC_Slider sub-element rect (and rather the widget rect), whereas the slider positioning (the handle) does. This inconsistency leads to the offsets you mention, if the widget rect and the subelement-rect differ. So that maybe you could report the bug to Qt also, pointing them to this page. In the meanwhile I will (before the end of today) fix the oxygen part, and close this bug report accordingly. Cheers, Thanks for reporting, Hugo
(In reply to comment #5) > The motif and cde part, I will not fix. In fact this is Qt code (they are > built-in Qt widget styles), and this should be reported to them. > > As a matter of fact I believe there is a bug inside Qt directly (though it can > be fixed at the widget style level), in the sense that the conversion from > Mouse Position to Slider position does not use the CC_Slider sub-element rect > (and rather the widget rect), whereas the slider positioning (the handle) does. > This inconsistency leads to the offsets you mention, if the widget rect and the > subelement-rect differ. > > So that maybe you could report the bug to Qt also, pointing them to this page. > In the meanwhile I will (before the end of today) fix the oxygen part, and > close this bug report accordingly. > > Cheers, > > Thanks for reporting, > > Hugo Great to hear the that the Oxygen part is fixed! I was just about to write a question about the Motif/CDE part as you answeard. I will make a bug report at qt.nokia.com as per your suggestion.
Git commit bfd23a37238004352b0695c16d5df4ce7a8a0755 by Hugo Pereira Da Costa. Committed on 04/12/2011 at 10:26. Pushed by hpereiradacosta into branch 'KDE/4.7'. removed sliderSubControlRect; moved relevant rect adjustment to painting method. This fixes calculations of slider position from mouse pointer position. CCBUG: 288088 M +27 -49 kstyles/oxygen/oxygenstyle.cpp M +0 -1 kstyles/oxygen/oxygenstyle.h http://commits.kde.org/kde-workspace/bfd23a37238004352b0695c16d5df4ce7a8a0755
ok. That fixes it. You'll have to wait for kde 4.8 (or build oxygen by yourself), to get the fix. I also pushed to the KDE/4.7 code, but I'm not sure whether there will be another KDE4.7 release or not. Cheers, Hugo
Git commit a222f18a824b4252dbe2153c08cc4bf7f246dfc1 by Hugo Pereira Da Costa. Committed on 04/12/2011 at 10:26. Pushed by hpereiradacosta into branch 'master'. removed sliderSubControlRect; moved relevant rect adjustment to painting method. This fixes calculations of slider position from mouse pointer position. CCBUG: 288088 M +27 -49 kstyles/oxygen/oxygenstyle.cpp M +0 -1 kstyles/oxygen/oxygenstyle.h http://commits.kde.org/kde-workspace/a222f18a824b4252dbe2153c08cc4bf7f246dfc1
Reported upstream: https://bugreports.qt.nokia.com/browse/QTBUG-23004
And here is the VLC ticket: https://trac.videolan.org/vlc/ticket/5631