summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-28 10:48:32 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-28 15:57:49 +0200
commit20c6ab6b492d360faafeb857ef51bc0da5f645f6 (patch)
treef45c6d69d9ecd13591c40b2140f016f1d7610b2b
parent95ed8c0c76c18e773c5484b8b27c36805fcc7b9b (diff)
tdf#117628 crash after closing media player with X11 backend
Change-Id: I812da5ddf7343573f93ea64e592442edb31cad2d Reviewed-on: https://gerrit.libreoffice.org/54911 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/inc/unx/salobj.h1
-rw-r--r--vcl/unx/generic/window/salobj.cxx10
2 files changed, 5 insertions, 6 deletions
diff --git a/vcl/inc/unx/salobj.h b/vcl/inc/unx/salobj.h
index 8eb91b917efe..4a0535507dc2 100644
--- a/vcl/inc/unx/salobj.h
+++ b/vcl/inc/unx/salobj.h
@@ -56,6 +56,7 @@ class VCLPLUG_GEN_PUBLIC X11SalObject : public SalObject
public:
SystemEnvData maSystemChildData;
SalFrame* mpParent;
+ ::Window maParentWin;
::Window maPrimary;
::Window maSecondary;
Colormap maColormap;
diff --git a/vcl/unx/generic/window/salobj.cxx b/vcl/unx/generic/window/salobj.cxx
index 203c1d3bb794..76fe2311514c 100644
--- a/vcl/unx/generic/window/salobj.cxx
+++ b/vcl/unx/generic/window/salobj.cxx
@@ -63,6 +63,7 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
const SystemEnvData* pEnv = pParent->GetSystemData();
Display* pDisp = pSalDisp->GetDisplay();
::Window aObjectParent = static_cast<::Window>(pEnv->aWindow);
+ pObject->maParentWin = aObjectParent;
// find out on which screen that window is
XWindowAttributes aParentAttr;
@@ -235,8 +236,7 @@ X11SalObject::~X11SalObject()
rObjects.remove( this );
GetGenericUnixSalData()->ErrorTrapPush();
- const SystemEnvData* pEnv = mpParent->GetSystemData();
- ::Window aObjectParent = static_cast<::Window>(pEnv->aWindow);
+ ::Window aObjectParent = maParentWin;
XSetWindowBackgroundPixmap(static_cast<Display*>(maSystemChildData.pDisplay), aObjectParent, None);
if ( maSecondary )
XDestroyWindow( static_cast<Display*>(maSystemChildData.pDisplay), maSecondary );
@@ -400,12 +400,11 @@ bool X11SalObject::Dispatch( XEvent* pEvent )
)
{
SalMouseEvent aEvt;
- const SystemEnvData* pParentData = pObject->mpParent->GetSystemData();
int dest_x, dest_y;
::Window aChild = None;
XTranslateCoordinates( pEvent->xbutton.display,
pEvent->xbutton.root,
- pParentData->aWindow,
+ pObject->maParentWin,
pEvent->xbutton.x_root,
pEvent->xbutton.y_root,
&dest_x, &dest_y,
@@ -466,9 +465,8 @@ bool X11SalObject::Dispatch( XEvent* pEvent )
void X11SalObject::SetLeaveEnterBackgrounds(const css::uno::Sequence<css::uno::Any>& rLeaveArgs, const css::uno::Sequence<css::uno::Any>& rEnterArgs)
{
SalDisplay* pSalDisp = vcl_sal::getSalDisplay(GetGenericUnixSalData());
- const SystemEnvData* pEnv = mpParent->GetSystemData();
Display* pDisp = pSalDisp->GetDisplay();
- ::Window aObjectParent = static_cast<::Window>(pEnv->aWindow);
+ ::Window aObjectParent = maParentWin;
bool bFreePixmap = false;
Pixmap aPixmap = None;