-
Notifications
You must be signed in to change notification settings - Fork 77
feat(dock): support compositor-driven dock resize #1732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gugullll
wants to merge
1
commit into
linuxdeepin:master
Choose a base branch
from
gugullll:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. | ||
| // | ||
| // SPDX-License-Identifier: GPL-3.0-or-later | ||
|
|
||
| #include "layershellextension.h" | ||
|
|
||
| namespace dock | ||
| { | ||
|
|
||
| TreeLandLayerShellExtensionManager::TreeLandLayerShellExtensionManager() | ||
| : QWaylandClientExtensionTemplate<TreeLandLayerShellExtensionManager>(treeland_layer_shell_extension_manager_v1_interface.version) | ||
| { | ||
| } | ||
|
|
||
| struct ::treeland_layer_shell_extension_object_v1 *TreeLandLayerShellExtensionManager::getLayerShellExtensionObject(struct ::wl_surface *surface) | ||
| { | ||
| return get_layer_shell_extension_object(surface); | ||
| } | ||
|
|
||
| TreeLandLayerShellExtensionObject::TreeLandLayerShellExtensionObject(struct ::treeland_layer_shell_extension_object_v1 *surface, | ||
| struct ::wl_surface *nativeSurface) | ||
| : QWaylandClientExtensionTemplate<TreeLandLayerShellExtensionObject>(treeland_layer_shell_extension_object_v1_interface.version) | ||
| , m_nativeSurface(nativeSurface) | ||
| { | ||
| init(surface); | ||
| } | ||
|
|
||
| TreeLandLayerShellExtensionObject::~TreeLandLayerShellExtensionObject() | ||
| { | ||
| if (object()) { | ||
| destroy(); | ||
| } | ||
| } | ||
|
|
||
| struct ::wl_surface *TreeLandLayerShellExtensionObject::nativeSurface() const | ||
| { | ||
| return m_nativeSurface; | ||
| } | ||
|
|
||
| void TreeLandLayerShellExtensionObject::beginResize(struct ::wl_seat *seat, | ||
| uint32_t serial, | ||
| uint32_t edges, | ||
| int32_t minWidth, | ||
| int32_t minHeight, | ||
| int32_t maxWidth, | ||
| int32_t maxHeight) | ||
| { | ||
| begin_resize(seat, serial, edges, minWidth, minHeight, maxWidth, maxHeight); | ||
| } | ||
|
|
||
| void TreeLandLayerShellExtensionObject::treeland_layer_shell_extension_object_v1_resizing(uint32_t resizing) | ||
| { | ||
| Q_EMIT resizingChanged(resizing != 0); | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| // SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. | ||
| // | ||
| // SPDX-License-Identifier: GPL-3.0-or-later | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "qwayland-treeland-layer-shell-extension-unstable-v1.h" | ||
|
|
||
| #include <QtWaylandClient/QWaylandClientExtension> | ||
|
|
||
| #include <QObject> | ||
|
|
||
| namespace dock | ||
| { | ||
|
|
||
| // Client wrapper for the treeland_layer_shell_extension_manager_v1 protocol global. | ||
| // Lets the dock opt in to compositor-driven interactive resize: the compositor | ||
| // owns the drag state machine and drives the surface size through the standard | ||
| // layer-surface configure events (see treeland-layer-shell-extension-unstable-v1.xml). | ||
| class TreeLandLayerShellExtensionManager : public QWaylandClientExtensionTemplate<TreeLandLayerShellExtensionManager>, | ||
| public QtWayland::treeland_layer_shell_extension_manager_v1 | ||
| { | ||
| Q_OBJECT | ||
|
|
||
| public: | ||
| explicit TreeLandLayerShellExtensionManager(); | ||
|
|
||
| // Creates an interactive object for an existing wl_surface and returns the | ||
| // raw protocol object; the caller wraps it in a TreeLandLayerShellExtensionObject. | ||
| struct ::treeland_layer_shell_extension_object_v1 *getLayerShellExtensionObject(struct ::wl_surface *surface); | ||
| }; | ||
|
|
||
| // Client wrapper for the treeland_layer_shell_extension_object_v1 protocol object bound | ||
| // to the layer surface. This is the single entry point for every interactive | ||
| // operation on a treeland layer-shell surface (resize today, move later). | ||
| class TreeLandLayerShellExtensionObject : public QWaylandClientExtensionTemplate<TreeLandLayerShellExtensionObject>, | ||
| public QtWayland::treeland_layer_shell_extension_object_v1 | ||
| { | ||
| Q_OBJECT | ||
|
|
||
| public: | ||
| explicit TreeLandLayerShellExtensionObject(struct ::treeland_layer_shell_extension_object_v1 *surface, struct ::wl_surface *nativeSurface); | ||
| ~TreeLandLayerShellExtensionObject(); | ||
|
|
||
| void beginResize(struct ::wl_seat *seat, uint32_t serial, uint32_t edges, int32_t minWidth, int32_t minHeight, int32_t maxWidth, int32_t maxHeight); | ||
|
|
||
| // Returns the wl_surface this object was bound to. Does not validate | ||
| // lifetime; callers must compare it against the window's current surface | ||
| // and re-bind (a new object) when it changed, before issuing any request. | ||
| struct ::wl_surface *nativeSurface() const; | ||
|
|
||
| Q_SIGNALS: | ||
| void resizingChanged(bool resizing); | ||
|
|
||
| protected: | ||
| void treeland_layer_shell_extension_object_v1_resizing(uint32_t resizing) override; | ||
|
|
||
| private: | ||
| struct ::wl_surface *m_nativeSurface = nullptr; | ||
| }; | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.