summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-06-13 18:09:08 +0100
committerAndras Timar <andras.timar@collabora.com>2017-07-12 10:54:16 +0200
commita5a76729768a4282669695ff511c98e28e6004ab (patch)
tree25c901539aa1b0e11950aa4dc899b1b838cab5c4 /vcl
parent736c12e1b2e9dbf3437c11c67bf0fa951587bf69 (diff)
make opengl transitions under X flicker free on enter/leave
Change-Id: I109637dc6b3d23c0beca21f3cf0c7ba918ecb4f8 Reviewed-on: https://gerrit.libreoffice.org/38749 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 277395b6266c57a7709c3c47986f135f6789c8e7) Reviewed-on: https://gerrit.libreoffice.org/38753 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit b49779db18fa094f3b2f4166ee93c072d2f117a1)
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/salobj.hxx4
-rw-r--r--vcl/inc/unx/salobj.h2
-rw-r--r--vcl/source/window/syschild.cxx6
-rw-r--r--vcl/unx/generic/window/salobj.cxx39
-rw-r--r--vcl/unx/gtk/gtksalframe.cxx4
5 files changed, 53 insertions, 2 deletions
diff --git a/vcl/inc/salobj.hxx b/vcl/inc/salobj.hxx
index b1005fb87846..08d8a39ed661 100644
--- a/vcl/inc/salobj.hxx
+++ b/vcl/inc/salobj.hxx
@@ -21,7 +21,7 @@
#define INCLUDED_VCL_INC_SALOBJ_HXX
#include <vcl/dllapi.h>
-
+#include <com/sun/star/uno/Sequence.hxx>
#include "salwtype.hxx"
struct SystemEnvData;
@@ -48,6 +48,8 @@ public:
virtual void SetForwardKey( bool /* bEnable */ ) {}
+ virtual void SetLeaveEnterBackgrounds(const css::uno::Sequence<css::uno::Any>& /*rLeaveArgs*/, const css::uno::Sequence<css::uno::Any>& /*rEnterArgs*/) {}
+
virtual const SystemEnvData* GetSystemData() const = 0;
void SetCallback( void* pInst, SALOBJECTPROC pProc )
diff --git a/vcl/inc/unx/salobj.h b/vcl/inc/unx/salobj.h
index ffc738aa6987..b3170cb6c0af 100644
--- a/vcl/inc/unx/salobj.h
+++ b/vcl/inc/unx/salobj.h
@@ -76,6 +76,8 @@ public:
virtual void Show( bool bVisible ) override;
virtual void GrabFocus() override;
+ virtual void SetLeaveEnterBackgrounds(const css::uno::Sequence<css::uno::Any>& rLeaveArgs, const css::uno::Sequence<css::uno::Any>& rEnterArgs) override;
+
virtual const SystemEnvData* GetSystemData() const override;
};
diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx
index d6595038991b..bdeebf118dfc 100644
--- a/vcl/source/window/syschild.cxx
+++ b/vcl/source/window/syschild.cxx
@@ -162,6 +162,12 @@ void SystemChildWindow::EnableEraseBackground( bool bEnable )
mpWindowImpl->mpSysObj->EnableEraseBackground( bEnable );
}
+void SystemChildWindow::SetLeaveEnterBackgrounds(const css::uno::Sequence<css::uno::Any>& rLeaveArgs, const css::uno::Sequence<css::uno::Any>& rEnterArgs)
+{
+ if (mpWindowImpl->mpSysObj)
+ mpWindowImpl->mpSysObj->SetLeaveEnterBackgrounds(rLeaveArgs, rEnterArgs);
+}
+
void SystemChildWindow::SetForwardKey( bool bEnable )
{
if ( mpWindowImpl->mpSysObj )
diff --git a/vcl/unx/generic/window/salobj.cxx b/vcl/unx/generic/window/salobj.cxx
index 80c0726214c9..2f238b7f9d7e 100644
--- a/vcl/unx/generic/window/salobj.cxx
+++ b/vcl/unx/generic/window/salobj.cxx
@@ -249,6 +249,9 @@ X11SalObject::~X11SalObject()
rObjects.remove( this );
GetGenericData()->ErrorTrapPush();
+ const SystemEnvData* pEnv = mpParent->GetSystemData();
+ ::Window aObjectParent = (::Window)pEnv->aWindow;
+ XSetWindowBackgroundPixmap(static_cast<Display*>(maSystemChildData.pDisplay), aObjectParent, None);
if ( maSecondary )
XDestroyWindow( static_cast<Display*>(maSystemChildData.pDisplay), maSecondary );
if ( maPrimary )
@@ -474,4 +477,40 @@ bool X11SalObject::Dispatch( XEvent* pEvent )
return false;
}
+void X11SalObject::SetLeaveEnterBackgrounds(const css::uno::Sequence<css::uno::Any>& rLeaveArgs, const css::uno::Sequence<css::uno::Any>& rEnterArgs)
+{
+ SalDisplay* pSalDisp = vcl_sal::getSalDisplay(GetGenericData());
+ const SystemEnvData* pEnv = mpParent->GetSystemData();
+ Display* pDisp = pSalDisp->GetDisplay();
+ ::Window aObjectParent = (::Window)pEnv->aWindow;
+
+ bool bFreePixmap = false;
+ Pixmap aPixmap = None;
+ if (rEnterArgs.getLength() == 3)
+ {
+ rEnterArgs[0] >>= bFreePixmap;
+ long pixmapHandle = None;
+ rEnterArgs[1] >>= pixmapHandle;
+ aPixmap = pixmapHandle;
+ }
+
+ XSetWindowBackgroundPixmap(pDisp, aObjectParent, aPixmap);
+ if (bFreePixmap)
+ XFreePixmap(pDisp, aPixmap);
+
+ bFreePixmap = false;
+ aPixmap = None;
+ if (rLeaveArgs.getLength() == 3)
+ {
+ rLeaveArgs[0] >>= bFreePixmap;
+ long pixmapHandle = None;
+ rLeaveArgs[1] >>= pixmapHandle;
+ aPixmap = pixmapHandle;
+ }
+
+ XSetWindowBackgroundPixmap(pDisp, maSecondary, aPixmap);
+ if (bFreePixmap)
+ XFreePixmap(pDisp, aPixmap);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index 1e28c041ea47..b10994d7d4d0 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -2882,7 +2882,9 @@ gboolean GtkSalFrame::signalExpose( GtkWidget*, GdkEventExpose* pEvent, gpointer
{
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
- struct SalPaintEvent aEvent( pEvent->area.x, pEvent->area.y, pEvent->area.width, pEvent->area.height, OpenGLHelper::isVCLOpenGLEnabled() );
+ const bool bImmediate = OpenGLHelper::isVCLOpenGLEnabled() || pThis->m_bFullscreen;
+
+ struct SalPaintEvent aEvent( pEvent->area.x, pEvent->area.y, pEvent->area.width, pEvent->area.height, bImmediate );
pThis->CallCallback( SalEvent::Paint, &aEvent );