mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-05-30 22:01:41 +00:00

1. taskmanager used to identify which entry should map to window in x11 environmrnt, listen to xevent in anohter thread, and handle those event when window create, destory, changed. use some way to identify which entry(desktopfile) should mapped to changed window. in wayland, connected plsamawindow signal(window created destoried. 2. use taskmanager instead of dbus in old dock code log: as title
76 lines
2.3 KiB
C++
76 lines
2.3 KiB
C++
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
|
|
//
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#ifndef DBUSHANDLER_H
|
|
#define DBUSHANDLER_H
|
|
|
|
#include "com_deepin_wm.h"
|
|
#include "org_deepin_dde_wmswitcher1.h"
|
|
#include "org_deepin_dde_xeventmonitor1.h"
|
|
#include "org_deepin_dde_kwayland_windowmanager.h"
|
|
#include "org_deepin_dde_kwayland_plasmawindow.h"
|
|
|
|
#include "windowinfok.h"
|
|
|
|
#include <QObject>
|
|
#include <QDBusConnection>
|
|
#include <QDBusMessage>
|
|
|
|
class TaskManager;
|
|
|
|
// 处理DBus交互
|
|
class DBusHandler : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit DBusHandler(TaskManager *taskmanager, QObject *parent = nullptr);
|
|
|
|
/************************* KWayland/WindowManager ***************************/
|
|
void listenWaylandWMSignals();
|
|
void loadClientList();
|
|
|
|
bool wlShowingDesktop();
|
|
uint wlActiveWindow();
|
|
|
|
/************************* WMSwitcher ***************************/
|
|
QString getCurrentWM();
|
|
|
|
/************************* StartManager ***************************/
|
|
void launchApp(QString desktopFile, uint32_t timestamp, QStringList files);
|
|
void launchAppAction(QString desktopFile, QString action, uint32_t timestamp);
|
|
|
|
/************************* AlRecorder1 ***************************/
|
|
void markAppLaunched(const QString &filePath);
|
|
|
|
/************************* KWayland.PlasmaWindow ***************************/
|
|
void listenKWindowSignals(WindowInfoK *windowInfo);
|
|
void removePlasmaWindowHandler(PlasmaWindow *window);
|
|
|
|
PlasmaWindow *createPlasmaWindow(QString objPath);
|
|
|
|
/************************* WM ***************************/
|
|
void presentWindows(QList<uint> windows);
|
|
void previewWindow(uint xid);
|
|
void cancelPreviewWindow();
|
|
|
|
/************************* bamf ***************************/
|
|
// XWindow -> desktopFile
|
|
QString getDesktopFromWindowByBamf(XWindow windowId);
|
|
|
|
private Q_SLOTS:
|
|
void handleWlActiveWindowChange();
|
|
void onActiveWindowButtonRelease(int type, int x, int y, const QString &key);
|
|
|
|
private:
|
|
QString m_activeWindowMonitorKey;
|
|
TaskManager *m_taskmanager;
|
|
|
|
com::deepin::wm *m_wm;
|
|
org::deepin::dde::WMSwitcher1 *m_wmSwitcher;
|
|
org::deepin::dde::kwayland1::WindowManager *m_kwaylandManager;
|
|
org::deepin::dde::XEventMonitor1 *m_xEventMonitor;
|
|
};
|
|
|
|
#endif // DBUSHANDLER_H
|