When passing -stickytopleft all surfaces will be shown at position 0,0
instead of picking a random one. This is useful for apps with one
single large window in combination with -nofullscreen.
Change-Id: I0834c43981a2d2c7b9796e273ac0eb0cfd738132
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
WaylandSurface *surface = qobject_cast<WaylandSurface *>(sender());
QPoint pos;
if (!m_surfaces.contains(surface)) {
- uint px = 1 + (qrand() % (m_window->width() - surface->size().width() - 2));
- uint py = 1 + (qrand() % (m_window->height() - surface->size().height() - 2));
+ uint px = 0;
+ uint py = 0;
+ if (!QCoreApplication::arguments().contains(QLatin1String("-stickytopleft"))) {
+ px = 1 + (qrand() % (m_window->width() - surface->size().width() - 2));
+ py = 1 + (qrand() % (m_window->height() - surface->size().height() - 2));
+ }
pos = QPoint(px, py);
surface->setPos(pos);
} else {