Skip to content
Open
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
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Build-Depends:
qt6-wayland-dev-tools,
qt6-wayland-private-dev,
systemd,
treeland-protocols (>> 0.5.9),
treeland-protocols (>= 0.6.0),
wayland-protocols,
Standards-Version: 4.6.2
Homepage: https://github.com/linuxdeepin/dde-shell
Expand Down
3 changes: 2 additions & 1 deletion panels/dock/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ configure_file(environments.h.in environments.h @ONLY)
find_package(PkgConfig REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} COMPONENTS Core DBus Gui Qml WaylandCompositor Widgets WaylandClient)
find_package(DdeTrayLoader REQUIRED)
find_package(TreelandProtocols REQUIRED)
find_package(TreelandProtocols 0.6.0 REQUIRED)
pkg_check_modules(WaylandClient REQUIRED IMPORTED_TARGET wayland-client)

file(
Expand Down Expand Up @@ -64,6 +64,7 @@ qt_generate_wayland_protocol_client_sources(dockpanel
FILES
${TREELAND_PROTOCOLS_DATA_DIR}/treeland-wallpaper-color-v1.xml
${TREELAND_PROTOCOLS_DATA_DIR}/treeland-dde-shell-v1.xml
${TREELAND_PROTOCOLS_DATA_DIR}/treeland-xwindow-control-unstable-v1.xml
)

target_link_libraries(dockpanel PRIVATE
Expand Down
20 changes: 14 additions & 6 deletions panels/dock/waylanddockhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
#include "constants.h"
#include "dockhelper.h"
#include "dockpanel.h"
#include "layershell/dlayershellwindow.h"

Check warning on line 10 in panels/dock/waylanddockhelper.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "layershell/dlayershellwindow.h" not found.
#include "qwayland-treeland-dde-shell-v1.h"

Check warning on line 11 in panels/dock/waylanddockhelper.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "qwayland-treeland-dde-shell-v1.h" not found.
#include "qwayland-treeland-xwindow-control-unstable-v1.h"

Check warning on line 12 in panels/dock/waylanddockhelper.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "qwayland-treeland-xwindow-control-unstable-v1.h" not found.
#include "wayland-treeland-dde-shell-v1-client-protocol.h"

Check warning on line 13 in panels/dock/waylanddockhelper.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "wayland-treeland-dde-shell-v1-client-protocol.h" not found.
#include "wayland-treeland-xwindow-control-unstable-v1-client-protocol.h"

Check warning on line 14 in panels/dock/waylanddockhelper.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "wayland-treeland-xwindow-control-unstable-v1-client-protocol.h" not found.

#include <QtWaylandClient/private/qwaylandscreen_p.h>

Check warning on line 16 in panels/dock/waylanddockhelper.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtWaylandClient/private/qwaylandscreen_p.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtWaylandClient/private/qwaylandsurface_p.h>

Check warning on line 17 in panels/dock/waylanddockhelper.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtWaylandClient/private/qwaylandsurface_p.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtWaylandClient/private/qwaylandwindow_p.h>

namespace dock {
Expand All @@ -23,6 +25,7 @@
, m_panel(panel)
{
m_ddeShellManager.reset(new TreeLandDDEShellManager());
m_xwindowControl.reset(new TreeLandXWindowControl());
DS_NAMESPACE::DAppletBridge bridge("org.deepin.ds.dock.taskmanager");
if (auto applet = bridge.applet()) {
connect(applet, SIGNAL(windowFullscreenChanged(bool)), this, SLOT(setCurrentActiveWindowFullscreened(bool)));
Expand Down Expand Up @@ -177,14 +180,14 @@
}
}

if (!m_ddeShellManager || !m_ddeShellManager->isActive() || !anchorSurface) {
qWarning() << "WaylandDockHelper::moveXEmbedWindow: not ready, manager active:"
<< (m_ddeShellManager && m_ddeShellManager->isActive())
if (!m_xwindowControl || !m_xwindowControl->isActive() || !anchorSurface) {
qWarning() << "WaylandDockHelper::moveXEmbedWindow: not ready, xwindow control active:"
<< (m_xwindowControl && m_xwindowControl->isActive())
<< "surface:" << (anchorSurface != nullptr);
return false;
}

struct wl_callback *cb = m_ddeShellManager->setXWindowPositionRelative(wid, anchorSurface, dx, dy);
struct wl_callback *cb = m_xwindowControl->setXWindowPositionRelative(wid, anchorSurface, dx, dy);

// Register wl_callback listener — result arrives asynchronously
if (!cb) {
Expand Down Expand Up @@ -233,12 +236,17 @@
{
}

struct ::wl_callback *TreeLandDDEShellManager::setXWindowPositionRelative(uint32_t wid, struct ::wl_surface *anchor, double dx, double dy)
TreeLandXWindowControl::TreeLandXWindowControl()
: QWaylandClientExtensionTemplate<TreeLandXWindowControl>(treeland_xwindow_control_v1_interface.version)
{
}

struct ::wl_callback *TreeLandXWindowControl::setXWindowPositionRelative(uint32_t wid, struct ::wl_surface *anchor, double dx, double dy)
{
if (!isActive()) {
return nullptr;
}
return QtWayland::treeland_dde_shell_manager_v1::set_xwindow_position_relative(wid, anchor, wl_fixed_from_double(dx), wl_fixed_from_double(dy));
return QtWayland::treeland_xwindow_control_v1::set_xwindow_position_relative(wid, anchor, wl_fixed_from_double(dx), wl_fixed_from_double(dy));
}

TreeLandWindowOverlapChecker::TreeLandWindowOverlapChecker(WaylandDockHelper *helper, struct ::treeland_window_overlap_checker *checker)
Expand Down
15 changes: 12 additions & 3 deletions panels/dock/waylanddockhelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
#include "dockhelper.h"
#include "dockpanel.h"

#include "qwayland-treeland-dde-shell-v1.h"

Check warning on line 10 in panels/dock/waylanddockhelper.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "qwayland-treeland-dde-shell-v1.h" not found.
#include "qwayland-treeland-wallpaper-color-v1.h"

Check warning on line 11 in panels/dock/waylanddockhelper.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "qwayland-treeland-wallpaper-color-v1.h" not found.
#include "qwayland-treeland-xwindow-control-unstable-v1.h"

Check warning on line 12 in panels/dock/waylanddockhelper.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "qwayland-treeland-xwindow-control-unstable-v1.h" not found.
#include <QWidget>

#include <QtWaylandClient/QWaylandClientExtension>
Expand All @@ -19,6 +20,7 @@
class WallpaperColorManager;
class TreeLandDockTriggerArea;
class TreeLandDDEShellManager;
class TreeLandXWindowControl;
class TreeLandWindowOverlapChecker;

class WaylandDockHelper : public DockHelper
Expand Down Expand Up @@ -61,6 +63,7 @@
QScopedPointer<WallpaperColorManager> m_wallpaperColorManager;
QScopedPointer<TreeLandWindowOverlapChecker> m_overlapChecker;
QScopedPointer<TreeLandDDEShellManager> m_ddeShellManager;
QScopedPointer<TreeLandXWindowControl> m_xwindowControl;
struct ::wl_surface *m_dockWlSurface = nullptr; // Dock's wl_surface for XEmbed positioning
};

Expand All @@ -86,9 +89,15 @@

public:
explicit TreeLandDDEShellManager();

// Move XEmbed window to position relative to anchor surface
// Returns wl_callback* or nullptr if not active
};

class TreeLandXWindowControl : public QWaylandClientExtensionTemplate<TreeLandXWindowControl>, public QtWayland::treeland_xwindow_control_v1
{
Q_OBJECT

public:
explicit TreeLandXWindowControl();

struct ::wl_callback *setXWindowPositionRelative(uint32_t wid, struct ::wl_surface *anchor, double dx, double dy);
};

Expand Down
Loading