diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-01-25 20:59:58 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-01-27 13:39:31 +0100 |
commit | ac9789dbb36f45dcc1caf7dd2951353b1574c8ea (patch) | |
tree | 320145e75c0b59160f7c255641dafaf9e5c6a881 /include | |
parent | 89516b2be525a01862eacdef2276f0699ed87e3d (diff) |
tdf#139609 avoid fetching unnecessary xid under gtk3
because of the side effects
using a bare GtkGrid as m_pSocket in vcl/unx/gtk3/gtk3gtkobject.cxx
is perhaps a poor choice, getting its xid causes poor side effects
wrt events belonging to its child widgets getting delivered to
the SalFrame widget, so duplicate scrolling after showing a opengl
slide and/or showing a video and lots of flickering
we're (generally at least) not using the xid under gtk3 so don't set it
unless it's explicitly asked for. Happily the gtk Player::createPlayerWindow
doesn't use its arg[0] xid in any case, so don't bother setting it for
that backend.
Change-Id: I1c59a607a332635091782c3b49de10647558f301
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109941
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
and...
use an accessor for SystemEnvData::aWindow
with an eye to making it on-demand
Change-Id: If6cefd68a336dc6afe23591c857bd71034215b54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109929
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110005
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/sysdata.hxx | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/include/vcl/sysdata.hxx b/include/vcl/sysdata.hxx index 3abf92b55640..63b7c810de3d 100644 --- a/include/vcl/sysdata.hxx +++ b/include/vcl/sysdata.hxx @@ -21,6 +21,9 @@ #define INCLUDED_VCL_SYSDATA_HXX #include <sal/types.h> +#include <vcl/dllapi.h> + +class SalFrame; #ifdef MACOSX // predeclare the native classes to avoid header/include problems @@ -45,8 +48,10 @@ typedef struct CGContext *CGContextRef; #include <postwin.h> #endif -struct SystemEnvData +struct VCL_DLLPUBLIC SystemEnvData { + enum class Toolkit { Gen, Gtk3, Qt5 }; + Toolkit toolkit; // the toolkit in use #if defined(_WIN32) HWND hWnd; // the window hwnd #elif defined( MACOSX ) @@ -57,40 +62,50 @@ struct SystemEnvData #elif defined( IOS ) // Nothing #elif defined( UNX ) - enum class Toolkit { Gtk3, Qt5, Gen }; enum class Platform { Wayland, Xcb }; void* pDisplay; // the relevant display connection - sal_uIntPtr aWindow; // the window of the object - void* pSalFrame; // contains a salframe, if object has one + SalFrame* pSalFrame; // contains a salframe, if object has one void* pWidget; // the corresponding widget void* pVisual; // the visual in use int nScreen; // the current screen of the window // note: this is a "long" in Xlib *but* in the protocol it's only 32-bit // however, the GTK3 vclplug wants to store pointers in here! sal_IntPtr aShellWindow; // the window of the frame's shell - Toolkit toolkit; // the toolkit in use Platform platform; // the windowing system in use +private: + sal_uIntPtr aWindow; // the window of the object +public: + + void SetWindowHandle(sal_uIntPtr nWindow) + { + aWindow = nWindow; + } + + // SalFrame can be any SalFrame, just needed to determine which backend to use + // to resolve the window handle + sal_uIntPtr GetWindowHandle(const SalFrame* pReference) const; + #endif SystemEnvData() + : toolkit(Toolkit::Gen) #if defined(_WIN32) - : hWnd(nullptr) + , hWnd(nullptr) #elif defined( MACOSX ) - : mpNSView(nullptr) + , mpNSView(nullptr) , mbOpenGL(false) #elif defined( ANDROID ) #elif defined( IOS ) #elif defined( UNX ) - : pDisplay(nullptr) - , aWindow(0) + , pDisplay(nullptr) , pSalFrame(nullptr) , pWidget(nullptr) , pVisual(nullptr) , nScreen(0) , aShellWindow(0) - , toolkit(Toolkit()) , platform(Platform()) + , aWindow(0) #endif { } |