Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions qwlroots/src/types/qwxdgshell.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,30 @@ class QW_CLASS_OBJECT(xdg_toplevel)
QW_SIGNAL(set_app_id, char*)

public:
QW_ALWAYS_INLINE bool is_initial_commit() const
{
const auto *toplevel = handle();
return toplevel && toplevel->base && toplevel->base->initial_commit;
}

QW_ALWAYS_INLINE bool is_maximize_requested() const
{
const auto *toplevel = handle();
return toplevel && toplevel->requested.maximized;
}

QW_ALWAYS_INLINE bool is_minimize_requested() const
{
const auto *toplevel = handle();
return toplevel && toplevel->requested.minimized;
}

QW_ALWAYS_INLINE bool is_fullscreen_requested() const
{
const auto *toplevel = handle();
return toplevel && toplevel->requested.fullscreen;
}

QW_FUNC_STATIC(xdg_toplevel, from_resource, qw_xdg_toplevel *, wl_resource *resource)
QW_FUNC_STATIC(xdg_toplevel, try_from_wlr_surface, qw_xdg_toplevel *, wlr_surface *surface)

Expand Down
6 changes: 6 additions & 0 deletions qwlroots/src/types/qwxwaylandsurface.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ class QW_CLASS_OBJECT(xwayland_surface)
QW_SIGNAL(dissociate)

public:
QW_ALWAYS_INLINE bool is_maximized() const
{
const auto *surface = handle();
return surface && surface->maximized_horz && surface->maximized_vert;
}

QW_FUNC_STATIC(xwayland_surface, try_from_wlr_surface, qw_xwayland_surface *, wlr_surface *surface)

QW_FUNC_MEMBER(xwayland_surface, activate, void, bool activated)
Expand Down
264 changes: 236 additions & 28 deletions src/core/shellhandler.cpp

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions src/core/shellhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@

#include <QHash>
#include <QList>
#include <QMap>

Check warning on line 16 in src/core/shellhandler.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QMap> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QObject>

Check warning on line 17 in src/core/shellhandler.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QObject> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QPointer>

Check warning on line 18 in src/core/shellhandler.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QPointer> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QRectF>

Check warning on line 19 in src/core/shellhandler.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QRectF> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QSet>
#include <QSize>

Q_MOC_INCLUDE("workspace/workspace.h")
Q_MOC_INCLUDE(<wlayersurface.h>)
Expand Down Expand Up @@ -157,11 +159,20 @@
const QString &darkPalette,
const QString &lightPalette,
qlonglong splashThemeType);
bool hasPrelaunchAppIdCandidates() const;
void rememberUnmatchedPrelaunchAppId(const QString &appId,
const QSize &lastNormalSize = QSize());
void updateUnmatchedPrelaunchLastSize(const QString &appId, const QSize &lastNormalSize);
void seedUnmatchedPrelaunchLastSize(const QString &appId, SurfaceWrapper *wrapper);

// --- helpers (internal) ---
// Creates or matches a wrapper from prelaunch splash, then initializes it
void ensureXdgWrapper(WAYLIB_SERVER_NAMESPACE::WXdgToplevelSurface *surface,
const QString &appId);
bool configureInitialXdgMaximize(
WAYLIB_SERVER_NAMESPACE::WXdgToplevelSurface *surface);
void cancelPendingInitialXdgMaximize(
WAYLIB_SERVER_NAMESPACE::WXdgToplevelSurface *surface);
// Creates or matches a wrapper from prelaunch splash, then initializes it
void ensureXwaylandWrapper(WAYLIB_SERVER_NAMESPACE::WXWaylandSurface *surface,
const QString &appId);
Expand Down Expand Up @@ -200,11 +211,25 @@
QSet<QString> m_pendingPrelaunchAppIds;
// AppIds of closed splash screens, used to close matching real windows
QSet<QString> m_closedSplashAppIds;
struct UnmatchedPrelaunchInfo
{
quint64 generation = 0;
QSize lastNormalSize;
QList<QPointer<SurfaceWrapper>> waitingWrappers;
};
// Launch context whose splash disappeared before a real surface could be matched. Keep its
// restore size for a short grace period so an already-maximized first buffer cannot replace
// it.
QHash<QString, UnmatchedPrelaunchInfo> m_unmatchedPrelaunchAppIds;
quint64 m_prelaunchAppIdGeneration = 0;
// Dock preview QML object
QObject *m_dockPreview = nullptr;
// Pending toplevel surfaces (XDG or XWayland) awaiting async AppId resolve; callbacks continue
// only if the pointer remains in this list
QList<WAYLIB_SERVER_NAMESPACE::WToplevelSurface *> m_pendingAppIdResolveToplevels;
// Accepted XDG initial maximize configurations waiting for asynchronous wrapper creation.
QHash<WAYLIB_SERVER_NAMESPACE::WXdgToplevelSurface *, QRectF>
m_pendingInitialXdgMaximizeGeometries;
// New protocol based app id resolver (optional, may be null if module not loaded)
AppIdResolverManager *m_appIdResolverManager = nullptr;
WindowConfigStore *m_windowConfigStore = nullptr;
Expand Down
Loading
Loading