void QEglFSKmsIntegration::presentBuffer(QPlatformSurface *surface) { QWindow *window = static_cast<QWindow *>(surface->surface()); QEglFSKmsScreen *screen = static_cast<QEglFSKmsScreen *>(window->screen()->handle()); screen->flip(); }
void QEglFSKmsIntegration::waitForVSync(QPlatformSurface *surface) const { QWindow *window = static_cast<QWindow *>(surface->surface()); QEglFSKmsScreen *screen = static_cast<QEglFSKmsScreen *>(window->screen()->handle()); screen->waitForFlip(); }
void tst_QWidget_window::tst_updateWinId_QTBUG40681() { QWidget w; QVBoxLayout *vl = new QVBoxLayout(&w); QLabel *lbl = new QLabel("HELLO1"); lbl->setAttribute(Qt::WA_NativeWindow); lbl->setObjectName("label1"); vl->addWidget(lbl); w.setMinimumWidth(200); w.show(); QVERIFY(QTest::qWaitForWindowExposed(&w)); QCOMPARE(lbl->winId(), lbl->windowHandle()->winId()); // simulate screen change and notification QWindow *win = w.windowHandle(); w.windowHandle()->destroy(); lbl->windowHandle()->destroy(); w.windowHandle()->create(); lbl->windowHandle()->create(); QWindowPrivate *p = qt_window_private(win); p->emitScreenChangedRecursion(win->screen()); QCOMPARE(lbl->winId(), lbl->windowHandle()->winId()); }
void QMeeGoPlatformInputContext::inputItemChanged() { if (!d->valid) return; QInputPanel *panel = qApp->inputPanel(); QObject *input = panel->inputItem(); QWindow *window = panel->inputWindow(); d->imState["focusState"] = input != 0; if (input) { if (window) d->imState["winId"] = static_cast<qulonglong>(window->winId()); if (!d->active) { d->active = true; d->server->activateContext(); // ### react to orientation changes, too if (window) d->server->appOrientationChanged(orientationAngle(window->screen()->currentOrientation())); } } d->sendStateUpdate(/*focusChanged*/true); if (input && window && d->visibility == InputPanelShowRequested) showInputPanel(); }
void QQuickMenuPopupWindow::setGeometry(int posx, int posy, int w, int h) { QWindow *pw = transientParent(); if (!pw && parentItem()) pw = parentItem()->window(); if (!pw) pw = this; QRect g = pw->screen()->availableVirtualGeometry(); if (posx + w > g.right()) { if (qobject_cast<QQuickMenuPopupWindow *>(transientParent())) { // reposition submenu window on the parent menu's left side int submenuOverlap = pw->x() + pw->width() - posx; posx -= pw->width() + w - 2 * submenuOverlap; } else { posx = g.right() - w; } } else { posx = qMax(posx, g.left()); } posy = qBound(g.top(), posy, g.bottom() - h); QQuickWindow::setGeometry(posx, posy, w, h); }