From 7163d64b90ac4d4259b1d0379cfca348dd30601c Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Thu, 27 Feb 2014 20:34:00 +0000 Subject: KDE4: evaluate frameWidth in the Qt thread When opening a document via Java UNO without a running LO instance, one gets the following Qt error messages: CE> QObject: Cannot create children for a parent that is in a different thread. CE> (Parent is Oxygen::WidgetStateEngine(0x8deb878), parent's thread is QThread(0x8d6cf70), current thread is QThread(0xa8fa7fc8) CE> QObject::installEventFilter(): Cannot filter events for objects in a different thread. CE> QObject::installEventFilter(): Cannot filter events for objects in a different thread. CE> QObject::installEventFilter(): Cannot filter events for objects in a different thread. This happens, because the Java UNO call is processed in the first / Qt thread while document loading happens in a second thread. Document loading actually just calls getNativeControlRegion, which should not involve any drawing. But the KDE4 backend does some style processing to get the correct frame width (QWidget::ensurePolished(), which uses GUI based events and need to be processed in the Qt thread. Change-Id: I344d5089d958963c48a9a8a84bfa9fe8f092b75a --- vcl/unx/kde4/KDEXLib.hxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'vcl/unx/kde4/KDEXLib.hxx') diff --git a/vcl/unx/kde4/KDEXLib.hxx b/vcl/unx/kde4/KDEXLib.hxx index d07b9f6c6d81..dd7f83f7d18e 100644 --- a/vcl/unx/kde4/KDEXLib.hxx +++ b/vcl/unx/kde4/KDEXLib.hxx @@ -53,6 +53,7 @@ class KDEXLib : public QObject, public SalXLib QTimer userEventTimer; enum { LibreOfficeEventLoop, GlibEventLoop, QtUnixEventLoop } eventLoopType; bool m_bYieldFrozen; + int m_frameWidth; private: void setupEventLoop(); @@ -71,6 +72,7 @@ class KDEXLib : public QObject, public SalXLib com::sun::star::uno::Reference< com::sun::star::ui::dialogs::XFilePicker2 > createFilePickerSignal( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& ); + int getFrameWidthSignal(); public: KDEXLib(); @@ -89,9 +91,10 @@ class KDEXLib : public QObject, public SalXLib void doStartup(); public Q_SLOTS: - virtual com::sun::star::uno::Reference< com::sun::star::ui::dialogs::XFilePicker2 > + com::sun::star::uno::Reference< com::sun::star::ui::dialogs::XFilePicker2 > createFilePicker( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& ); + int getFrameWidth(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit