mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00

原来的逻辑为在应用没有打开窗口的时候,需要自动打开一个窗口然后来触发分屏的操作; 根据和产品详细讨论,现该逻辑改为:在应用没有打开窗口的时候,无需触发分屏 Log: Influence: 从任务栏拖动一个没有打开窗口的应用,观察是否打开应用(正常情况下不会打开应用),释放鼠标,观察应用图标是否回到任务栏上 Bug: https://pms.uniontech.com/bug-view-154349.html Change-Id: I6d07097a85912caf15ce63952d6b84225b3aeaad
97 lines
2.4 KiB
C++
97 lines
2.4 KiB
C++
/*
|
|
* Copyright (C) 2022 ~ 2022 Deepin Technology Co., Ltd.
|
|
*
|
|
* Author: donghualin <donghualin@uniontech.com>
|
|
*
|
|
* Maintainer: donghualin <donghualin@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 SCREENSPLITER_WAYLAND_H
|
|
#define SCREENSPLITER_WAYLAND_H
|
|
|
|
#include "screenspliter.h"
|
|
|
|
#include <QWidget>
|
|
|
|
namespace KWayland {
|
|
namespace Client {
|
|
class Registry;
|
|
class DDEShell;
|
|
class DDEShellSurface;
|
|
class EventQueue;
|
|
class Compositor;
|
|
class Surface;
|
|
class ClientManagement;
|
|
class ConnectionThread;
|
|
}
|
|
}
|
|
|
|
class AppItem;
|
|
class QWindow;
|
|
class QThread;
|
|
class SplitWindowManager;
|
|
|
|
class WindowInfo;
|
|
typedef QMap<quint32, WindowInfo> WindowInfoMap;
|
|
|
|
using namespace KWayland::Client;
|
|
|
|
class ScreenSpliter_Wayland : public ScreenSpliter
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ScreenSpliter_Wayland(AppItem *appItem, DockEntryInter *entryInter, QObject *parent);
|
|
~ScreenSpliter_Wayland() override;
|
|
|
|
void startSplit(const QRect &rect) override;
|
|
bool split(SplitDirection direction) override;
|
|
bool suportSplitScreen() override;
|
|
bool releaseSplit() override;
|
|
|
|
private:
|
|
void setMaskVisible(const QRect &rect, bool visible);
|
|
bool windowSupportSplit(const QString &uuid) const;
|
|
|
|
private:
|
|
static SplitWindowManager *m_splitManager;
|
|
QRect m_splitRect;
|
|
};
|
|
|
|
class SplitWindowManager : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
friend class ScreenSpliter_Wayland;
|
|
|
|
protected:
|
|
explicit SplitWindowManager(QObject *parent = Q_NULLPTR);
|
|
~SplitWindowManager() override;
|
|
|
|
bool canSplit(const QString &uuid) const;
|
|
void requestSplitWindow(const char *uuid, const ScreenSpliter::SplitDirection &direction);
|
|
|
|
private Q_SLOTS:
|
|
void onConnectionFinished();
|
|
|
|
private:
|
|
ClientManagement *m_clientManagement;
|
|
QThread *m_connectionThread;
|
|
ConnectionThread *m_connectionThreadObject;
|
|
QMap<QString, int> m_splitWindowState;
|
|
};
|
|
|
|
#endif // SCREENSPLITER_WAYLAND_H
|