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: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ find_package(QT NAMES ${QT_NS} REQUIRED COMPONENTS Core)
find_package(${QT_NS} REQUIRED COMPONENTS Core Gui Concurrent Qml Svg Quick QuickControls2 LinguistTools)
find_package(${DTK_NS} REQUIRED COMPONENTS Core Gui)
find_package(${ASQT_NS} 1.0 REQUIRED)
find_package(DDEShell REQUIRED)
find_package(ECM NO_MODULE)
if(Qt6_VERSION VERSION_GREATER_EQUAL 6.10)
find_package(Qt6 COMPONENTS GuiPrivate REQUIRED)
Expand Down Expand Up @@ -147,6 +148,7 @@ target_link_libraries(launchpadcommon PUBLIC
launcher-models
dde-integration-dbus
treeland-integration
Dde::Shell
)

if (HAVE_DDE_API_EVENTLOGGER)
Expand Down
3 changes: 1 addition & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Build-Depends:
qt6-tools-dev-tools,
qt6-wayland-dev,
qt6-wayland-private-dev,
wayland-protocols,
libdtkcommon-dev,
libdtk6core-dev (>= 6.0.43),
# v-- provides qdbusxml2cpp-fix binary
Expand All @@ -26,7 +25,7 @@ Build-Depends:
libdtk6gui-dev (>= 6.0.19),
libdtk6declarative-dev (>> 6.7.33),
dde-api-dev (>> 6.0.39),
libdde-shell-dev (>= 0.0.10),
libdde-shell-dev (>= 2.0.45),
libappstreamqt-dev (>= 1.0.0)
Standards-Version: 4.6.0
Rules-Requires-Root: no
Expand Down
35 changes: 9 additions & 26 deletions desktopintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@
#include <QRect>
#include <QGuiApplication>
#include <QLoggingCategory>
#include <appinfo.h>

Check warning on line 15 in desktopintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

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

Check warning on line 16 in desktopintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

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

#ifdef HAVE_WAYLAND_XDG_ACTIVATION
#include <xdgactivation.h>

Check warning on line 18 in desktopintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <xdgactivation.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <DGuiApplicationHelper>
#endif

#include <AppStreamQt/pool.h>

Check warning on line 20 in desktopintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

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

#include "appwiz.h"
#include "ddedock.h"
Expand Down Expand Up @@ -51,16 +48,15 @@
void DesktopIntegration::launchByDesktopId(const QString &desktopId)
{
qCInfo(logDesktopIntegration) << "Launching app by desktop ID:" << desktopId;
QString token;
#ifdef HAVE_WAYLAND_XDG_ACTIVATION
auto xdgActivation = DDEIntegration::XdgActivationV1::instance();
if (xdgActivation->isActive())
token = xdgActivation->requestToken(QGuiApplication::focusWindow(), desktopId);
#endif
if (!AppMgr::launchApp(desktopId, token)) {
qCDebug(logDesktopIntegration) << "AppMgr launch failed, trying AppInfo launch";
AppInfo::launchByDesktopId(desktopId);
}
auto *activation = new ds::XdgActivation(&instance());
connect(activation, &ds::XdgActivation::tokenReady, &instance(), [desktopId, activation](const QString &token) {
if (!AppMgr::launchApp(desktopId, token)) {
qCDebug(logDesktopIntegration) << "AppMgr launch failed, trying AppInfo launch";
AppInfo::launchByDesktopId(desktopId);
}
activation->deleteLater();
});
activation->requestToken();
}

QString DesktopIntegration::environmentVariable(const QString &env)
Expand Down Expand Up @@ -266,19 +262,6 @@
m_iconScaleFactor = dconfig->value("iconScaleFactor", 1.0).toReal();
qCInfo(logDesktopIntegration) << "Icon scale factor loaded:" << m_iconScaleFactor;

#ifdef HAVE_WAYLAND_XDG_ACTIVATION
if (DTK_GUI_NAMESPACE::DGuiApplicationHelper::testAttribute(
DTK_GUI_NAMESPACE::DGuiApplicationHelper::IsWaylandPlatform)) {
auto *xdgActivation = DDEIntegration::XdgActivationV1::instance();
connect(xdgActivation, &DDEIntegration::XdgActivationV1::activeChanged, this, []() {
if (DDEIntegration::XdgActivationV1::instance()->isActive())
qCInfo(logDesktopIntegration) << "XdgActivationV1: ready, XDG activation token support enabled";
else
qCWarning(logDesktopIntegration) << "XdgActivationV1: compositor did not advertise xdg_activation_v1, token requests will be skipped";
});
}
#endif

connect(m_dockIntegration, &DdeDock::directionChanged, this, &DesktopIntegration::dockPositionChanged);
connect(m_dockIntegration, &DdeDock::geometryChanged, this, &DesktopIntegration::dockGeometryChanged);
connect(m_appearanceIntegration, &Appearance::wallpaperBlurhashChanged, this, &DesktopIntegration::backgroundUrlChanged);
Expand Down
2 changes: 1 addition & 1 deletion shell-launcher-applet/package/launcheritem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ AppletItem {
}

function launchApp(desktopId) {
LauncherController.visible = false;
DesktopIntegration.launchByDesktopId(desktopId);
LauncherController.visible = false;
}

function assignFullscreenFrameScreen() {
Expand Down
52 changes: 0 additions & 52 deletions src/ddeintegration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,55 +150,3 @@ if (HAVE_DDE_API_EVENTLOGGER)
target_compile_definitions(dde-integration-dbus PRIVATE HAVE_DDE_API_EVENTLOGGER)
target_link_libraries(dde-integration-dbus PRIVATE DDEAPI::EventLogger)
endif()

# Optional Wayland XDG activation support: request a token from the compositor
# before launching applications so they can raise their window on first map.
# Requires Qt6WaylandClient and wayland-protocols (for xdg-activation-v1.xml).
find_package(Qt6 COMPONENTS WaylandClient QUIET)
find_package(PkgConfig QUIET)
if(Qt6WaylandClient_FOUND AND PkgConfig_FOUND)
pkg_check_modules(WaylandProtocols QUIET wayland-protocols)
if(WaylandProtocols_FOUND)
pkg_get_variable(WAYLAND_PROTOCOLS_DATADIR wayland-protocols pkgdatadir)
set(XDG_ACTIVATION_XML
"${WAYLAND_PROTOCOLS_DATADIR}/staging/xdg-activation/xdg-activation-v1.xml")
endif()
endif()

if(Qt6WaylandClient_FOUND AND DEFINED XDG_ACTIVATION_XML AND EXISTS "${XDG_ACTIVATION_XML}")
if(Qt6_VERSION VERSION_GREATER_EQUAL 6.10)
find_package(Qt6 COMPONENTS WaylandClientPrivate QUIET)
endif()

qt_generate_wayland_protocol_client_sources(dde-integration-dbus
FILES
${XDG_ACTIVATION_XML}
)

target_sources(dde-integration-dbus PRIVATE
xdgactivation.cpp
)

target_sources(dde-integration-dbus PUBLIC
FILE_SET HEADERS FILES xdgactivation.h
)

# The Wayland protocol generator emits headers into the binary dir;
# expose it publicly so consumers (e.g. launchpadcommon) can find them.
target_include_directories(dde-integration-dbus PUBLIC
${CMAKE_CURRENT_BINARY_DIR}
)

target_link_libraries(dde-integration-dbus PUBLIC
Qt6::WaylandClient
Qt6::WaylandClientPrivate
${DTK_NS}::Gui
)

target_compile_definitions(dde-integration-dbus PUBLIC
HAVE_WAYLAND_XDG_ACTIVATION
)
message(STATUS "XDG activation support enabled (${XDG_ACTIVATION_XML})")
else()
message(STATUS "XDG activation support disabled (Qt6WaylandClient or wayland-protocols not found)")
endif()
125 changes: 0 additions & 125 deletions src/ddeintegration/xdgactivation.cpp

This file was deleted.

53 changes: 0 additions & 53 deletions src/ddeintegration/xdgactivation.h

This file was deleted.

Loading