Commit 7446dacc authored by Sebastian Kügler's avatar Sebastian Kügler
Browse files

Update window timestamp before activating from dbusservice

This patch, conditionally on X11, updates the window's timestamp before
activating the window. This is needed for kwin to bring a unique app
window to the front when a second instance is started (which activates
the first one).

Partial fix for (needs small adaption in systemsettings as well):
CCBUG:332532

REVIEW:118019
parent a84e2b9d
......@@ -12,6 +12,7 @@ include(KDECMakeSettings)
set(REQUIRED_QT_VERSION 5.2.0)
find_package(Qt5DBus ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
find_package(Qt5X11Extras ${REQUIRED_QT_VERSION} NO_MODULE)
include(FeatureSummary)
include(GenerateExportHeader)
......@@ -29,6 +30,12 @@ ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KDBUSADDONS
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5DBusAddonsConfigVersion.cmake"
SOVERSION 5)
if(Qt5X11Extras_FOUND)
set(qtx11extras Qt5::X11Extras)
set(HAVE_X11 TRUE)
else()
set(HAVE_X11 FALSE)
endif()
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
......
......@@ -29,8 +29,7 @@ generate_export_header(KF5DBusAddons BASE_NAME KDBusAddons)
add_library(KF5::DBusAddons ALIAS KF5DBusAddons)
target_link_libraries(KF5DBusAddons PUBLIC Qt5::DBus)
target_link_libraries(KF5DBusAddons PUBLIC Qt5::DBus PRIVATE ${qtx11extras})
target_include_directories(KF5DBusAddons INTERFACE "$<INSTALL_INTERFACE:${KF5_INCLUDE_INSTALL_DIR}/KDBusAddons>")
......@@ -39,6 +38,8 @@ set_target_properties(KF5DBusAddons PROPERTIES VERSION ${KDBUSADDONS_VERSION_S
EXPORT_NAME DBusAddons
)
configure_file(config-kdbusaddons.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kdbusaddons.h )
ecm_generate_headers(KDBusAddons_HEADERS
HEADER_NAMES
KDBusConnectionPool
......
#cmakedefine01 HAVE_X11
\ No newline at end of file
......@@ -30,6 +30,12 @@
#include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusReply>
#include "config-kdbusaddons.h"
#if HAVE_X11
#include <QX11Info>
#endif
#include "kdbusservice_adaptor.h"
#include "kdbusserviceextensions_adaptor.h"
......@@ -167,6 +173,11 @@ void KDBusService::unregister()
void KDBusService::Activate(const QVariantMap &platform_data)
{
Q_UNUSED(platform_data);
#if HAVE_X11
if (QX11Info::isPlatformX11()) {
QX11Info::setAppTime(QX11Info::getTimestamp());
}
#endif
// TODO QX11Info::setNextStartupId(platform_data.value("desktop-startup-id"))
emit activateRequested(QStringList(), QString());
// TODO (via hook) KStartupInfo::appStarted(platform_data.value("desktop-startup-id"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment