2019-02-19 08:50:20 +00:00
|
|
|
/********************************************************************
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright 2019 Roman Gilg <subdiff@gmail.com>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
|
|
|
#ifndef KWIN_XWL_XWAYLAND
|
|
|
|
#define KWIN_XWL_XWAYLAND
|
|
|
|
|
2018-08-22 12:36:11 +00:00
|
|
|
#include "xwayland_interface.h"
|
2019-02-19 08:50:20 +00:00
|
|
|
|
2018-08-21 20:06:42 +00:00
|
|
|
#include <xcb/xproto.h>
|
|
|
|
|
2019-02-19 08:50:20 +00:00
|
|
|
class QProcess;
|
|
|
|
|
|
|
|
class xcb_screen_t;
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
2018-08-22 00:20:16 +00:00
|
|
|
class ApplicationWaylandAbstract;
|
2019-02-19 08:50:20 +00:00
|
|
|
|
|
|
|
namespace Xwl
|
|
|
|
{
|
2018-08-21 20:06:42 +00:00
|
|
|
class DataBridge;
|
2019-02-19 08:50:20 +00:00
|
|
|
|
2018-08-22 12:36:11 +00:00
|
|
|
class Xwayland : public XwaylandInterface
|
2019-02-19 08:50:20 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2018-08-21 20:06:42 +00:00
|
|
|
static Xwayland* self();
|
|
|
|
|
2018-08-22 00:20:16 +00:00
|
|
|
Xwayland(ApplicationWaylandAbstract *app, QObject *parent = nullptr);
|
2019-02-19 08:50:20 +00:00
|
|
|
virtual ~Xwayland();
|
|
|
|
|
|
|
|
void init();
|
2018-08-21 20:06:42 +00:00
|
|
|
void prepareDestroy();
|
|
|
|
|
|
|
|
xcb_screen_t *xcbScreen() const {
|
|
|
|
return m_xcbScreen;
|
|
|
|
}
|
|
|
|
const xcb_query_extension_reply_t *xfixes() const {
|
|
|
|
return m_xfixes;
|
|
|
|
}
|
2019-02-19 08:50:20 +00:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
2019-02-23 12:17:50 +00:00
|
|
|
void initialized();
|
2019-02-19 08:50:20 +00:00
|
|
|
void criticalError(int code);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void createX11Connection();
|
|
|
|
void continueStartupWithX();
|
|
|
|
|
2018-08-22 12:56:48 +00:00
|
|
|
DragEventReply dragMoveFilter(Toplevel *target, QPoint pos) override;
|
|
|
|
|
2019-02-19 08:50:20 +00:00
|
|
|
int m_xcbConnectionFd = -1;
|
|
|
|
QProcess *m_xwaylandProcess = nullptr;
|
|
|
|
QMetaObject::Connection m_xwaylandFailConnection;
|
|
|
|
|
2018-08-21 20:06:42 +00:00
|
|
|
xcb_screen_t *m_xcbScreen = nullptr;
|
|
|
|
const xcb_query_extension_reply_t *m_xfixes = nullptr;
|
|
|
|
DataBridge *m_dataBridge = nullptr;
|
|
|
|
|
2018-08-22 00:20:16 +00:00
|
|
|
ApplicationWaylandAbstract *m_app;
|
2019-02-19 08:50:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|