mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 10:01:57 +00:00
parent
8788f13e11
commit
8535688605
@ -96,8 +96,21 @@ class QNitpickerPlatformWindow : public QObject, public QPlatformWindow
|
|||||||
|
|
||||||
QString _sanitize_label(QString label);
|
QString _sanitize_label(QString label);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Genode signals are handled as Qt signals to avoid blocking in the
|
||||||
|
* Genode signal handler, which could cause nested signal handler
|
||||||
|
* execution.
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
|
||||||
void _handle_input();
|
void _handle_input();
|
||||||
void _handle_mode_changed();
|
void _handle_mode_changed();
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
|
||||||
|
void _input();
|
||||||
|
void _mode_changed();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ SRC_CC += main.cpp \
|
|||||||
qnitpickerintegration.cpp \
|
qnitpickerintegration.cpp \
|
||||||
qnitpickerplatformwindow.cpp \
|
qnitpickerplatformwindow.cpp \
|
||||||
qnitpickerwindowsurface.cpp \
|
qnitpickerwindowsurface.cpp \
|
||||||
|
moc_qgenodeclipboard.cpp \
|
||||||
moc_qnitpickerplatformwindow.cpp \
|
moc_qnitpickerplatformwindow.cpp \
|
||||||
moc_qnitpickerwindowsurface.cpp \
|
moc_qnitpickerwindowsurface.cpp \
|
||||||
moc_qnitpickerintegrationplugin.cpp
|
moc_qnitpickerintegrationplugin.cpp
|
||||||
|
@ -28,7 +28,7 @@ static constexpr bool verbose = false;
|
|||||||
|
|
||||||
|
|
||||||
QGenodeClipboard::QGenodeClipboard(Genode::Env &env)
|
QGenodeClipboard::QGenodeClipboard(Genode::Env &env)
|
||||||
: _clipboard_signal_handler(env.ep(), *this, &QGenodeClipboard::_handle_clipboard)
|
: _clipboard_signal_handler(env.ep(), *this, &QGenodeClipboard::_clipboard_changed)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@ -52,6 +52,10 @@ QGenodeClipboard::QGenodeClipboard(Genode::Env &env)
|
|||||||
|
|
||||||
}
|
}
|
||||||
} catch (...) { }
|
} catch (...) { }
|
||||||
|
|
||||||
|
connect(this, SIGNAL(_clipboard_changed()),
|
||||||
|
this, SLOT(_handle_clipboard()),
|
||||||
|
Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,8 +28,10 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QGenodeClipboard : public QPlatformClipboard
|
class QGenodeClipboard : public QObject, public QPlatformClipboard
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Genode::Attached_rom_dataspace *_clipboard_ds = nullptr;
|
Genode::Attached_rom_dataspace *_clipboard_ds = nullptr;
|
||||||
@ -41,8 +43,20 @@ class QGenodeClipboard : public QPlatformClipboard
|
|||||||
|
|
||||||
QMember<QMimeData> _mimedata;
|
QMember<QMimeData> _mimedata;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Genode signals are handled as Qt signals to avoid blocking in the
|
||||||
|
* Genode signal handler, which could cause nested signal handler
|
||||||
|
* execution.
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
|
||||||
void _handle_clipboard();
|
void _handle_clipboard();
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
|
||||||
|
void _clipboard_changed();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
QGenodeClipboard(Genode::Env &env);
|
QGenodeClipboard(Genode::Env &env);
|
||||||
|
@ -509,9 +509,9 @@ QNitpickerPlatformWindow::QNitpickerPlatformWindow(Genode::Env &env, QWindow *wi
|
|||||||
_decoration(!window->flags().testFlag(Qt::Popup)),
|
_decoration(!window->flags().testFlag(Qt::Popup)),
|
||||||
_egl_surface(EGL_NO_SURFACE),
|
_egl_surface(EGL_NO_SURFACE),
|
||||||
_input_signal_handler(_env.ep(), *this,
|
_input_signal_handler(_env.ep(), *this,
|
||||||
&QNitpickerPlatformWindow::_handle_input),
|
&QNitpickerPlatformWindow::_input),
|
||||||
_mode_changed_signal_handler(_env.ep(), *this,
|
_mode_changed_signal_handler(_env.ep(), *this,
|
||||||
&QNitpickerPlatformWindow::_handle_mode_changed),
|
&QNitpickerPlatformWindow::_mode_changed),
|
||||||
_touch_device(_init_touch_device())
|
_touch_device(_init_touch_device())
|
||||||
{
|
{
|
||||||
if (qnpw_verbose)
|
if (qnpw_verbose)
|
||||||
@ -533,6 +533,14 @@ QNitpickerPlatformWindow::QNitpickerPlatformWindow(Genode::Env &env, QWindow *wi
|
|||||||
_nitpicker_session.enqueue<Command::To_front>(_view_handle);
|
_nitpicker_session.enqueue<Command::To_front>(_view_handle);
|
||||||
_nitpicker_session.execute();
|
_nitpicker_session.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connect(this, SIGNAL(_input()),
|
||||||
|
this, SLOT(_handle_input()),
|
||||||
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
|
connect(this, SIGNAL(_mode_changed()),
|
||||||
|
this, SLOT(_handle_mode_changed()),
|
||||||
|
Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
QNitpickerPlatformWindow::~QNitpickerPlatformWindow()
|
QNitpickerPlatformWindow::~QNitpickerPlatformWindow()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user