From 9090dc1f3b27195f5defd35586ac79357992be21 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 18 Jan 2021 18:27:19 +0200 Subject: split OutputDevice from Window as part of a longer-term goal of doing our widget rendering only inside a top-level render- context. I moved all of the OutputDevice-related code that existed in vcl::Window into a new subclass of OutputDevice called WindowOutputDevice. Notes for further work (*) not sure why we are getting an 1x1 surface in SvpSalGraphics::releaseCairoContext, but to fix it I clamp the size there (*) might have to dump VCLXDevice, and move it's code down into VCLXWindow and VCLXVirtualDevice (*) can we remove use of VCLXDevice in other places, in favour of just talking to the VCL code? Change-Id: I105946377f5322677d6f7d0c1c23847178a720b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113204 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/toolkit/awt/vclxwindow.hxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include/toolkit') diff --git a/include/toolkit/awt/vclxwindow.hxx b/include/toolkit/awt/vclxwindow.hxx index 5e5ac617a26a..24cefd4e5a6a 100644 --- a/include/toolkit/awt/vclxwindow.hxx +++ b/include/toolkit/awt/vclxwindow.hxx @@ -123,10 +123,14 @@ public: virtual void SetWindow( const VclPtr< vcl::Window > &pWindow ); template< class derived_type > derived_type* GetAs() const { - return static_cast< derived_type * >( GetOutputDevice().get() ); } + return static_cast< derived_type * >( GetWindow() ); } template< class derived_type > derived_type* GetAsDynamic() const { - return dynamic_cast< derived_type * >( GetOutputDevice().get() ); } - vcl::Window* GetWindow() const { return GetAs(); } + return dynamic_cast< derived_type * >( GetWindow() ); } + vcl::Window* GetWindow() const + { + auto p = GetOutputDevice().get(); + return p ? p->GetOwnerWindow() : nullptr; + } void suspendVclEventListening( ); void resumeVclEventListening( ); -- cgit