diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-01-26 10:03:37 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-01-27 10:18:50 +0100 |
commit | df788fcc308bbf8950ad8a22a1f8290681b64f0d (patch) | |
tree | eac883afe20faea112046e1ca4d3999c5668ef1c /include | |
parent | 7d506f6bb45725bff9d5a6ddf0893d826f992596 (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>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/sysdata.hxx | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/include/vcl/sysdata.hxx b/include/vcl/sysdata.hxx index ed93b524d699..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,18 +62,16 @@ 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 - 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 @@ -79,29 +82,28 @@ public: aWindow = nWindow; } - sal_uIntPtr GetWindowHandle() const - { - return aWindow; - } + // 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) + , pDisplay(nullptr) , pSalFrame(nullptr) , pWidget(nullptr) , pVisual(nullptr) , nScreen(0) , aShellWindow(0) - , toolkit(Toolkit()) , platform(Platform()) , aWindow(0) #endif |