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
12 changes: 10 additions & 2 deletions plugins/application-tray/xembedprotocolhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
#include "fdoselectionmanager.h"

#include "util.h"
#include "plugin.h"

Check warning on line 11 in plugins/application-tray/xembedprotocolhandler.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "plugin.h" not found.

#include <QBitmap>

Check warning on line 13 in plugins/application-tray/xembedprotocolhandler.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

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

Check warning on line 14 in plugins/application-tray/xembedprotocolhandler.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QWindow> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QMouseEvent>
#include <QGuiApplication>
#include <DWindowManagerHelper>
Expand Down Expand Up @@ -300,8 +301,15 @@
QPoint XembedProtocolHandler::updateEmbedWindowPosForGetInputEvent()
{
// update pos
QPoint p = UTIL->getMousePos();
UTIL->moveX11Window(m_containerWid, p.x(), p.y());
if (qgetenv("XDG_SESSION_TYPE") == "wayland") {
// Get `plugin_id` and `item_key` from EmbedPlugin.
auto plugin = Plugin::EmbedPlugin::get(window()->windowHandle());
// use move_xembed_window to move m_containerWid to plugin_id.
// TODO: ...?
} else {
QPoint p = UTIL->getMousePos();
UTIL->moveX11Window(m_containerWid, p.x(), p.y());
}

// make window normal and above for get input
UTIL->setX11WindowInputShape(m_containerWid, QSize(1, 1));
Expand Down
11 changes: 11 additions & 0 deletions src/protocol/plugin-manager-v1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@
<arg name="surface" type="object" interface="wl_surface"/>
<arg name="id" type="new_id" interface="plugin"/>
</request>

<request name="move_xembed_window">
<description summary="request move xembed window to position">
This requests dde-shell to forward a request to the compositor (treeland) to move a xembed window to position.
dde-shell knows the xembed window's relative position, and then can request treeland to move the window to an absolute position based on a relative position.
</description>
<arg name="xembed_winid" type="int"/>
<arg name="plugin_id" type="string"/>
<arg name="item_key" type="string"/>
<arg name="callback" type="new_id" interface="wl_callback"/>
</request>
</interface>
<interface name="plugin_popup" version="1">
<request name="destroy" type="destructor">
Expand Down
3 changes: 2 additions & 1 deletion src/tray-wayland-integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ add_library(dockpluginmanager SHARED
)

qt_generate_wayland_protocol_client_sources(dockpluginmanager
FILES
NO_INCLUDE_CORE_ONLY
FILES
${CMAKE_CURRENT_SOURCE_DIR}/../protocol/plugin-manager-v1.xml
)

Expand Down
7 changes: 7 additions & 0 deletions src/tray-wayland-integration/pluginmanagerintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@
request_message(plugin_id, item_key, msg);
}

struct ::wl_callback *PluginManagerIntegration::moveXembedWindow(uint32_t xembedWinId, const QString &pluginId, const QString &itemKey)

Check warning on line 51 in src/tray-wayland-integration/pluginmanagerintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'moveXembedWindow' is never used.
{
auto callback = move_xembed_window(xembedWinId, pluginId, itemKey);
return callback;
}

void PluginManagerIntegration::plugin_manager_v1_position_changed(uint32_t dock_position)

Check warning on line 57 in src/tray-wayland-integration/pluginmanagerintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'plugin_manager_v1_position_changed' is never used.
{
if (dock_position != m_dockPosition) {
m_dockPosition = dock_position;
Expand Down Expand Up @@ -122,4 +128,5 @@

return false;
}

}
4 changes: 4 additions & 0 deletions src/tray-wayland-integration/pluginmanagerintegration_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

#pragma once

#include "qwayland-plugin-manager-v1.h"

Check warning on line 7 in src/tray-wayland-integration/pluginmanagerintegration_p.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "qwayland-plugin-manager-v1.h" not found.
#include <wayland-client-protocol.h>

Check warning on line 8 in src/tray-wayland-integration/pluginmanagerintegration_p.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <wayland-client-protocol.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <QtWaylandClient/private/qwaylandshellintegration_p.h>

Check warning on line 10 in src/tray-wayland-integration/pluginmanagerintegration_p.h

View workflow job for this annotation

GitHub Actions / cppcheck

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

namespace Plugin {
class PluginManagerIntegration : public QtWaylandClient::QWaylandShellIntegrationTemplate<PluginManagerIntegration>, public QtWayland::plugin_manager_v1
Expand All @@ -20,6 +21,7 @@

public:
void requestMessage(const QString &plugin_id, const QString &item_key, const QString &msg);
struct ::wl_callback *moveXembedWindow(uint32_t xembedWinId, const QString &pluginId, const QString &itemKey);

Q_SIGNALS:
void eventMessage(const QString &msg);
Expand All @@ -40,5 +42,7 @@
private:
uint32_t m_dockPosition;
uint32_t m_dockColorType;
static PluginManagerIntegration *s_instance;
};

}