summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/inc/salobj.hxx7
-rw-r--r--vcl/qt5/Qt5Frame.cxx20
-rw-r--r--vcl/source/window/syschild.cxx6
3 files changed, 17 insertions, 16 deletions
diff --git a/vcl/inc/salobj.hxx b/vcl/inc/salobj.hxx
index 3e8dbf152d29..af4d44e42c92 100644
--- a/vcl/inc/salobj.hxx
+++ b/vcl/inc/salobj.hxx
@@ -21,16 +21,17 @@
#define INCLUDED_VCL_INC_SALOBJ_HXX
#include <vcl/dllapi.h>
+#include <vcl/syschild.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include "salwtype.hxx"
struct SystemEnvData;
-typedef void (*SALOBJECTPROC)( void* pInst, SalObjEvent nEvent );
+typedef void (*SALOBJECTPROC)(SystemChildWindow* pInst, SalObjEvent nEvent);
class VCL_PLUGIN_PUBLIC SalObject
{
- void* m_pInst;
+ VclPtr<SystemChildWindow> m_pInst;
SALOBJECTPROC m_pCallback;
bool m_bMouseTransparent:1,
m_bEraseBackground:1;
@@ -54,7 +55,7 @@ public:
virtual const SystemEnvData* GetSystemData() const = 0;
- void SetCallback( void* pInst, SALOBJECTPROC pProc )
+ void SetCallback( SystemChildWindow* pInst, SALOBJECTPROC pProc )
{ m_pInst = pInst; m_pCallback = pProc; }
void CallCallback( SalObjEvent nEvent )
{ if (m_pCallback) m_pCallback( m_pInst, nEvent ); }
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index a47d39211ee5..6b738f159ea4 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -33,6 +33,7 @@
#include <QtCore/QMimeData>
#include <QtCore/QPoint>
#include <QtCore/QSize>
+#include <QtCore/QThread>
#include <QtGui/QIcon>
#include <QtGui/QWindow>
#include <QtGui/QScreen>
@@ -556,21 +557,18 @@ void Qt5Frame::SetModal(bool bModal)
auto* pSalInst(static_cast<Qt5Instance*>(GetSalData()->m_pInstance));
assert(pSalInst);
pSalInst->RunInMainThread([this, bModal]() {
- bool wasVisible = windowHandle()->isVisible();
+
+ QWidget* const pChild = m_pTopLevel ? m_pTopLevel : m_pQWidget;
+ const bool bWasVisible = pChild->isVisible();
// modality change is only effective if the window is hidden
- if (wasVisible)
- {
- windowHandle()->hide();
- }
+ if (bWasVisible)
+ pChild->hide();
- windowHandle()->setModality(bModal ? Qt::WindowModal : Qt::NonModal);
+ pChild->setWindowModality(bModal ? Qt::WindowModal : Qt::NonModal);
- // and shown again if it was visible
- if (wasVisible)
- {
- windowHandle()->show();
- }
+ if (bWasVisible)
+ pChild->show();
});
}
}
diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx
index 28063ce19c63..e6f3e6013400 100644
--- a/vcl/source/window/syschild.cxx
+++ b/vcl/source/window/syschild.cxx
@@ -42,9 +42,9 @@
using namespace ::com::sun::star;
-static void ImplSysChildProc( void* pInst, SalObjEvent nEvent )
+static void ImplSysChildProc( SystemChildWindow* pInst, SalObjEvent nEvent )
{
- VclPtr<SystemChildWindow> pWindow = static_cast<SystemChildWindow*>(pInst);
+ VclPtr<SystemChildWindow> pWindow = pInst;
switch ( nEvent )
{
@@ -68,6 +68,8 @@ static void ImplSysChildProc( void* pInst, SalObjEvent nEvent )
case SalObjEvent::LoseFocus:
// trigger a LoseFocus which matches the status
// of the window with matching Activate-Status
+ if (pWindow->IsDisposed())
+ break;
pWindow->ImplGetFrameData()->mbSysObjFocus = false;
if ( !pWindow->ImplGetFrameData()->mnFocusId )
{