http://bugs.winehq.org/show_bug.cgi?id=9491
Summary: CListCtrl:GetSubItemRect doesn't work for the label row Product: Wine Version: 0.9.44. Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: wine-comctl32 AssignedTo: wine-bugs@winehq.org ReportedBy: bgp@cs.elte.hu
When I call CListCtrl::GetSubItemRect with m_item = -1, it supposed to handle the label row. It works in windows. Under wine, it doesn't work, ref will contain garbage.
res = CListCtrl::GetSubItemRect(m_item,m_subitem,LVIR_BOUNDS,ref);
http://bugs.winehq.org/show_bug.cgi?id=9491
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dank@kegel.com
--- Comment #1 from Dan Kegel dank@kegel.com 2007-08-27 14:02:01 --- Can you give us an example app with source?
http://bugs.winehq.org/show_bug.cgi?id=9491
--- Comment #2 from Avenger bgp@cs.elte.hu 2007-08-27 16:32:17 --- Created an attachment (id=7841) --> (http://bugs.winehq.org/attachment.cgi?id=7841) testcase for the comctl bugs reported by me
Here is a win32 exe and its source code too. It demonstrates this bug (and 2 others I reported).
http://bugs.winehq.org/show_bug.cgi?id=9491
Vijay Kamuju infyquest@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |infyquest@gmail.com
--- Comment #3 from Vijay Kamuju infyquest@gmail.com 2007-08-29 12:57:11 --- I will try to find the problem and fix it. Currently my laptop's video card has crashed on me Also my external HDD having the linux also crashed on me.(new replacement HDD is having issues). So you have to wait. :(
http://bugs.winehq.org/show_bug.cgi?id=9491
Lei Zhang thestig@google.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords| |download, source
--- Comment #4 from Lei Zhang thestig@google.com 2008-03-19 20:08:29 --- confirming.
http://bugs.winehq.org/show_bug.cgi?id=9491
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |testcase
http://bugs.winehq.org/show_bug.cgi?id=9491
--- Comment #5 from Austin English austinenglish@gmail.com 2008-12-05 12:57:04 --- Windows, clicking on 'Click Here' gives: Result: 1 Rectangle: 50 3 200 17
Clicking Add row gives alternating blue & green rows.
Wine, clicking on 'Click Here' gives: Result: 0 Rectangle: 3331324 4255164 78 1001
Clicking Add row only gives blue rows, unless you click it really fast a few times, then you'll occasionally get a green.
http://bugs.winehq.org/show_bug.cgi?id=9491
--- Comment #6 from Nikolay Sivov bunglehead@gmail.com 2009-04-22 12:56:39 --- Initial issue on retrieving header rectangles is partially fixed now:
http://source.winehq.org/git/wine.git/?a=commit;h=457c983ee397ed7f836d4dc389...
I've got a small question on it to reporter (Avenger):
could you produce another version of your test app which returns '0' for 'top' field? That's the only place when wine differs now. Some test applications shows 0 for me, when your and test cases don't.
(In reply to comment #5)
Clicking Add row only gives blue rows, unless you click it really fast a few times, then you'll occasionally get a green.
After an explicit redrawing you'll see correct fills. The problem is in notification probably. Another bug is obvious too: only first column (main item) filled in wine, while full row's filled on native. I'll try to find out a cause after main part solved.
http://bugs.winehq.org/show_bug.cgi?id=9491
--- Comment #7 from Nikolay Sivov bunglehead@gmail.com 2010-05-29 15:59:23 --- This Y padding for 3 pixels is added at Listview level on native, header reports it to be 0. I'm not sure what it supposed to mean and why it does this, but let's keep this report open for a while.
http://bugs.winehq.org/show_bug.cgi?id=9491
--- Comment #8 from Vijay Kamuju infyquest@gmail.com 2011-09-13 17:36:18 CDT --- can you please check it up with latest wine
http://bugs.winehq.org/show_bug.cgi?id=9491
--- Comment #9 from Nikolay Sivov bunglehead@gmail.com 2012-05-23 00:14:19 CDT --- Yes, comment 7 is still valid for wine-1.5.4-266-ge555139.
http://bugs.winehq.org/show_bug.cgi?id=9491
Daniel Jelinski djelinski1@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |djelinski1@gmail.com
--- Comment #10 from Daniel Jelinski djelinski1@gmail.com 2012-12-30 13:28:01 CST --- There are several issues here: - native GetSubItemRect does not even check if an item exists, it just returns top and bottom coordinates of where an item would be if it existed. Item -1 is not for header, it's for an item above item 0. You may easily check that by adding so many items that scrollbar appears, then scrolling down, then clicking on the header. In fact, any item number (negative or positive, related to existing item or not) works just as well. - on a related note, for LVIR_ICON the returned top, bottom and left bounds are the same as for LVIR_BOUNDS, right is equal to left + ImageList icon width. I'm not sure yet if LVS_EX_SUBITEMIMAGES plays any role here (tested with delphi, which doesn't expose that setting) - Second issue, which appears only when the first one is fixed, is that Wine's row height is one pixel smaller than native's - Issue with all rows blue is due to Wine's redraw logic - on insert it scrolls items instead of redrawing them. Changing ScrollWindowEx to InvalidateRect in LISTVIEW_ScrollOnInsert results in correct colors. - Issue with only first column painted blue is because native comctl initializes NMLVCUSTOMDRAW structure only once per item, and then reuses the same structure for each subitem, while Wine creates and initializes a new structure for each subitem.
http://bugs.winehq.org/show_bug.cgi?id=9491
--- Comment #11 from Nikolay Sivov bunglehead@gmail.com 2013-01-02 11:59:12 CST --- That's interesting info, thanks. I have some time to work on first issue regarding negative indices for subitem rectangles, you are not working on this currently, right?
http://bugs.winehq.org/show_bug.cgi?id=9491
--- Comment #12 from Daniel Jelinski djelinski1@gmail.com 2013-01-02 14:13:32 CST --- Created attachment 43062 --> http://bugs.winehq.org/attachment.cgi?id=43062 hack for LVM_GETSUBITEMRECT
I have working hacks for all of these issues (except incorrect item height), but lack time to turn them into real patches. I'd be happy if you could finish it up. I attached my hack for the issue here. The correct solution should turn the special case for headers into the default behavior of LISTVIEW_GetItemMetrics, and also fix LVIR_ICON and LVIR_LABEL handling.
http://bugs.winehq.org/show_bug.cgi?id=9491
--- Comment #13 from Nikolay Sivov bunglehead@gmail.com 2013-01-04 08:47:57 CST --- LVM_GETSUBITEMRECT should work better now after commit 67c57b216c734a7133088bb097f436bc0e0ca743. Owner draw handling is broken, that's true.
http://bugs.winehq.org/show_bug.cgi?id=9491
--- Comment #14 from Daniel Jelinski djelinski1@gmail.com --- After fa3e750e2cfc5fe763c2891f5fa47fec2ded43b0 the background for all items is white, colors returned from NM_CUSTOMDRAW are ignored. I just sent a patch for that (http://source.winehq.org/patches/data/105556). If that one goes in, the attached program will work just like on Windows.
https://bugs.winehq.org/show_bug.cgi?id=9491
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man@post.com
--- Comment #15 from super_man@post.com --- Patch didnt go in, it applies too cleanly.
patching file dlls/comctl32/listview.c Hunk #1 succeeded at 4785 (offset 10 lines).
wine 1.7.51(git).
https://bugs.winehq.org/show_bug.cgi?id=9491
--- Comment #16 from super_man@post.com --- the patch is said to fix bug 38941
https://bugs.winehq.org/show_bug.cgi?id=9491
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |67c57b216c734a7133088bb097f | |436bc0e0ca743 Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #17 from Nikolay Sivov bunglehead@gmail.com --- Original problem is fixed, I opened bug 39721 for next problem.
https://bugs.winehq.org/show_bug.cgi?id=9491
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #18 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.8-rc3.