http://bugs.winehq.org/show_bug.cgi?id=24464
Summary: UpdateLayeredWindow() generates WM_SIZE when it should not, and other non-matching behavior Product: Wine Version: 1.1.44 Platform: All OS/Version: All Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 AssignedTo: wine-bugs@winehq.org ReportedBy: ivucica@gmail.com
Created an attachment (id=30866) --> (http://bugs.winehq.org/attachment.cgi?id=30866) test case
Below are pasted the notes from the attached source code, for easier reference. The most important bug is #4, erroneous generation of WM_SIZE when they should not be generated. I did not feel like creating several bug reports, feel free to split if necessary.
Attached is the test case demonstrating the issues. To compile test case using MinGW, use following makefile: CC=i386-mingw32msvc-gcc all: $(CC) -o updatelayeredwindow_demo.exe -lole32 -lcomdlg32 -luser32 -lwinmm main.c -lgdi32
Please compare behavior between XP and Wine. You can make the window reduce its size by left clicking. Then observe the log. You can notice that on XP, WM_SIZE is not generated. On Wine, it is continuously generated. Bugs #1-#3 can also be tested easily by modifying the source code as described and comparing output.
I presume the bug happens everywhere, although it was tested only on OS X.
At least one application development framework, Cocotron, depends on correct behavior for WM_SIZE. Cocotron reimplements OS X's Cocoa API to create source level compatibility. Wine is the easiest way to test the Cocotron executables, since Cocotron compiles on OS X to produce Windows binaries. Otherwise, one needs to have a machine (either real or virtual) that runs Windows in order to test software.
However, this bug blocks testing of any application that uses "sheets", since sheets are animated using UpdateLayeredWindow(). Sheets are captionless modal dialogs that appear on their owner window, and as their parent moves, they move as well. They are quite ubiquitous on Mac OS X and in Cocoa.
Description of Cocotron internals and cause for this bug: Animations use class instance's _size member, which is updated when WM_SIZE is sent. This member should not ordinarily be updated during execution of animation function, but it gets updated because WM_SIZE is sent.
// TESTED ON WINDOWS XP with wine-1.1.44
// bug #1: If we pass 0 as first argument to CreateWindowEx(), Windows ignore // UpdateLayeredWindow(). Wine does not. // bug #2: If we pass WS_EX_LAYERED as first argument to CreateWindowEx(), Windows does not // display the window except in taskbar. Wine displays it, and even dispatches // WM_LBUTTONDOWN. Function should also fail, with GetLastError() returning 0. // #2a: Additionally, same thing happens if we do not pass a DC as fifth argument to // UpdateLayeredWindow().
// bug #3: In WM_LBUTTONDOWN, there is the following call. // UpdateLayeredWindow(hWnd, GetDC(hWnd), &ptSrc, &sizeWnd, memDC, &origin, RGB(0xFF,0xFF,0xFF), &blend, ULW_OPAQUE); // if we pass NULL instead of memDC, Windows do not resize the window. Wine happily resizes it // Additionally function should fail.
*********************************************************************** ***********************************************************************
// MOST IMPORTANT: // bug #4: If UpdateLayeredWindow() resizes the window, Windows do not generate WM_SIZE. // Wine does generate WM_SIZE. // This causes a bug in every application displaying "sheets" that is // developed using Cocotron (http://cocotron.org/). "Sheets" in Mac OS X are // per-window modal popups attached to top of the window.
http://bugs.winehq.org/show_bug.cgi?id=24464
Ivan Vučica ivucica@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ivucica@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=24464
Wylda wylda@volny.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|ivucica@gmail.com |
--- Comment #1 from Wylda wylda@volny.cz 2010-09-19 06:56:41 CDT ---
Hi, thanks for the report, but please separate them. 1 problem = 1 bug report. Also no neet to put yourself to CC. http://wiki.winehq.org/Bugs
Also you will probably asked to attach a simple test case. Then use apropriate keywords (testcase, download, patch, source)
http://bugs.winehq.org/show_bug.cgi?id=24464
--- Comment #2 from Ivan Vučica ivucica@gmail.com 2010-09-19 07:10:25 CDT --- (In reply to comment #1)
Hi, thanks for the report, but please separate them. 1 problem = 1 bug report. Also no neet to put yourself to CC. http://wiki.winehq.org/Bugs
Also you will probably asked to attach a simple test case. Then use apropriate keywords (testcase, download, patch, source)
Test case has been submitted already, as you can see.
Separate them? I have spent about 3 or 4 hours figuring out the Win32 API and the bug, for developers' convenience. I also spent this time writing the test case. I really don't feel like spending more time and more of my traffic-capped (512mb/mo) and slow EDGE Internet connection via cellphone. And spend it on... separating bug reports? I'm not paid QA engineer.
If this is inconvenient, then feel free to understand this as a single bug report: WM_SIZE being generated and screwing up some Windows-targeted software.
http://bugs.winehq.org/show_bug.cgi?id=24464
Wylda wylda@volny.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, testcase CC| |wylda@volny.cz
--- Comment #3 from Wylda wylda@volny.cz 2010-09-19 07:17:20 CDT ---
Test case has been submitted already, as you can see.
Overlooked, my mistake.
separating bug reports? I'm not paid QA engineer.
And that's the reason, why i gave you good advice for free ;-)
If this is inconvenient, then feel free to understand this as a single bug report: WM_SIZE being generated and screwing up some Windows-targeted software.
OK, anyway i'm not a developer, just a bugzilla guy. Thanks again for your findings.
http://bugs.winehq.org/show_bug.cgi?id=24464
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Platform|All |Other OS/Version|All |other
http://bugs.winehq.org/show_bug.cgi?id=24464
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #30866|application/octet-stream |text/plain mime type| |
http://bugs.winehq.org/show_bug.cgi?id=24464
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #4 from Dmitry Timoshkov dmitry@codeweavers.com 2010-09-21 02:37:04 CDT --- The following patch should fix some of the problems: http://www.winehq.org/pipermail/wine-patches/2010-September/093508.html although not the WM_MOVE one.
http://bugs.winehq.org/show_bug.cgi?id=24464
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |9f29dcdc2e39368870873eee62e | |5c8da95096734 Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #5 from Alexandre Julliard julliard@winehq.org 2012-10-02 14:02:52 CDT --- Fixed by 9f29dcdc2e39368870873eee62e5c8da95096734.
http://bugs.winehq.org/show_bug.cgi?id=24464
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alexandre Julliard julliard@winehq.org 2012-10-12 13:34:36 CDT --- Closing bugs fixed in 1.5.15.