http://bugs.winehq.org/show_bug.cgi?id=18314
Summary: The Witcher: Launcher window invisible (taskbar enty appears) Product: Wine Version: unspecified Platform: Other OS/Version: other Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdiplus AssignedTo: wine-bugs@winehq.org ReportedBy: peppe@bsnet.se
Created an attachment (id=20857) --> (http://bugs.winehq.org/attachment.cgi?id=20857) Test showing similar behaviour
Observation: Trying to run the launcher for The Witcher (1.4) an entry appear in the taskbar but no window appear. This is using built-in gdiplus. Using native gdiplus the window appear.
Investigation: Reading trace logs it becomes evident that when using wine's gdiplus the launcher calls CreateRectRgn(0, 0, 0, 0) and then nothing more of that kind. Ending up with a zero size window. While when using the native gdiplus there's quite a number of CreateRectRgn and CombineRgn following.
This happens after calls to GdipBitmapLockBits and GdipBitmapUnlockBits and the window shown when using the native gdiplus is shaped after the background image, so I assume that the pixel data returned is used to build the shape of the window.
Based on this assumption and the function calls seen in the traces I have build a small test which shows the same behaviour (attached).
Looking at my test I've noticed that I get different pixel formats reported when using native and builtin GdipCreateBitmapFromFile/GdipGetImagePixelFormat using a RGBA png image. Also, when requesting PixelFormat32bppARGB the pixeldata returned by GdipBitmapLockBits have an all zero alpha channel (i.e. the whole image is fully transparent). In my test this is the actual problem.
It is noted in a comment in the code that GdipBitmapLockBits does not fully consider format.
http://bugs.winehq.org/show_bug.cgi?id=18314
Vincent Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |madewokherd@gmail.com
--- Comment #1 from Vincent Povirk madewokherd@gmail.com 2009-05-01 12:43:05 --- Builtin gdiplus image code is based on olepicture, which does not support alpha channels. That needs to be fixed before gdiplus can handle it correctly.
http://bugs.winehq.org/show_bug.cgi?id=18314
--- Comment #2 from Jan-Peter Nilsson peppe@bsnet.se 2009-05-03 03:28:06 --- Internally IPicture seems to be aware of at least one bit alpha (hbmMask). I realize this is not enough for all cases but it seems to be sufficient in this case.
A small modification to OLEPictureImpl_LoadPNG to get it to create the mask and then using it from GdipBitmapLockBits to populate the alpha channel was enough to get the launcher window to appear.
I can't see any proper way to get get hold of the mask from outside of the IPicture implementation though.
http://bugs.winehq.org/show_bug.cgi?id=18314
--- Comment #3 from Jan-Peter Nilsson peppe@bsnet.se 2009-05-04 00:20:23 --- Created an attachment (id=20898) --> (http://bugs.winehq.org/attachment.cgi?id=20898) A hack using hbmMask to populate the alpha channel
This is not a solution, just a hack verifying my assumption. I'm using hbmMask from IPicture to set the pixel format to ARGB in GdipLoadImageFromStream and to populate the alpha channel in GdipBitmapLockBits.
I'm using an offset into OLEPictureImpl to get hold of hbmMask, as it (as far as I can tell) is not otherwise available outside of the implementation. I'm not proposing this is something that should be done.
Using this the launcher window appear.
http://bugs.winehq.org/show_bug.cgi?id=18314
P Macko archimedes1@ymail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |archimedes1@ymail.com
--- Comment #4 from P Macko archimedes1@ymail.com 2009-05-08 19:07:28 --- I can confirm that this bug exists on ver. 1.0 of the game as well which I've tested with both Wine ver. 1.1.14 and 1.1.18. Neither launcher.exe nor register.exe will pop up windows with the built-in gdiplus. You just get a taskbar entry. They will however pop up windows if a native gdiplus is used instead.
http://bugs.winehq.org/show_bug.cgi?id=18314
--- Comment #5 from James MacCasland jmaccasland@pcndeinc.com 2009-05-14 22:18:23 --- Created an attachment (id=21107) --> (http://bugs.winehq.org/attachment.cgi?id=21107) debug from terminal window
http://bugs.winehq.org/show_bug.cgi?id=18314
Hallvar Helle hallvar_helle@damedoen.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #6 from Hallvar Helle hallvar_helle@damedoen.com 2009-05-31 08:51:20 --- *** This bug has been confirmed by popular vote. ***
http://bugs.winehq.org/show_bug.cgi?id=18314
--- Comment #7 from Vincent Povirk madewokherd@gmail.com 2009-11-11 17:06:52 --- It should be possible to get alpha data from gdiplus bitmaps now. Please retest.
http://bugs.winehq.org/show_bug.cgi?id=18314
--- Comment #8 from Xavier Vachon xvachon@gmail.com 2010-06-25 09:55:59 --- Created an attachment (id=29130) --> (http://bugs.winehq.org/attachment.cgi?id=29130) Result in current git
(In reply to comment #7)
It should be possible to get alpha data from gdiplus bitmaps now. Please retest.
This is what I get in current git. Looks fixed to me.
http://bugs.winehq.org/show_bug.cgi?id=18314
Vincent Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #9 from Vincent Povirk madewokherd@gmail.com 2010-06-25 09:58:20 --- Reported fixed.
http://bugs.winehq.org/show_bug.cgi?id=18314
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from Alexandre Julliard julliard@winehq.org 2010-06-25 12:41:01 --- Closing bugs fixed in 1.2-rc5.