http://bugs.winehq.org/show_bug.cgi?id=2082
--- Comment #138 from Ken Thomases <ken(a)codeweavers.com> ---
(In reply to comment #136)
> - The main thing I'm wondering about is if it wouldn't make more sense to
> pass a window to wglCreateFullscreenDCWINE(). Some of the considerations
> there are what should happen when the device window is e.g. destroyed or
> minimized.
It seems like knowing how to respond to such events should be the
responsibility of ddraw/d3d. The driver can provide the tools necessary for
those to implement the proper behavior. If we know what those are, we can add
them to the extension.
> - If we do want to pass a device name to wglCreateFullscreenDCWINE(), it
> should probably take a WCHAR[], and you can get at that from the context as
> "context->swapchain->device->adapter->DeviceName".
I would have used a WCHAR string but make_opengl doesn't currently know about
WCHARs. It could be taught. (Actually, I'd probably use "LPCWSTR" because
it's easier to teach make_opengl how to handle that than "const WCHAR*".)
I didn't know about getting the device name. Thanks for that.
> - wglDeleteFullscreenDCWINE() seems to just be a wrapper around
> DeleteDC(). If possible I think it would be preferable to be able to just
> call ReleaseDC() on the DC returned by wglCreateFullscreenDCWINE(), and then
> just use wined3d_release_dc().
Well, DeleteDC() and ReleaseDC() are for different purposes. ReleaseDC() is
from user32 and, conceptually, user32 doesn't know anything about the DC
provided by the extension and so we shouldn't ask it to release any DCs we
didn't get from it (even if ReleaseDC() were a simple wrapper around
DeleteDC(), which it's not).
Beyond that, wined3d_release_dc() checks if WindowFromDC() matches the
passed-in window and does nothing if not. I'm not aware of any way for the WGL
extension to create a DC such that WindowFromDC() returns a window, except by
using GetDC() and that defeats the point.
Finally, although the implementation of the extension in the Mac driver is just
a thin wrapper around DeleteDC(), I wanted to provide for the possibility that
it might not be for some other implementation. That said, the driver does
already have a pDeleteDC entry in its GDI function table, so it could put
custom cleanup there.
> - If we can just use wined3d_release_dc(), context->hdc_fullscreen can
> just go away, but otherwise it should probably be part of the other context
> bitfields like current/destroyed/valid.
Indeed. I just failed to see that group of bitfields.
> - When there are multiple threads drawing, wglCreateFullscreenDCWINE() is
> going to be called multiple times for the same window / display. I didn't
> really review the winemac.drv changes, but will it do the right thing in
> that case?
Good question.
The implementation in the patch creates a single Cocoa window for all
full-screen DCs. So the rendering from all contexts would go to the same
drawable. Currently, there's also a single pixel format tracked, although it
always allows the pixel format to be changed even if it was already set.
That's almost certainly wrong. I was planning to change that to track the
pixel format per DC in which case I'd probably enforce the usual rules about
changing it. I'm not sure that's right, either. Does it make sense for
multiple callers to create separate DCs with separate pixel formats but sharing
a drawable?
> wglGetFullscreenDCWINE() might be a more appropriate name for how
> we're using this.
The implication being that there should be one full-screen DC and all callers
would share it? Maybe that's OK. I'm not sure. It has the issue with the
pixel format – over its lifetime, can a shared DC have different pixel formats
at different times? (Leaving aside the question of whether different callers
would want to set different pixel formats simultaneously.)
Here's another approach to that same question. What if the
WGL_WINE_fullscreen_dc extension didn't add any new functions? What if it
simply indicated that doing OpenGL on the screen DC returned by GetDC(0) was
allowed and full-featured? Then, the change to wined3d would be to simply use
GetDC(0) for a full-screen swapchain. Releasing the DC could go through
ReleaseDC() (and maybe wined3d_release_dc() with some tweaking).
The implementation in the driver would detect the screen DC using
WindowFromDC(hdc) == GetDesktopWindow() much like what I did in attachment
46977 (which isn't that different from the newer patch). In other words, the
driver-side behavior would be just the same, just with a different means of
detecting when a DC was full-screen.
Would that work? What about the issue with the pixel format? Are there other
issues?
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=2082
--- Comment #137 from Stefan Dösinger <stefan(a)codeweavers.com> ---
(In reply to comment #136)
> - The main thing I'm wondering about is if it wouldn't make more sense to
> pass a window to wglCreateFullscreenDCWINE(). Some of the considerations
> there are what should happen when the device window is e.g. destroyed or
> minimized.
Is there a device window in those ddraw cases? My impression is that
SetCooperativeLevel(DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE,
hwnd_that_will_never_be_visible) sets the focus window, not the device window.
It would be interesting what ddraw does when an application calls
SetCooperativeLevel(DDSCL_SETDEVICEWINDOW, hwnd_that_will_never_be_visible).
Similarly, what do d3d8/9 do when they are passed a window like the one Worms
Armageddon uses?
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=2082
--- Comment #136 from Henri Verbeet <hverbeet(a)gmail.com> ---
(In reply to comment #135)
> Created attachment 47154 [details]
> Implement WGL extension to get fullscreen DC, use it in WineD3D
>
I think that mostly works for me, from a wined3d point of view.
- The main thing I'm wondering about is if it wouldn't make more sense to
pass a window to wglCreateFullscreenDCWINE(). Some of the considerations there
are what should happen when the device window is e.g. destroyed or minimized.
- If we do want to pass a device name to wglCreateFullscreenDCWINE(), it
should probably take a WCHAR[], and you can get at that from the context as
"context->swapchain->device->adapter->DeviceName".
- wglDeleteFullscreenDCWINE() seems to just be a wrapper around DeleteDC().
If possible I think it would be preferable to be able to just call ReleaseDC()
on the DC returned by wglCreateFullscreenDCWINE(), and then just use
wined3d_release_dc().
- If we can just use wined3d_release_dc(), context->hdc_fullscreen can just
go away, but otherwise it should probably be part of the other context
bitfields like current/destroyed/valid.
- When there are multiple threads drawing, wglCreateFullscreenDCWINE() is
going to be called multiple times for the same window / display. I didn't
really review the winemac.drv changes, but will it do the right thing in that
case? wglGetFullscreenDCWINE() might be a more appropriate name for how we're
using this.
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=2082
Ken Thomases <ken(a)codeweavers.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #46977|0 |1
is obsolete| |
--- Comment #135 from Ken Thomases <ken(a)codeweavers.com> ---
Created attachment 47154
--> http://bugs.winehq.org/attachment.cgi?id=47154
Implement WGL extension to get fullscreen DC, use it in WineD3D
(In reply to comment #132)
I said (to Henri):
> With respect to a WGL extension, were you thinking of something like an
> alternative to wglMakeCurrent() such as wglMakeCurrentFullScreenWINE()?
In looking at the code, I decided it makes more sense for the extension to
provide a full-screen DC which can then be used pretty much as normal. The
attached patch adds a Wine WGL extension named WGL_WINE_fullscreen_dc. It
provides two functions: wglCreateFullscreenDCWINE() and
wglDeleteFullscreenDCWINE().
The patch makes WineD3D aware of the extension and makes it use it instead of
GetDC()/wined3d_release_dc() if the swapchain is not windowed.
Then the extension is implemented in the Mac driver.
Taken together, this gets Worms Armageddon to show its rendering without the
use of any of its tweaks. Since the extension hasn't been implemented for the
X11 driver it doesn't help there but, unlike my previous patch, it shouldn't
break X11 either. It should work just like it has. If the extension is
implemented for X11, then it should start working, too.
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=8320
Alexandre Julliard <julliard(a)winehq.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |1.6.x
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=2082
arthur.huillet(a)free.fr changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|arthur.huillet(a)free.fr |
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=2082
--- Comment #134 from Henri Verbeet <hverbeet(a)gmail.com> ---
(In reply to comment #133)
> Created attachment 47148 [details]
> Test z-order in ddraw tests
>
> To my surprise, SetForegroundWindow() has nothing to do with z-order, at
> all. It just affects foreground/active statuses which are related to focus.
>
> This patch modifies the ddraw tests to check z-order. In all of the places
> that used to call SetForegroundWindow(), I now also call SetWindowPos(…,
> HWND_TOP, …). In all of the places that checked the window returned from
> GetForegroundWindow(), I now also check the window order. I also check the
> z-order immediately after attempting to set it to verify that it's working.
>
We don't want new tests to go anywhere that isn't ddraw[1247].c. (And the
existing ones should get cleaned up and moved over to there eventually as
well.)
> The tests marked "todo_wine" in testcooperativelevels_normal() are due to
> ddraw/wined3d setting the window topmost for fullscreen and, in some cases,
> not restoring it.
>
Right, setting WS_EX_TOPMOST is correct for d3d8 and d3d9, it isn't for ddraw.
(See also the various versions of test_window_style().)
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=2082
--- Comment #132 from Ken Thomases <ken(a)codeweavers.com> ---
(In reply to comment #131)
> We also have tests that show that switching to fullscreen does have an effect
> on e.g. window dimensions, z-order and focus.
I found tests for the foreground window in dlls/ddraw/tests/ddrawmodes.c,
testcooperativelevels_normal() and testcooperativelevels_exclusive(). I didn't
find other tests related to z-order. Please let me know if I missed them.
As we've seen with this bug, a window may be the foreground window without
being front-most, in particular if it owns other windows. Also if it's
non-topmost and there are topmost windows.
I'll try to extend the tests to test some possibilities with respect to actual
z-order viz-a-viz owned, topmost, and other windows.
With respect to a WGL extension, were you thinking of something like an
alternative to wglMakeCurrent() such as wglMakeCurrentFullScreenWINE()?
--- Comment #133 from Ken Thomases <ken(a)codeweavers.com> ---
Created attachment 47148
--> http://bugs.winehq.org/attachment.cgi?id=47148
Test z-order in ddraw tests
To my surprise, SetForegroundWindow() has nothing to do with z-order, at all.
It just affects foreground/active statuses which are related to focus.
This patch modifies the ddraw tests to check z-order. In all of the places
that used to call SetForegroundWindow(), I now also call SetWindowPos(…,
HWND_TOP, …). In all of the places that checked the window returned from
GetForegroundWindow(), I now also check the window order. I also check the
z-order immediately after attempting to set it to verify that it's working.
The tests marked "todo_wine" in testcooperativelevels_normal() are due to
ddraw/wined3d setting the window topmost for fullscreen and, in some cases, not
restoring it.
For testcooperativelevels_exclusive(), I make sure neither window is topmost
before proceeding. I also create two other windows, one topmost and one owned
by the main window. I test that both remain in front of the main window even
when it's fullscreen. Wine keeps the owned one in front (which is at the root
of this bug) but, as expected, promotes the main window to topmost, bringing it
in front of the other topmost window, when it shouldn't.
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9095
--- Comment #7 from Bruno Jesus <00cpxxx(a)gmail.com> ---
Still in wine 1.7.10.
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9127
hibi.sasahara(a)gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hibi.sasahara(a)gmail.com
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.