mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-11 06:54:18 +00:00
parent
984be753ad
commit
70e51c0632
@ -124,14 +124,17 @@ void QNitpickerPlatformWindow::_process_key_event(Input::Event *ev)
|
|||||||
_keyboard_handler.processKeycode(keycode, pressed, false);
|
_keyboard_handler.processKeycode(keycode, pressed, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Nitpicker::View_capability QNitpickerPlatformWindow::_parent_view_cap()
|
Nitpicker::View_capability QNitpickerPlatformWindow::_create_view()
|
||||||
{
|
{
|
||||||
|
if (window()->type() == Qt::Desktop)
|
||||||
|
return Nitpicker::View_capability();
|
||||||
|
|
||||||
if (window()->transientParent()) {
|
if (window()->transientParent()) {
|
||||||
QNitpickerPlatformWindow *parent_platform_window =
|
QNitpickerPlatformWindow *parent_platform_window =
|
||||||
static_cast<QNitpickerPlatformWindow*>(window()->transientParent()->handle());
|
static_cast<QNitpickerPlatformWindow*>(window()->transientParent()->handle());
|
||||||
return parent_platform_window->view_cap();
|
return _nitpicker_session.create_view(parent_platform_window->view_cap());
|
||||||
} else
|
} else
|
||||||
return Nitpicker::View_capability();
|
return _nitpicker_session.create_view(Nitpicker::View_capability());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QNitpickerPlatformWindow::_adjust_and_set_geometry(const QRect &rect)
|
void QNitpickerPlatformWindow::_adjust_and_set_geometry(const QRect &rect)
|
||||||
@ -157,7 +160,7 @@ QNitpickerPlatformWindow::QNitpickerPlatformWindow(QWindow *window, Genode::Rpc_
|
|||||||
: QPlatformWindow(window),
|
: QPlatformWindow(window),
|
||||||
_framebuffer_session(_nitpicker_session.framebuffer_session()),
|
_framebuffer_session(_nitpicker_session.framebuffer_session()),
|
||||||
_framebuffer(0),
|
_framebuffer(0),
|
||||||
_view_cap(_nitpicker_session.create_view(_parent_view_cap())),
|
_view_cap(_create_view()),
|
||||||
_input_session(_nitpicker_session.input_session()),
|
_input_session(_nitpicker_session.input_session()),
|
||||||
_timer(this),
|
_timer(this),
|
||||||
_keyboard_handler("", -1, false, false, ""),
|
_keyboard_handler("", -1, false, false, ""),
|
||||||
@ -174,9 +177,11 @@ QNitpickerPlatformWindow::QNitpickerPlatformWindow(QWindow *window, Genode::Rpc_
|
|||||||
_ev_buf = static_cast<Input::Event *>
|
_ev_buf = static_cast<Input::Event *>
|
||||||
(Genode::env()->rm_session()->attach(_input_session.dataspace()));
|
(Genode::env()->rm_session()->attach(_input_session.dataspace()));
|
||||||
|
|
||||||
|
if (_view_cap.valid()) {
|
||||||
/* bring the view to the top */
|
/* bring the view to the top */
|
||||||
Nitpicker::View_client(_view_cap).stack(Nitpicker::View_capability(),
|
Nitpicker::View_client(_view_cap).stack(Nitpicker::View_capability(),
|
||||||
true, false);
|
true, false);
|
||||||
|
}
|
||||||
|
|
||||||
connect(_timer, SIGNAL(timeout()), this, SLOT(handle_events()));
|
connect(_timer, SIGNAL(timeout()), this, SLOT(handle_events()));
|
||||||
_timer->start(10);
|
_timer->start(10);
|
||||||
@ -314,6 +319,7 @@ void QNitpickerPlatformWindow::setWindowTitle(const QString &title)
|
|||||||
|
|
||||||
_title = title.toLocal8Bit();
|
_title = title.toLocal8Bit();
|
||||||
|
|
||||||
|
if (_view_cap.valid())
|
||||||
Nitpicker::View_client(_view_cap).title(_title.constData());
|
Nitpicker::View_client(_view_cap).title(_title.constData());
|
||||||
|
|
||||||
if (qnpw_verbose)
|
if (qnpw_verbose)
|
||||||
|
@ -54,7 +54,7 @@ class QNitpickerPlatformWindow : public QObject, public QPlatformWindow
|
|||||||
void _process_mouse_event(Input::Event *ev);
|
void _process_mouse_event(Input::Event *ev);
|
||||||
void _process_key_event(Input::Event *ev);
|
void _process_key_event(Input::Event *ev);
|
||||||
|
|
||||||
Nitpicker::View_capability _parent_view_cap();
|
Nitpicker::View_capability _create_view();
|
||||||
void _adjust_and_set_geometry(const QRect &rect);
|
void _adjust_and_set_geometry(const QRect &rect);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user