Kaydet (Commit) 3b3c700f authored tarafından Katarina Behrens's avatar Katarina Behrens

[Try to] get rid of dependency on X11

also kill KDE5SalDisplay with fire, it is not used anywhere
anymore

Change-Id: I4fe439b01322a6e3a809cf518e32d844c303daca
üst 9199f5d4
......@@ -11199,7 +11199,7 @@ then
PKG_CHECK_MODULES(KF5_XCB,[xcb],,[AC_MSG_ERROR([XCB not installed])])
KF5_CFLAGS="-I$kf5_incdir -I$kf5_incdir/KCoreAddons -I$kf5_incdir/KI18n -I$kf5_incdir/KConfigCore -I$kf5_incdir/KWindowSystem -I$kf5_incdir/KIOCore -I$kf5_incdir/KIOWidgets -I$kf5_incdir/KIOFileWidgets -I$qt5_incdir -I$qt5_incdir/QtCore -I$qt5_incdir/QtGui -I$qt5_incdir/QtWidgets -I$qt5_incdir/QtNetwork -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT $KF5_XCB_CFLAGS"
KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network -lQt5X11Extras $KF5_XCB_LIBS"
KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network $KF5_XCB_LIBS"
KF5_CFLAGS=$(printf '%s' "$KF5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
AC_LANG_PUSH([C++])
......
......@@ -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 \
......
/* -*- 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: */
/* -*- 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: */
......@@ -24,8 +24,6 @@
#undef Status
#include <qt5/Qt5Frame.hxx>
#include <unx/saldisp.hxx>
#include <unx/salgdi.h>
#include "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>
......
......@@ -30,7 +30,6 @@
#include "KDE5SalData.hxx"
#include "KDE5SalInstance.hxx"
#include "KDE5SalFrame.hxx"
#include "KDE5SalDisplay.hxx"
using namespace com::sun::star;
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment