diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2010-03-10 20:03:04 +0300 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2010-03-10 20:03:04 +0300 |
commit | 2b6bad6a239069500432ac269d49340ace5eb1f4 (patch) | |
tree | 292db30a0380aa74053f92fc64375a115ed759ba | |
parent | be5fe492ee9d7ee46e59619c897537ff367480fd (diff) |
Flash in browser workaround
-rw-r--r-- | overlay/d3d9.cpp | 5 | ||||
-rw-r--r-- | overlay/lib.h | 3 | ||||
-rw-r--r-- | src/mumble/Overlay.cpp | 3 |
3 files changed, 9 insertions, 2 deletions
diff --git a/overlay/d3d9.cpp b/overlay/d3d9.cpp index 3e9768206..85249b582 100644 --- a/overlay/d3d9.cpp +++ b/overlay/d3d9.cpp @@ -42,7 +42,7 @@ struct D3DTLVERTEX { }; static const DWORD D3DFVF_TLVERTEX = D3DFVF_XYZRHW | D3DFVF_TEX1; -class DevState : protected Pipe { +class DevState : public Pipe { public: IDirect3DDevice9 *dev; IDirect3DStateBlock9 *pSB; @@ -429,6 +429,9 @@ static ULONG __stdcall myRelease(IDirect3DDevice9 *idd) { ds->refCount--; } + if (ds->refCount <= 1) + ds->disconnect(); + if (ds->refCount >= 0) return ds->refCount + ds->initRefCount; diff --git a/overlay/lib.h b/overlay/lib.h index f06b32957..43427f04a 100644 --- a/overlay/lib.h +++ b/overlay/lib.h @@ -96,7 +96,6 @@ class Pipe { HANDLE hMemory; void release(); - void disconnect(); protected: unsigned int uiWidth, uiHeight; unsigned int uiLeft, uiTop, uiRight, uiBottom; @@ -111,6 +110,8 @@ class Pipe { virtual void newTexture(unsigned int w, unsigned int h) = 0; Pipe(); ~Pipe(); + public: + void disconnect(); }; extern void checkDXGIHook(bool preonly = false); diff --git a/src/mumble/Overlay.cpp b/src/mumble/Overlay.cpp index 01f5b4ff0..bb0c5fec4 100644 --- a/src/mumble/Overlay.cpp +++ b/src/mumble/Overlay.cpp @@ -2347,6 +2347,9 @@ void OverlayClient::render() { QRect dirty = dirtyf.toAlignedRect(); dirty = dirty.intersected(QRect(0,0,uiWidth, uiHeight)); + if ((dirty.width() <= 0) || (dirty.height() <= 0)) + return; + QRect target = dirty; target.moveTo(0,0); |