21static NET::WindowType scopeToType(
const QString &scope)
23 static const QHash<QString, NET::WindowType> scopeToType{
24 {QStringLiteral(
"desktop"), NET::Desktop},
25 {QStringLiteral(
"dock"), NET::Dock},
26 {QStringLiteral(
"crititical-notification"), NET::CriticalNotification},
27 {QStringLiteral(
"notification"), NET::Notification},
28 {QStringLiteral(
"tooltip"), NET::Tooltip},
29 {QStringLiteral(
"on-screen-display"), NET::OnScreenDisplay},
30 {QStringLiteral(
"dialog"), NET::Dialog},
31 {QStringLiteral(
"splash"), NET::Splash},
32 {QStringLiteral(
"utility"), NET::Utility},
34 return scopeToType.value(scope.toLower(), NET::Normal);
41 , m_desiredOutput(output)
42 , m_integration(integration)
43 , m_shellSurface(shellSurface)
44 , m_windowType(scopeToType(shellSurface->scope()))
56 this, &LayerShellV1Window::scheduleRearrange);
58 this, &LayerShellV1Window::handleOutputEnabledChanged);
61 this, &LayerShellV1Window::handleSizeChanged);
63 this, &LayerShellV1Window::handleUnmapped);
65 this, &LayerShellV1Window::handleCommitted);
68 this, &LayerShellV1Window::scheduleRearrange);
70 this, &LayerShellV1Window::scheduleRearrange);
72 this, &LayerShellV1Window::scheduleRearrange);
74 this, &LayerShellV1Window::scheduleRearrange);
76 this, &LayerShellV1Window::scheduleRearrange);
78 this, &LayerShellV1Window::handleAcceptsFocusChanged);
83 return m_shellSurface;
88 return m_desiredOutput;
91void LayerShellV1Window::scheduleRearrange()
182 m_screenEdge->disconnect(
this);
184 m_shellSurface->disconnect(
this);
185 m_shellSurface->
surface()->disconnect(
this);
186 m_desiredOutput->disconnect(
this);
205 switch (m_shellSurface->
layer()) {
241 updateRect.moveTopLeft(
rect.topLeft());
245void LayerShellV1Window::handleSizeChanged()
251void LayerShellV1Window::handleUnmapped()
256void LayerShellV1Window::handleCommitted()
263void LayerShellV1Window::handleAcceptsFocusChanged()
265 switch (m_shellSurface->
layer()) {
278void LayerShellV1Window::handleOutputEnabledChanged()
300 QTimer::singleShot(0,
this, &LayerShellV1Window::deactivateScreenEdge);
307 connect(edge, &AutoHideScreenEdgeV1Interface::destroyed,
308 this, &LayerShellV1Window::deactivateScreenEdge);
310 this, &LayerShellV1Window::activateScreenEdge);
312 this, &LayerShellV1Window::deactivateScreenEdge);
315 if (m_screenEdgeActive) {
321void LayerShellV1Window::reserveScreenEdge()
323 if (
workspace()->screenEdges()->reserve(
this, m_screenEdge->border())) {
330void LayerShellV1Window::unreserveScreenEdge()
336void LayerShellV1Window::activateScreenEdge()
338 m_screenEdgeActive =
true;
342void LayerShellV1Window::deactivateScreenEdge()
344 m_screenEdgeActive =
false;
345 unreserveScreenEdge();
350#include "moc_layershellv1window.cpp"
void deactivateRequested()
void recreateWindow(LayerSurfaceV1Interface *shellSurface)
bool acceptsFocus() const override
bool wantsInput() const override
void installAutoHideScreenEdgeV1(AutoHideScreenEdgeV1Interface *edge)
LayerShellV1Window(LayerSurfaceV1Interface *shellSurface, Output *output, LayerShellV1Integration *integration)
void closeWindow() override
Output * desiredOutput() const
bool dockWantsInput() const override
bool isPlaceable() const override
void setVirtualKeyboardGeometry(const QRectF &geo) override
bool isCloseable() const override
LayerSurfaceV1Interface * shellSurface() const
StrutRect strutRect(StrutArea area) const override
bool isResizable() const override
Layer belongsToLayer() const override
void moveResizeInternal(const QRectF &rect, MoveResizeMode mode) override
void destroyWindow() override
bool isMovableAcrossScreens() const override
void showOnScreenEdge() override
bool isMovable() const override
bool takeFocus() override
NET::WindowType windowType() const override
bool hasStrut() const override
void desiredSizeChanged()
void aboutToBeDestroyed()
int exclusiveZone() const
bool acceptsFocus() const
void acceptsFocusChanged()
Qt::Edge exclusiveEdge() const
void exclusiveZoneChanged()
SurfaceInterface * surface() const
quint32 sendConfigure(const QSize &size)
void reserve(ElectricBorder border, QObject *object, const char *callback)
void aboutToBeDestroyed()
void removeWindow(Window *c)
void updateGeometry(const QRectF &rect)
virtual QSizeF clientSizeToFrameSize(const QSizeF &size) const
SurfaceInterface * surface() const
void setSkipTaskbar(bool set)
bool readyForPainting() const
QSizeF clientSize() const
void setHidden(bool hidden)
QRectF m_virtualKeyboardGeometry
void setSkipPager(bool set)
void frameGeometryChanged(const QRectF &oldGeometry)
bool areGeometryUpdatesBlocked() const
void setPendingMoveResizeMode(MoveResizeMode mode)
virtual QSizeF frameSizeToClientSize(const QSizeF &size) const
void setSkipSwitcher(bool set)
ScreenEdges * screenEdges() const
void activateWindow(Window *window, bool force=false)
WaylandServer * waylandServer()