1、wayland环境下根据窗口Id获取当前激活窗口错误,导致无法获取激活窗口 2、释放鼠标的时候没有触发激活窗口的判断函数,导致任务栏在拖动过程中释放鼠标后,没有发送是否隐藏信号 Log: 修复wayland下设置智能隐藏失败的问题 Influence: 进入wayland环境,任务栏设置智能隐藏,窗口拖动到任务栏下方,观察窗口是否隐藏,窗口移出任务栏,观察任务栏是否显示 Bug: https://pms.uniontech.com/bug-view-154513.html Change-Id: I4de3b4db019a664f184b0676bb8ce2a77d1d66a9
97 lines
3.1 KiB
C++
97 lines
3.1 KiB
C++
/*
|
|
* Copyright (C) 2021 ~ 2022 Deepin Technology Co., Ltd.
|
|
*
|
|
* Author: weizhixiang <weizhixiang@uniontech.com>
|
|
*
|
|
* Maintainer: weizhixiang <weizhixiang@uniontech.com>
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef DBUSHANDLER_H
|
|
#define DBUSHANDLER_H
|
|
|
|
#include "dbuslauncher.h"
|
|
#include "dbuslauncherfront.h"
|
|
#include "dbuswm.h"
|
|
#include "dbuswmswitcher.h"
|
|
#include "dbuskwaylandwindowmanager.h"
|
|
#include "windowinfok.h"
|
|
#include "dbusplasmawindow.h"
|
|
#include "dbusxeventmonitor.h"
|
|
|
|
#include <QObject>
|
|
#include <QDBusConnection>
|
|
#include <QDBusMessage>
|
|
|
|
class Dock;
|
|
|
|
// 处理DBus交互
|
|
class DBusHandler : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit DBusHandler(Dock *_dock, QObject *parent = nullptr);
|
|
|
|
/************************* KWayland/WindowManager ***************************/
|
|
void listenWaylandWMSignals();
|
|
void loadClientList();
|
|
bool wlShowingDesktop();
|
|
uint wlActiveWindow();
|
|
|
|
/************************* daemon.Launcher1 ***************************/
|
|
void handleLauncherItemChanged(const QString &status, LauncherItemInfo itemInfo, qlonglong categoryID);
|
|
|
|
/************************* 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);
|
|
PlasmaWindow *createPlasmaWindow(QString objPath);
|
|
void removePlasmaWindowHandler(PlasmaWindow *window);
|
|
|
|
/************************* WM ***************************/
|
|
void presentWindows(QList<uint> windows);
|
|
|
|
/************************* bamf ***************************/
|
|
// XWindow -> desktopFile
|
|
QString getDesktopFromWindowByBamf(XWindow windowId);
|
|
|
|
private Q_SLOTS:
|
|
void handleWlActiveWindowChange();
|
|
void onActiveWindowButtonRelease(int type, int x, int y, const QString &key);
|
|
|
|
private:
|
|
Dock *m_dock;
|
|
QDBusConnection m_session;
|
|
|
|
LauncherBackEnd *m_launcherEnd;
|
|
LauncherFront *m_launcherFront;
|
|
com::deepin::WM *m_wm;
|
|
com::deepin::WMSwitcher *m_wmSwitcher;
|
|
com::deepin::daemon::kwayland::WindowManager *m_kwaylandManager;
|
|
|
|
org::deepin::api::XEventMonitor1 *m_xEventMonitor;
|
|
QString m_activeWindowMonitorKey;
|
|
};
|
|
|
|
#endif // DBUSHANDLER_H
|