summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-05-23 21:37:25 +0200
committerJan Holesovsky <kendy@collabora.com>2015-05-24 02:14:40 +0200
commit2d40468efc1a90969d4ed34f699a8f48277cb8b3 (patch)
tree147f56fe5ac5cb0d32ab2aecf0f88c2bb4d07d11 /vcl
parent1926cfb9386269b81b6ca62bdc64591f2c403d03 (diff)
rendercontext: Make the Gtk+ native widgets work with double-buffering.
Change-Id: Ic7101ab7cbaa7fd5f6b073a73ef0c0088b1af4c6
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/outdev/nativecontrols.cxx4
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx11
2 files changed, 8 insertions, 7 deletions
diff --git a/vcl/source/outdev/nativecontrols.cxx b/vcl/source/outdev/nativecontrols.cxx
index 6fc43f63870e..6e9279c8c75c 100644
--- a/vcl/source/outdev/nativecontrols.cxx
+++ b/vcl/source/outdev/nativecontrols.cxx
@@ -18,6 +18,7 @@
*/
#include <vcl/outdev.hxx>
+#include <vcl/virdev.hxx>
#include <vcl/window.hxx>
#include <vcl/salnativewidgets.hxx>
@@ -302,6 +303,9 @@ bool OutputDevice::DrawNativeControl( ControlType nType,
if (aTestRegion == vcl::Region(rControlRegion))
nState |= ControlState::CACHING_ALLOWED; // control is not clipped, caching allowed
+ if (dynamic_cast<VirtualDevice*>(this))
+ nState |= ControlState::DOUBLEBUFFERING;
+
bool bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );
return bRet;
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index b4f1ba0ba346..6eb604300276 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -860,12 +860,9 @@ bool GtkSalGraphics::hitTestNativeControl( ControlType nType,
* aValue: An optional value (tristate/numerical/string)
* rCaption: A caption or title string (like button text etc)
*/
-bool GtkSalGraphics::drawNativeControl( ControlType nType,
- ControlPart nPart,
- const Rectangle& rControlRegion,
- ControlState nState,
- const ImplControlValue& aValue,
- const OUString& rCaption )
+bool GtkSalGraphics::drawNativeControl(ControlType nType, ControlPart nPart,
+ const Rectangle& rControlRegion, ControlState nState,
+ const ImplControlValue& aValue, const OUString& rCaption)
{
// get a GC with current clipping region set
GetFontGC();
@@ -891,7 +888,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType,
std::unique_ptr<GdkX11Pixmap> xPixmap;
std::unique_ptr<GdkX11Pixmap> xMask;
Rectangle aPixmapRect;
- if( ( bNeedPixmapPaint )
+ if ((bNeedPixmapPaint || (nState & ControlState::DOUBLEBUFFERING))
&& nType != CTRL_SCROLLBAR
&& nType != CTRL_SPINBOX
&& nType != CTRL_TAB_ITEM