diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-06-06 13:32:47 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-06-18 15:27:58 +0200 |
commit | 3b3c700fabc0e4581f8dceff563cbc1fe3a69972 (patch) | |
tree | dbfe6dc207f08a5bbc7734b88017e7dc3be08c88 /vcl | |
parent | 9199f5d4e971df0b2666226bb14845738bb4d266 (diff) |
[Try to] get rid of dependency on X11
also kill KDE5SalDisplay with fire, it is not used anywhere
anymore
Change-Id: I4fe439b01322a6e3a809cf518e32d844c303daca
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/Library_vclplug_kde5.mk | 2 | ||||
-rw-r--r-- | vcl/unx/kde5/KDE5SalDisplay.cxx | 93 | ||||
-rw-r--r-- | vcl/unx/kde5/KDE5SalDisplay.hxx | 45 | ||||
-rw-r--r-- | vcl/unx/kde5/KDE5SalFrame.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/kde5/KDE5SalGraphics.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/kde5/KDE5SalInstance.cxx | 1 | ||||
-rw-r--r-- | vcl/unx/kde5/VCLKDE5Application.cxx | 3 |
7 files changed, 1 insertions, 147 deletions
diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk index 37a830b068dd..5e9559c159f1 100644 --- a/vcl/Library_vclplug_kde5.mk +++ b/vcl/Library_vclplug_kde5.mk @@ -34,7 +34,6 @@ $(eval $(call gb_Library_add_defs,vclplug_kde5,\ $(eval $(call gb_Library_use_sdk_api,vclplug_kde5)) $(eval $(call gb_Library_use_libraries,vclplug_kde5,\ - vclplug_gen \ vclplug_qt5 \ vcl \ tl \ @@ -90,7 +89,6 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_kde5,\ vcl/unx/kde5/KDE5FilePicker \ vcl/unx/kde5/KDE5FilePicker2 \ vcl/unx/kde5/KDE5SalData \ - vcl/unx/kde5/KDE5SalDisplay \ vcl/unx/kde5/KDE5SalFrame \ vcl/unx/kde5/KDE5SalGraphics \ vcl/unx/kde5/KDE5SalInstance \ diff --git a/vcl/unx/kde5/KDE5SalDisplay.cxx b/vcl/unx/kde5/KDE5SalDisplay.cxx deleted file mode 100644 index fa5e40f56ff9..000000000000 --- a/vcl/unx/kde5/KDE5SalDisplay.cxx +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "VCLKDE5Application.hxx" -#include "KDE5SalDisplay.hxx" - -#ifdef Bool -#undef Bool -#endif - -#include <assert.h> - -SalKDE5Display* SalKDE5Display::selfptr = nullptr; - -SalKDE5Display::SalKDE5Display(Display* pDisp) - : SalX11Display(pDisp) -{ - assert(selfptr == nullptr); - selfptr = this; - xim_protocol = XInternAtom(pDisp_, "_XIM_PROTOCOL", False); -} - -SalKDE5Display::~SalKDE5Display() -{ - // in case never a frame opened - // clean up own members - doDestruct(); - selfptr = nullptr; - // prevent SalDisplay from closing KApplication's display - pDisp_ = nullptr; -} - -void SalKDE5Display::Yield() -{ - if (DispatchInternalEvent()) - return; - - // Prevent blocking from Drag'n'Drop events, which may have already have processed the event - if (XEventsQueued(pDisp_, QueuedAfterReading) == 0) - return; - - DBG_ASSERT(GetSalData()->m_pInstance->GetYieldMutex()->IsCurrentThread(), - "will crash soon since solar mutex not locked in SalKDE5Display::Yield"); - - /*XEvent event; - XNextEvent( pDisp_, &event ); - if( checkDirectInputEvent( &event )) - return; - qApp->x11ProcessEvent( &event );*/ -} - -// HACK: When using Qt event loop, input methods (japanese, etc.) will get broken because -// of XFilterEvent() getting called twice, once by Qt, once by LO (bnc#665112). -// This function is therefore called before any XEvent is passed to Qt event handling -// and if it is a keyboard event and no Qt widget is the active window (i.e. we are -// processing events for some LO window), then feed the event only to LO directly and skip Qt -// completely. Skipped events are KeyPress, KeyRelease and also _XIM_PROTOCOL client message -// (seems to be necessary too, hopefully there are not other internal XIM messages that -// would need this handling). -bool SalKDE5Display::checkDirectInputEvent(xcb_generic_event_t* ev) -{ - switch (ev->response_type & ~0x80) - { - case XCB_CLIENT_MESSAGE: - case XCB_KEY_PRESS: - case XCB_KEY_RELEASE: - if (QApplication::activeWindow() == nullptr) - { - // Dispatch(ev); - return true; - } - break; - } - return false; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5SalDisplay.hxx b/vcl/unx/kde5/KDE5SalDisplay.hxx deleted file mode 100644 index 640efdbc1e03..000000000000 --- a/vcl/unx/kde5/KDE5SalDisplay.hxx +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#pragma once - -#include <unx/saldisp.hxx> -#include <xcb/xcb.h> - -#ifdef CursorShape -#undef CursorShape -#endif - -class SalKDE5Display : public SalX11Display -{ -public: - explicit SalKDE5Display(Display* pDisp); - virtual ~SalKDE5Display() override; - static SalKDE5Display* self(); - virtual void Yield() override; - bool checkDirectInputEvent(xcb_generic_event_t* ev); - -private: - Atom xim_protocol; - static SalKDE5Display* selfptr; -}; - -inline SalKDE5Display* SalKDE5Display::self() { return selfptr; } - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5SalFrame.hxx b/vcl/unx/kde5/KDE5SalFrame.hxx index 11a55b0aae29..58bdcd82f4c0 100644 --- a/vcl/unx/kde5/KDE5SalFrame.hxx +++ b/vcl/unx/kde5/KDE5SalFrame.hxx @@ -24,8 +24,6 @@ #undef Status #include <qt5/Qt5Frame.hxx> -#include <unx/saldisp.hxx> -#include <unx/salgdi.h> #include "KDE5SalGraphics.hxx" diff --git a/vcl/unx/kde5/KDE5SalGraphics.hxx b/vcl/unx/kde5/KDE5SalGraphics.hxx index 60870dd9d4af..77121459e8be 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.hxx +++ b/vcl/unx/kde5/KDE5SalGraphics.hxx @@ -22,8 +22,6 @@ #include <memory> #include <rtl/string.hxx> -#include <unx/saldisp.hxx> -#include <unx/salgdi.h> #include <headless/svpgdi.hxx> #include <QtGui/QImage> diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx index b4e2b68e8045..ac6173e13550 100644 --- a/vcl/unx/kde5/KDE5SalInstance.cxx +++ b/vcl/unx/kde5/KDE5SalInstance.cxx @@ -30,7 +30,6 @@ #include "KDE5SalData.hxx" #include "KDE5SalInstance.hxx" #include "KDE5SalFrame.hxx" -#include "KDE5SalDisplay.hxx" using namespace com::sun::star; diff --git a/vcl/unx/kde5/VCLKDE5Application.cxx b/vcl/unx/kde5/VCLKDE5Application.cxx index 7ae9b5a4ee28..2d9532f1def9 100644 --- a/vcl/unx/kde5/VCLKDE5Application.cxx +++ b/vcl/unx/kde5/VCLKDE5Application.cxx @@ -21,8 +21,7 @@ #include <QtGui/QClipboard> #include <QtCore/QEvent> - -#include "KDE5SalDisplay.hxx" +#include <assert.h> VCLKDE5Application::VCLKDE5Application(int argc, char** argv) : QApplication(argc, argv) |