222
222
return requiresParent(qtWindowTypeToMirSurfaceType(type));
225
bool isMovable(const Qt::WindowType type)
227
auto mirType = qtWindowTypeToMirSurfaceType(type);
229
case mir_surface_type_menu:
230
case mir_surface_type_tip:
237
225
Spec makeSurfaceSpec(QWindow *window, MirPixelFormat pixelFormat, UbuntuWindow *parentWindowHandle,
238
226
MirConnection *connection)
535
523
void UbuntuSurface::updateGeometry(const QRect &newGeometry)
537
qCDebug(ubuntumirclient,"updateGeometry(window=%p, width=%d, height=%d)", mWindow,
538
newGeometry.width(), newGeometry.height());
541
if (isMovable(mWindow->type())) {
542
spec = Spec{makeSurfaceSpec(mWindow, mPixelFormat, mParentWindowHandle, mConnection)};
526
auto spec = Spec{mir_connection_create_spec_for_changes(mConnection)};
528
mir_surface_spec_set_width(spec.get(), newGeometry.width());
529
mir_surface_spec_set_height(spec.get(), newGeometry.height());
531
MirRectangle mirRect {0,0,0,0};
533
if (mParentWindowHandle) {
534
qCDebug(ubuntumirclient,"updateGeometry(window=%p, x=%d, y=%d, width=%d, height=%d, child)", mWindow,
535
newGeometry.x(), newGeometry.y(), newGeometry.width(), newGeometry.height());
537
mirRect.left = newGeometry.x() - mParentWindowHandle->window()->x();
538
mirRect.top = newGeometry.y() - mParentWindowHandle->window()->y();
544
spec = Spec{mir_connection_create_spec_for_changes(mConnection)};
545
mir_surface_spec_set_width(spec.get(), newGeometry.width());
546
mir_surface_spec_set_height(spec.get(), newGeometry.height());
541
qCDebug(ubuntumirclient,"updateGeometry(window=%p, x=%d, y=%d, width=%d, height=%d, top-level)", mWindow,
542
newGeometry.x(), newGeometry.y(), newGeometry.width(), newGeometry.height());
544
mirRect.left = newGeometry.x();
545
mirRect.top = newGeometry.y();
548
mir_surface_spec_set_placement(spec.get(), &mirRect,
549
mir_placement_gravity_northwest /* rect_gravity */, mir_placement_gravity_northwest /* surface_gravity */,
550
(MirPlacementHints)0, 0 /* offset_dx */, 0 /* offset_dy */);
548
552
mir_surface_apply_spec(mMirSurface, spec.get());
712
716
w, w->screen()->handle(), input, mSurface.get(), qPrintable(window()->title()), roleFor(window()));
714
718
updatePanelHeightHack(mSurface->state() != mir_surface_state_fullscreen);
720
// queue the windowPropertyChanged signal. If it's emitted directly, the platformWindow will not yet be set for the window.
721
QMetaObject::invokeMethod(mNativeInterface, "windowPropertyChanged", Qt::QueuedConnection,
722
Q_ARG(QPlatformWindow*, this),
723
Q_ARG(QString, "persistentSurfaceId"));
717
726
UbuntuWindow::~UbuntuWindow()