feat: 增加窗口的UUID的信息
wayland下的拖动窗口实现分屏的功能需要UUID,在此处新增wayland的UUID的返回接口 Log: 增加窗口的返回的UUID信息 Influence: wayland下,拖动任务栏的图标查看是否支持分屏 Bug: https://pms.uniontech.com/bug-view-147657.html Change-Id: If97699b74707cbf3fe3395a65f72f8bd58de3894
This commit is contained in:
@ -422,6 +422,7 @@ void Entry::updateExportWindowInfos()
|
||||
XWindow xid = info->getXid();
|
||||
winInfo.title = info->getTitle();
|
||||
winInfo.attention = info->isDemandingAttention();
|
||||
winInfo.uuid = info->uuid();
|
||||
infos[xid] = winInfo;
|
||||
}
|
||||
|
||||
@ -431,7 +432,8 @@ void Entry::updateExportWindowInfos()
|
||||
for (auto iter = infos.begin(); iter != infos.end(); iter++) {
|
||||
XWindow xid = iter.key();
|
||||
if (infos[xid].title != m_exportWindowInfos[xid].title ||
|
||||
infos[xid].attention != m_exportWindowInfos[xid].attention) {
|
||||
infos[xid].attention != m_exportWindowInfos[xid].attention ||
|
||||
infos[xid].uuid != m_exportWindowInfos[xid].uuid) {
|
||||
changed = true;
|
||||
break;
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ public:
|
||||
virtual bool allowClose() = 0;
|
||||
virtual void update() = 0;
|
||||
virtual void killClient() = 0;
|
||||
virtual QString uuid() = 0;
|
||||
|
||||
XWindow getXid() {return xid;}
|
||||
void setEntry(Entry *value) {entry = value;}
|
||||
|
@ -28,12 +28,12 @@
|
||||
|
||||
WindowInfoK::WindowInfoK(PlasmaWindow *window, XWindow _xid)
|
||||
: WindowInfoBase ()
|
||||
, updateCalled(false)
|
||||
, internalId(0)
|
||||
, demaningAttention(false)
|
||||
, closeable(true)
|
||||
, minimized(true)
|
||||
, plasmaWindow(window)
|
||||
, m_updateCalled(false)
|
||||
, m_internalId(0)
|
||||
, m_demaningAttention(false)
|
||||
, m_closeable(true)
|
||||
, m_minimized(true)
|
||||
, m_plasmaWindow(window)
|
||||
{
|
||||
xid = _xid;
|
||||
createdTime = std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::system_clock::now().time_since_epoch()).count(); // 获取当前时间,精确到纳秒
|
||||
@ -46,23 +46,23 @@ WindowInfoK::~WindowInfoK()
|
||||
|
||||
bool WindowInfoK::shouldSkip()
|
||||
{
|
||||
if (!updateCalled) {
|
||||
if (!m_updateCalled) {
|
||||
update();
|
||||
updateCalled = true;
|
||||
m_updateCalled = true;
|
||||
}
|
||||
|
||||
bool skip = plasmaWindow->SkipTaskbar();
|
||||
bool skip = m_plasmaWindow->SkipTaskbar();
|
||||
|
||||
// 添加窗口能否最小化判断, 如果窗口不能最小化则隐藏任务栏图标
|
||||
bool canMinimize = false;
|
||||
canMinimize = plasmaWindow->IsMinimizeable();
|
||||
canMinimize = m_plasmaWindow->IsMinimizeable();
|
||||
if (!canMinimize)
|
||||
skip = true;
|
||||
|
||||
if (skip) {
|
||||
// 白名单, 过滤类似“欢迎应用”, 没有最小化窗口但是需要在任务栏显示图标
|
||||
QStringList list { "dde-introduction"};
|
||||
if (list.indexOf(appId) != -1)
|
||||
if (list.indexOf(m_appId) != -1)
|
||||
skip = false;
|
||||
}
|
||||
|
||||
@ -81,42 +81,42 @@ QString WindowInfoK::getTitle()
|
||||
|
||||
bool WindowInfoK::isDemandingAttention()
|
||||
{
|
||||
return demaningAttention;
|
||||
return m_demaningAttention;
|
||||
}
|
||||
|
||||
bool WindowInfoK::allowClose()
|
||||
{
|
||||
return closeable;
|
||||
return m_closeable;
|
||||
}
|
||||
|
||||
void WindowInfoK::close(uint32_t timestamp)
|
||||
{
|
||||
plasmaWindow->RequestClose();
|
||||
m_plasmaWindow->RequestClose();
|
||||
}
|
||||
|
||||
QString WindowInfoK::getAppId()
|
||||
{
|
||||
return appId;
|
||||
return m_appId;
|
||||
}
|
||||
|
||||
void WindowInfoK::setAppId(QString _appId)
|
||||
{
|
||||
appId = _appId;
|
||||
m_appId = _appId;
|
||||
}
|
||||
|
||||
void WindowInfoK::activate()
|
||||
{
|
||||
plasmaWindow->RequestActivate();
|
||||
m_plasmaWindow->RequestActivate();
|
||||
}
|
||||
|
||||
void WindowInfoK::minimize()
|
||||
{
|
||||
plasmaWindow->RequestToggleMinimized();
|
||||
m_plasmaWindow->RequestToggleMinimized();
|
||||
}
|
||||
|
||||
bool WindowInfoK::isMinimized()
|
||||
{
|
||||
return minimized;
|
||||
return m_minimized;
|
||||
}
|
||||
|
||||
bool WindowInfoK::changeXid(XWindow _xid)
|
||||
@ -127,52 +127,52 @@ bool WindowInfoK::changeXid(XWindow _xid)
|
||||
|
||||
PlasmaWindow *WindowInfoK::getPlasmaWindow()
|
||||
{
|
||||
return plasmaWindow;
|
||||
return m_plasmaWindow;
|
||||
}
|
||||
|
||||
bool WindowInfoK::updateGeometry()
|
||||
{
|
||||
DockRect rect = plasmaWindow->Geometry();
|
||||
if (geometry == rect)
|
||||
DockRect rect = m_plasmaWindow->Geometry();
|
||||
if (m_geometry == rect)
|
||||
return false;
|
||||
|
||||
geometry = rect;
|
||||
m_geometry = rect;
|
||||
return true;
|
||||
}
|
||||
|
||||
void WindowInfoK::updateTitle()
|
||||
{
|
||||
title = plasmaWindow->Title();
|
||||
title = m_plasmaWindow->Title();
|
||||
}
|
||||
|
||||
void WindowInfoK::updateDemandingAttention()
|
||||
{
|
||||
demaningAttention = plasmaWindow->IsDemandingAttention();
|
||||
m_demaningAttention = m_plasmaWindow->IsDemandingAttention();
|
||||
}
|
||||
|
||||
void WindowInfoK::updateIcon()
|
||||
{
|
||||
icon = plasmaWindow->Icon();
|
||||
icon = m_plasmaWindow->Icon();
|
||||
}
|
||||
|
||||
void WindowInfoK::updateAppId()
|
||||
{
|
||||
appId = plasmaWindow->AppId();
|
||||
m_appId = m_plasmaWindow->AppId();
|
||||
}
|
||||
|
||||
void WindowInfoK::updateInternalId()
|
||||
{
|
||||
internalId = plasmaWindow->InternalId();
|
||||
m_internalId = m_plasmaWindow->InternalId();
|
||||
}
|
||||
|
||||
void WindowInfoK::updateCloseable()
|
||||
{
|
||||
closeable = plasmaWindow->IsCloseable();
|
||||
m_closeable = m_plasmaWindow->IsCloseable();
|
||||
}
|
||||
|
||||
void WindowInfoK::updateProcessInfo()
|
||||
{
|
||||
pid = plasmaWindow->Pid();
|
||||
pid = m_plasmaWindow->Pid();
|
||||
processInfo = new ProcessInfo(pid);
|
||||
}
|
||||
|
||||
@ -182,7 +182,7 @@ void WindowInfoK::updateProcessInfo()
|
||||
*/
|
||||
DockRect WindowInfoK::getGeometry()
|
||||
{
|
||||
return geometry;
|
||||
return m_geometry;
|
||||
}
|
||||
|
||||
int64_t WindowInfoK::getCreatedTime()
|
||||
@ -217,3 +217,8 @@ void WindowInfoK::killClient()
|
||||
{
|
||||
}
|
||||
|
||||
QString WindowInfoK::uuid()
|
||||
{
|
||||
return QString(m_plasmaWindow->Uuid());
|
||||
}
|
||||
|
||||
|
@ -51,6 +51,7 @@ public:
|
||||
virtual QString getWindowType() override;
|
||||
virtual void update() override;
|
||||
virtual void killClient() override;
|
||||
virtual QString uuid() override;
|
||||
|
||||
QString getAppId();
|
||||
void setAppId(QString _appId);
|
||||
@ -67,14 +68,14 @@ public:
|
||||
DockRect getGeometry();
|
||||
|
||||
private:
|
||||
bool updateCalled;
|
||||
QString appId;
|
||||
uint32_t internalId;
|
||||
bool demaningAttention;
|
||||
bool closeable;
|
||||
bool minimized;
|
||||
PlasmaWindow *plasmaWindow;
|
||||
DockRect geometry;
|
||||
bool m_updateCalled;
|
||||
QString m_appId;
|
||||
uint32_t m_internalId;
|
||||
bool m_demaningAttention;
|
||||
bool m_closeable;
|
||||
bool m_minimized;
|
||||
PlasmaWindow *m_plasmaWindow;
|
||||
DockRect m_geometry;
|
||||
};
|
||||
|
||||
#endif // WINDOWINFOK_H
|
||||
|
@ -189,6 +189,11 @@ void WindowInfoX::killClient()
|
||||
XCB->killClientChecked(xid);
|
||||
}
|
||||
|
||||
QString WindowInfoX::uuid()
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
|
||||
QString WindowInfoX::getGtkAppId()
|
||||
{
|
||||
return gtkAppId;
|
||||
|
@ -50,6 +50,7 @@ public:
|
||||
virtual bool allowClose() override;
|
||||
virtual void update() override;
|
||||
virtual void killClient() override;
|
||||
virtual QString uuid() override;
|
||||
|
||||
QString genInnerId(WindowInfoX *winInfo);
|
||||
QString getGtkAppId();
|
||||
|
Reference in New Issue
Block a user