Index: greeter/greeterapp.cpp =================================================================== --- greeter/greeterapp.cpp +++ greeter/greeterapp.cpp @@ -383,21 +383,23 @@ } ); - if (m_testing) { - view->show(); - } else { - // on Wayland we may not use fullscreen as that puts all windows on one screen - if (plasmaSurface) { - view->show(); - } else { + if (QX11Info::isPlatformX11()) { + connect(view, &QQuickWindow::frameSwapped, this, [this, view] { + markViewsAsVisible(view); + }, Qt::QueuedConnection); + if (!m_testing) { view->showFullScreen(); + } else { + view->show(); } + view->raise(); + } else { + view->show(); + view->raise(); + connect(view, &QQuickWindow::frameSwapped, this, [this, view] { + markViewsAsVisible(view); + }, Qt::QueuedConnection); } - view->raise(); - - connect(view, &QQuickWindow::frameSwapped, this, [this, view] { - markViewsAsVisible(view); - }, Qt::QueuedConnection); } } @@ -436,34 +438,28 @@ if (!m_testing) { view->setKeyboardGrabEnabled(true); // TODO - check whether this still works in master! } -// w->setFocus(Qt::OtherFocusReason); // FIXME - } - // determine which window should actually be active and have the real input focus/grab - // FIXME - QWidget::underMouse() -// foreach (QQuickView *view, m_views) { -// if (view->underMouse()) { -// w = view; -// break; -// } -// } - if (!w) { // try harder - foreach (KQuickAddons::QuickViewSharedEngine *view, m_views) { - if (view->geometry().contains(QCursor::pos())) { - w = view; - break; - } + } + foreach (KQuickAddons::QuickViewSharedEngine *view, m_views) { + if (view->geometry().contains(QCursor::pos())) { + w = view; + break; } } if (!w) { // fallback solution w = m_views.first(); } + if (QX11Info::isPlatformX11()) { + w->setFlags(w->flags() & ~Qt::X11BypassWindowManagerHint); + } // activate window and grab input to be sure it really ends up there. // focus setting is still required for proper internal QWidget state (and eg. visual reflection) if (!m_testing) { w->setKeyboardGrabEnabled(true); // TODO - check whether this still works in master! } w->requestActivate(); -// w->setFocus(Qt::OtherFocusReason); // FIXME + if (QX11Info::isPlatformX11()) { + w->setFlags(w->flags() | Qt::X11BypassWindowManagerHint); + } } void UnlockApp::setLockedPropertyOnViews() @@ -568,6 +564,17 @@ return false; } + if (event->type() == QEvent::MouseButtonPress && QX11Info::isPlatformX11()) { + foreach (KQuickAddons::QuickViewSharedEngine *view, m_views) { + if (view->geometry().contains(QCursor::pos())) { + view->requestActivate(); + break; + } + } + + return false; + } + if (event->type() == QEvent::KeyPress) { // react if saver is visible shareEvent(event, qobject_cast(obj)); return false; // we don't care