diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-08-06 17:11:52 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-08-07 16:43:25 +0200 |
commit | 0c02747e54d34c4148a8a8fe389726703187ab5d (patch) | |
tree | 2eab0ace4e8357cf89e2c4e6ee5674b2cf2e0d2d /vcl | |
parent | c86a47a9d3debbc7e8ee6247f573e7f98c611f19 (diff) |
Qt5 fix main loop locking when processing events
In commit bded890a44cc ("Qt5 just release the SolarMutex for Qt
event") the Qt5 main loop was switched to running non-locked, as
most other backends do, so now we must take the lock when
processing Qt events.
Eventually CallCallback should be virtual for security?
Change-Id: I8cbfc9bb8b3de677a70ad3bd5cb3910fabec9b87
Reviewed-on: https://gerrit.libreoffice.org/58650
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/qt5/Qt5Frame.hxx | 9 | ||||
-rw-r--r-- | vcl/qt5/Qt5Timer.cxx | 8 |
2 files changed, 16 insertions, 1 deletions
diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx index 96446c28a358..310298879e52 100644 --- a/vcl/inc/qt5/Qt5Frame.hxx +++ b/vcl/inc/qt5/Qt5Frame.hxx @@ -25,6 +25,7 @@ #include "Qt5Tools.hxx" #include <headless/svpgdi.hxx> +#include <vcl/svapp.hxx> class Qt5Graphics; class Qt5Instance; @@ -140,6 +141,14 @@ public: virtual void SetScreenNumber(unsigned int) override; virtual void SetApplicationID(const OUString&) override; + + inline bool CallCallback(SalEvent nEvent, const void* pEvent) const; }; +inline bool Qt5Frame::CallCallback(SalEvent nEvent, const void* pEvent) const +{ + SolarMutexGuard aGuard; + return SalFrame::CallCallback(nEvent, pEvent); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/qt5/Qt5Timer.cxx b/vcl/qt5/Qt5Timer.cxx index 2fa07886f60f..56dec31d7d31 100644 --- a/vcl/qt5/Qt5Timer.cxx +++ b/vcl/qt5/Qt5Timer.cxx @@ -23,6 +23,8 @@ #include <QtWidgets/QApplication> #include <QtCore/QThread> +#include <vcl/svapp.hxx> + Qt5Timer::Qt5Timer() { m_aTimer.setSingleShot(true); @@ -34,7 +36,11 @@ Qt5Timer::Qt5Timer() Qt5Timer::~Qt5Timer() {} -void Qt5Timer::timeoutActivated() { CallCallback(); } +void Qt5Timer::timeoutActivated() +{ + SolarMutexGuard aGuard; + CallCallback(); +} void Qt5Timer::startTimer() { m_aTimer.start(); } |