https://bugs.winehq.org/show_bug.cgi?id=41909
Bug ID: 41909 Summary: Calling TBM_SETPOS after TBM_SETRANGEMIN/TBM_SETRANGEMAX does not draw slider control properly Product: Wine Version: 1.9.23 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: wine@sagagames.de Distribution: ---
The default range for a slider is 0 to 100, so the value 0 is on the left side of the slider (assuming a horizontal slider).
I have a slider control ranging from -500 to +500, the range is being set using TBM_SETRANGEMIN / TBM_SETRANGEMAX. This means that the value 0 should be precisely in the middle. However, after calling TBM_SETPOS with a parameter of 0, the slider stays at the left side of the control, even though it should now be located in the middle. This works as expected on Windows, but not in Wine 1.9 on latest Xubuntu.
Code to reproduce: SendMessage(hWnd, TBM_TBM_SETRANGEMIN, FALSE, -500); SendMessage(hWnd, TBM_TBM_SETRANGEMAX, FALSE, 500); SendMessage(hWnd, TBM_SETPOS, TRUE, 0);
https://bugs.winehq.org/show_bug.cgi?id=41909
--- Comment #1 from Johannes wine@sagagames.de --- Obvious typo in the example: TBM_TBM should just be TBM.
https://bugs.winehq.org/show_bug.cgi?id=41909
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Component|-unknown |comctl32 Assignee|wine-bugs@winehq.org |bunglehead@gmail.com
--- Comment #2 from Nikolay Sivov bunglehead@gmail.com --- Hi, Johannes.
I can reproduce this, thanks for . It doesn't happen if you start with range [0, 100], with position at 50 and then run your message sequence, but it does happen if initial position is 0. I'm looking at possible fix.
https://bugs.winehq.org/show_bug.cgi?id=41909
--- Comment #3 from Johannes wine@sagagames.de --- Hi Nikolay, Yes, my current workaround is to just set the slider to *any* position that is not 0 before setting it to the actual value, that way it moves to the intended position.
https://bugs.winehq.org/show_bug.cgi?id=41909
--- Comment #4 from Nikolay Sivov bunglehead@gmail.com --- Actually, I don't think it's supposed to work like you expect it to. I did some more testing and it's clearly checking previous position and if it's the same thumb does not move. Could you attach your test application here, so I can test it myself?
https://bugs.winehq.org/show_bug.cgi?id=41909
--- Comment #5 from Johannes wine@sagagames.de --- (In reply to Nikolay Sivov from comment #4)
Actually, I don't think it's supposed to work like you expect it to. I did some more testing and it's clearly checking previous position and if it's the same thumb does not move. Could you attach your test application here, so I can test it myself?
The real-world example where this is taken from is OpenMPT: https://openmpt.org/download
Run the application, go to File -> New -> OpenMPT Module, then View -> Song Properties, then click "Configure Swing". You will notice that all sliders are centered on Windows (their value is 0 in a -500...500 range), but on Wine they are all on the left.
OpenMPT is an MFC application but I checked that MFC's wrappers don't do anything else apart from these SendMessage calls.
If this is too complicated to debug, I can try whipping together a minimal example.
https://bugs.winehq.org/show_bug.cgi?id=41909
--- Comment #6 from Nikolay Sivov bunglehead@gmail.com --- Ok, thanks. I checked out your trunk revision, and I think I see where this comes from, this dialog does:
--- r->valueSlider.SetRange(-SliderResolution / 2, SliderResolution / 2); r->valueSlider.SetTicFreq(SliderResolution / 8); r->valueSlider.SetPageSize(SliderResolution / 8); ---
According to my testing SetTicFreq() makes a difference, because it updates thumb position (TBM_SETTICFREQ does not have additional deferred update argument, so it always updates). We currently don't touch thumb at all on TBM_SETTICFREQ. Could you do a test build of your application without SetTicFreq and SetPageSize call to confirm that it breaks on windows too?
https://bugs.winehq.org/show_bug.cgi?id=41909
--- Comment #7 from Johannes wine@sagagames.de --- Yes, this does indeed seem to cause the difference. Without those two calls, the handles all stay on the left side of the slider.
https://bugs.winehq.org/show_bug.cgi?id=41909
--- Comment #8 from Nikolay Sivov bunglehead@gmail.com --- Ok, thanks for testing.
https://bugs.winehq.org/show_bug.cgi?id=41909
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|bunglehead@gmail.com |wine-bugs@winehq.org
--- Comment #9 from Nikolay Sivov bunglehead@gmail.com --- I've just sent a fix for that, https://www.winehq.org/pipermail/wine-patches/2016-December/156440.html.
https://bugs.winehq.org/show_bug.cgi?id=41909
--- Comment #10 from Nikolay Sivov bunglehead@gmail.com --- This should be fixed with a6aabe0159b6c38664380718b57418618e305704. Please retest.
https://bugs.winehq.org/show_bug.cgi?id=41909
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |a6aabe0159b6c38664380718b57 | |418618e305704 URL| |https://openmpt.org/downloa | |d Keywords| |download Status|NEW |RESOLVED
--- Comment #11 from Nikolay Sivov bunglehead@gmail.com --- Resolving, I tested it, and it works properly now. Please remove any workaround for that you have in trunk, so we can have some testing from your users too.
https://bugs.winehq.org/show_bug.cgi?id=41909
--- Comment #12 from Johannes wine@sagagames.de --- Sorry for the delay, I finally got to test it and can confirm that it works as expected in OpenMPT 1.26.07.00. However, I am hesistant to remove the workaround at this point in time as I can see that the majority of our Wine users are on Wine 1.6.
https://bugs.winehq.org/show_bug.cgi?id=41909
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #13 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 2.0-rc3.
https://bugs.winehq.org/show_bug.cgi?id=41909
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |1.8.x
https://bugs.winehq.org/show_bug.cgi?id=41909
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|1.8.x |---
--- Comment #14 from Michael Stefaniuc mstefani@redhat.com --- Removing 1.8.x milestone from bugs included in 1.8.7.