Re: uninformed musings on ddraw + bugs 2082 and 1347 + dib engine

2008-05-29 Thread Vincent Povirk
My information on Windows Vista comes from some things I happened to
read on Wikipedia for an unrelated reason:
http://en.wikipedia.org/wiki/Desktop_window_manager#Redirection

That page cites this blog (creepily similar to what I described, using
one clientside buffer per X window, except when gdi+ddraw or virtual
desktops are involved):
http://blogs.msdn.com/greg_schechter/archive/2006/05/02/588934.aspx

If an application wants to draw to the screen where there is no Wine
window (either the screen outside their window or with no window at
all), I think we will have to accept that this is impossible as long
as a compositing window manager is running. Such an application would
have to be run in a virtual desktop.

I do not have a copy of Windows Vista around to test any of this.

I think I've seen the ddraw sample you refer to (with gdi and ddraw
windows), but I seem to have misplaced it. Last I checked, the desktop
hack breaks it, and I think it uses SetHWnd for a clipper on its
primary surface.

-- 
Vincent Povirk




Re: uninformed musings on ddraw + bugs 2082 and 1347 + dib engine

2008-05-29 Thread Stefan Dösinger
Am Donnerstag, 29. Mai 2008 13:39:57 schrieb Vincent Povirk:
 That page cites this blog (creepily similar to what I described, using
 one clientside buffer per X window, except when gdi+ddraw or virtual
 desktops are involved):
 http://blogs.msdn.com/greg_schechter/archive/2006/05/02/588934.aspx
Yeah, but it mentiones that it does the double buffering for GDI windows, not 
directx / directdraw ones. It also mentiones that drawing to the screen 
is Bd!. Also I do not see how shadowing the window would help here; If 
we don't want to overwrite any non-wine part of the screen, setting up the 
clipping when drawing ddraw to the screen is ok.

I've done some testing with the font.exe ddraw sample from the dx sdk. This is 
an illustration what it looks like:
http://84.112.174.163/~stefan/font-wine.png

There are no special surprises when the window is not overlapped by any other 
window. The app draws to a HWND, not NULL. Surprises occur when another 
Window overlaps it. This here is from Windows XP:
http://stud4.tuwien.ac.at/~e0526822/ddrawtoscreen.bmp

As you can see, the ddraw updates overwrite the Explorer window. I have no 
idea why the font color is different though; It seems unimportant.

This is what happens on Vista with Aero off:
http://84.112.174.163/~stefan/font-vista.png

Now with aero on:
http://84.112.174.163/~stefan/font-aero.png
The aero-disabling screen flicker wasn't cought in the screenshot. However, 
you see the (german) aero-disable message. In the screenshot it has a nice 
fade effect, but on the screen it was flickering badly and not readable. A 
lot of other GUI elements were flickering too.

This shows at least how vista handles aero + ddraw apps - not at all. However, 
with the aero disabling it can keep the draw-to-screen semantics, and with 
fullscreen apps disabling aero doesn't hurt anyway. I roughly remember some 
Vista-disables-aero-with-quicktime-antitrust! whining about 1.5 years ago 
too.

 I think I've seen the ddraw sample you refer to (with gdi and ddraw
 windows), but I seem to have misplaced it. Last I checked, the desktop
 hack breaks it, and I think it uses SetHWnd for a clipper on its
 primary surface.
What you have to keep in mind is that ddraw checks the position of the dest 
window and adjusts the drawing coordinates accordingly. So if you just 
replace the HWND with NULL you get a wrong placement. You'll have to adjust 
x11_copy_to_screen in dlls/wined3d/surface.c as well.

We can work around the black screen issue with a fast way to read back the 
screen on frontbuffer locks. This is called glReadPixels + 
GL_ARB_pixel_buffer_object. However, for this we need a way to get the NULL 
hwnd semantics with opengl, which seems impossible so far.

My recommendation is this:
- Talk to the beryl devs to get a way to disable compiz. We'll need this for 
fullscreen mode anyway, but we should not rely on it for windowed mode, since 
we can't disable compositing on MacOS. So we have to work around this problem

- Continue to draw to the dest window with the gdi ddraw renderer. This keeps 
us Compiz and MacOS compatible, and I think we didn't have a problem that way 
so far

- Ignore the quicktime-black-screen bug. Make Dan happy by switching to 
winver=Vista by default after 1.0

- make x11_copy_to_screen draw to the NULL window to fix Diablo 1, Worms and 
others. First we have to make sure this doesn't break with compiz or on MacOS 
though.




Re: uninformed musings on ddraw + bugs 2082 and 1347 + dib engine

2008-05-29 Thread Remco
On Thu, May 29, 2008 at 5:21 PM, Stefan Dösinger [EMAIL PROTECTED] wrote:
 My recommendation is this:
 - Talk to the beryl devs to get a way to disable compiz. We'll need this for
 fullscreen mode anyway, but we should not rely on it for windowed mode, since
 we can't disable compositing on MacOS. So we have to work around this problem

Doesn't Compiz already offer the Unredirect Fullscreen Windows option?

Remco



Re: uninformed musings on ddraw + bugs 2082 and 1347 + dib engine

2008-05-29 Thread Travis Watkins
On Thu, May 29, 2008 at 10:21 AM, Stefan Dösinger
[EMAIL PROTECTED] wrote:
 - Talk to the beryl devs to get a way to disable compiz. We'll need this for
 fullscreen mode anyway, but we should not rely on it for windowed mode, since
 we can't disable compositing on MacOS. So we have to work around this problem

We already allow this with the Unredirect fullscreen windows option.
If the window is detected as fullscreen compiz basically disables
itself and the window is drawn like it would be without compiz
running.

-- 
Travis Watkins
http://www.realistanew.com



Re: uninformed musings on ddraw + bugs 2082 and 1347 + dib engine

2008-05-28 Thread Stefan Dösinger
There are a few more things to keep in mind:

- The DIB engine would not be used to draw to windows or the NULL hwnd. It 
will be used to draw to device independent bitmaps only.

- Some applications may *want* to draw to the screen outside their window. I 
think the dxdiag.exe app does so.

- Some apps may use ddraw without a window at all

Can you confirm that the apps that show the black screen problem are broken in 
vista with aero on? This would be a strong indicator that the apps are doing 
something wrong(Keep in mind that QuickTime changes its behavior with 
winver=vista). All in all I think this is a hack that's not going to work 
well, although I did not think about it in detail yet.

First of all, I think we need to do a bit more testing. E.g. test what happens 
if the app is in fullscreen-exclusive mode and tries to open a regular GDI 
window. Is it visible? There's also a dx7 sdk sample which illustrates how a 
GDI window with ddraw works. It works on wine, but I never looked into it in 
detail.