Module: wine
Branch: master
Commit: 499c26ce66ec6cbbb3569c69ca95c9dfac01d39f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=499c26ce66ec6cbbb3569c69c…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com>
Date: Mon Jan 15 17:03:11 2007 +0800
user32: Remove redundant visibility checks of a maximized MDI child, add an explanation why we do that.
---
dlls/user32/mdi.c | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/dlls/user32/mdi.c b/dlls/user32/mdi.c
index a2def9b..f8bb8f8 100644
--- a/dlls/user32/mdi.c
+++ b/dlls/user32/mdi.c
@@ -120,6 +120,14 @@ typedef struct
/* At some points, particularly when switching MDI children, active and
* maximized MDI children may be not the same window, so we need to track
* them separately.
+ * The only place where we switch to/from maximized state is DefMDIChildProc
+ * WM_SIZE/SIZE_MAXIMIZED handler. We get that notification only after the
+ * ShowWindow(SW_SHOWMAXIMIZED) request, therefore window is guaranteed to
+ * be visible at the time we get the notification, and it's safe to assume
+ * that hwndChildMaximized is always visible.
+ * If the app plays games with WS_VISIBLE, WS_MAXIMIZE or any other window
+ * states it must keep coherency with USER32 on its own. This is true for
+ * Windows as well.
*/
UINT nActiveChildren;
HWND hwndChildMaximized;
@@ -355,7 +363,7 @@ static LRESULT MDISetMenu( HWND hwnd, HM
HMENU oldFrameMenu = ci->hFrameMenu;
ci->hFrameMenu = hmenuFrame;
- if (ci->hwndChildMaximized && (GetWindowLongW(ci->hwndChildMaximized, GWL_STYLE) & WS_VISIBLE))
+ if (ci->hwndChildMaximized)
MDI_AugmentFrameMenu( hwndFrame, ci->hwndChildMaximized );
return (LRESULT)oldFrameMenu;
@@ -974,7 +982,7 @@ static void MDI_UpdateFrameText( HWND fr
if (ci->frameTitle)
{
- if (ci->hwndChildMaximized && (GetWindowLongW(ci->hwndChildMaximized, GWL_STYLE) & WS_VISIBLE))
+ if (ci->hwndChildMaximized)
{
/* combine frame title and child title if possible */
@@ -1220,8 +1228,7 @@ static LRESULT MDIClientWndProc_common(
return 0;
case WM_SIZE:
- if( IsWindow(ci->hwndActiveChild) && IsZoomed(ci->hwndActiveChild) &&
- (GetWindowLongW(ci->hwndActiveChild, GWL_STYLE) & WS_VISIBLE) )
+ if( ci->hwndChildMaximized )
{
RECT rect;
@@ -1230,9 +1237,9 @@ static LRESULT MDIClientWndProc_common(
rect.right = LOWORD(lParam);
rect.bottom = HIWORD(lParam);
- AdjustWindowRectEx(&rect, GetWindowLongA(ci->hwndActiveChild, GWL_STYLE),
- 0, GetWindowLongA(ci->hwndActiveChild, GWL_EXSTYLE) );
- MoveWindow(ci->hwndActiveChild, rect.left, rect.top,
+ AdjustWindowRectEx( &rect, GetWindowLongA(ci->hwndChildMaximized, GWL_STYLE),
+ 0, GetWindowLongA(ci->hwndChildMaximized, GWL_EXSTYLE) );
+ MoveWindow( ci->hwndChildMaximized, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top, 1);
}
else
@@ -1507,6 +1514,7 @@ LRESULT WINAPI DefMDIChildProcW( HWND hw
break;
case WM_SIZE:
+ /* This is the only place where we switch to/from maximized state */
/* do not change */
TRACE("current active %p, maximized %p\n", ci->hwndActiveChild, ci->hwndChildMaximized);
Module: wine
Branch: master
Commit: 8c8d1e4f89fb4b0d9a14530bfd01c285b4af62bc
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8c8d1e4f89fb4b0d9a14530bf…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Fri Jan 12 19:02:36 2007 +0100
wined3d: Do not force dynamic usage on transformed buffers.
---
dlls/wined3d/device.c | 11 -----------
1 files changed, 0 insertions(+), 11 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 1845446..2097b13 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -450,17 +450,6 @@ static void CreateVBO(IWineD3DVertexBuff
goto error;
}
- /* Transformed vertices are horribly inflexible. If the app specifies an
- * vertex buffer with transformed vertices in default pool without DYNAMIC
- * usage assume DYNAMIC usage and print a warning. The app will have to update
- * the vertices regularily for them to be useful
- */
- if(((object->fvf & WINED3DFVF_POSITION_MASK) == WINED3DFVF_XYZRHW) &&
- !(vboUsage & WINED3DUSAGE_DYNAMIC)) {
- WARN("Application creates a vertex buffer holding transformed vertices which doesn't specify dynamic usage\n");
- vboUsage |= WINED3DUSAGE_DYNAMIC;
- }
-
/* Don't use static, because dx apps tend to update the buffer
* quite often even if they specify 0 usage
*/
Module: wine
Branch: master
Commit: e328e24daa63269117f69badaa3887d4d6358089
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e328e24daa63269117f69bada…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Fri Jan 12 19:01:59 2007 +0100
wined3d: Better tracking of vertex buffer assignments.
---
dlls/wined3d/device.c | 8 ++------
dlls/wined3d/vertexbuffer.c | 2 +-
dlls/wined3d/wined3d_private.h | 7 +++----
3 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 8a02e31..1845446 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2243,14 +2243,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl
so for now, just count internally */
if (pStreamData != NULL) {
IWineD3DVertexBufferImpl *vbImpl = (IWineD3DVertexBufferImpl *) pStreamData;
- if( (vbImpl->Flags & VBFLAG_STREAM) && vbImpl->stream != StreamNumber) {
- WARN("Assigning a Vertex Buffer to stream %d which is already assigned to stream %d\n", StreamNumber, vbImpl->stream);
- }
- vbImpl->stream = StreamNumber;
- vbImpl->Flags |= VBFLAG_STREAM;
+ InterlockedIncrement(&vbImpl->bindCount);
}
if (oldSrc != NULL) {
- ((IWineD3DVertexBufferImpl *) oldSrc)->Flags &= ~VBFLAG_STREAM;
+ InterlockedDecrement(&((IWineD3DVertexBufferImpl *) oldSrc)->bindCount);
}
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_STREAMSRC);
diff --git a/dlls/wined3d/vertexbuffer.c b/dlls/wined3d/vertexbuffer.c
index c7a8a97..6ef7533 100644
--- a/dlls/wined3d/vertexbuffer.c
+++ b/dlls/wined3d/vertexbuffer.c
@@ -266,7 +266,7 @@ static void WINAPI IWineD3DVertexBuf
}
/* Reading the declaration makes only sense if the stateblock is finalized and the buffer bound to a stream */
- if(This->resource.wineD3DDevice->isInDraw && This->Flags & VBFLAG_STREAM) {
+ if(This->resource.wineD3DDevice->isInDraw && This->bindCount > 0) {
declChanged = IWineD3DVertexBufferImpl_FindDecl(This);
} else if(This->Flags & VBFLAG_HASDESC) {
/* Reuse the declaration stored in the buffer. It will most likely not change, and if it does
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 6d99657..3611f87 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -751,7 +751,7 @@ typedef struct IWineD3DVertexBufferImpl
/* Vertex buffer object support */
GLuint vbo;
BYTE Flags;
- UINT stream;
+ LONG bindCount;
UINT dirtystart, dirtyend;
LONG lockcount;
@@ -766,9 +766,8 @@ extern const IWineD3DVertexBufferVtbl IW
#define VBFLAG_LOAD 0x01 /* Data is written from allocatedMemory to the VBO */
#define VBFLAG_OPTIMIZED 0x02 /* Optimize has been called for the VB */
#define VBFLAG_DIRTY 0x04 /* Buffer data has been modified */
-#define VBFLAG_STREAM 0x08 /* The vertex buffer is in a stream */
-#define VBFLAG_HASDESC 0x10 /* A vertex description has been found */
-#define VBFLAG_VBOCREATEFAIL 0x20 /* An attempt to create a vbo has failed */
+#define VBFLAG_HASDESC 0x08 /* A vertex description has been found */
+#define VBFLAG_VBOCREATEFAIL 0x10 /* An attempt to create a vbo has failed */
/*****************************************************************************
* IWineD3DIndexBuffer implementation structure (extends IWineD3DResourceImpl)