Problems with list box with LBS_NODATA

Questions about Wine on Linux
Locked
johnfound
Level 2
Level 2
Posts: 15
Joined: Tue Dec 04, 2012 4:43 pm

Problems with list box with LBS_NODATA

Post by johnfound »

Hi.
I am writing application that uses List box with LBS_NODATA+LBS_OWNERDRAWFIXED. This list box contains tens of thousands of items. In Windows, the changes of the List box count (through LB_SETCOUNT) is instant. In Wine, before v1.5 it was slower, but acceptable (something around 1s).
But now I have very big problem. In Wine 1.5 this operation takes 10..15 seconds and this is unacceptably slow. I have this version installed on Linux Mint 13.
So, what is the problem and how it can be solved? I really need this program to work equally well in Linux and Windows.
Any help and suggestions are highly appreciated.
lahmbi5678
Level 7
Level 7
Posts: 823
Joined: Thu Aug 27, 2009 6:23 am

Re: Problems with list box with LBS_NODATA

Post by lahmbi5678 »

Hi, you probably should file a bug. Please attach a sample application to the bug report. If you are willing to compile wine yourself, you could run a regression test, see http://wiki.winehq.org/RegressionTesting . This would make it much easier for the wine devs to solve the bug.
johnfound
Level 2
Level 2
Posts: 15
Joined: Tue Dec 04, 2012 4:43 pm

Re: Problems with list box with LBS_NODATA

Post by johnfound »

lahmbi5678 wrote:Hi, you probably should file a bug. Please attach a sample application to the bug report. If you are willing to compile wine yourself, you could run a regression test, see http://wiki.winehq.org/RegressionTesting . This would make it much easier for the wine devs to solve the bug.
I am not sure about the regression testing, because I know very little C/C++. But I can try to create some simple application that to illustrate the problem... The problem is probably in the Listbox control, because a listbox with LBS_NODATA should not make any memory allocations or other processing, but only set the several internal variables, which should be instant operation.
johnfound
Level 2
Level 2
Posts: 15
Joined: Tue Dec 04, 2012 4:43 pm

Re: Problems with list box with LBS_NODATA

Post by johnfound »

I filed a bug: 32374 and attached simple application that measures the speed of LB_SETCOUNT :)
On Win XP it takes always 0ms to set the item count.

If someone is curious, I am attaching the same program in this post. Source code included.
Attachments
listbox_test.zip
List box benchmark.
(5.15 KiB) Downloaded 217 times
johnfound
Level 2
Level 2
Posts: 15
Joined: Tue Dec 04, 2012 4:43 pm

Re: Problems with list box with LBS_NODATA

Post by johnfound »

Anyway, I figured out what happens. The answer is simple. LBS_NODATA is not implemented at all in Wine. What is strange LB_SETCOUNT is implemented (but it has no meaning when used without LBS_NODATA and should return LB_ERR). So, when you send LB_SETCOUNT with some big number, the list box inserts these lines one by one, allocation memory for every of them and refreshing the control every time.
lahmbi5678
Level 7
Level 7
Posts: 823
Joined: Thu Aug 27, 2009 6:23 am

Re: Problems with list box with LBS_NODATA

Post by lahmbi5678 »

Please add your findings to the bug report, too.
Locked