fix: 修复关闭单个应用的其中一个窗口,应用预览显示窗口异常的问题
关闭应用多个窗口中的一个,Dock1服务发送窗口信息变化信号通知前端调整界面显示 Log: 修复任务栏应用预览的问题 Task: https://pms.uniontech.com/task-view-152903.html Influence: 任务栏应用预览正常 Change-Id: I3be3b4d40c77433ac21a64df49f1e4f913a4d0fd
This commit is contained in:
parent
e557f374c5
commit
67783180ec
@ -1274,15 +1274,6 @@ void Dock::markAppLaunched(AppInfo *appInfo)
|
|||||||
dbusHandler->markAppLaunched(desktopFile);
|
dbusHandler->markAppLaunched(desktopFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Dock::deleteWindow 删除窗口 TODO 检查必要性
|
|
||||||
* @param xid
|
|
||||||
*/
|
|
||||||
void Dock::deleteWindow(XWindow xid)
|
|
||||||
{
|
|
||||||
entries->deleteWindow(xid);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Dock::getForceQuitAppStatus 获取强制关闭应用状态
|
* @brief Dock::getForceQuitAppStatus 获取强制关闭应用状态
|
||||||
* @return
|
* @return
|
||||||
|
@ -81,7 +81,6 @@ public:
|
|||||||
|
|
||||||
AppInfo *identifyWindow(WindowInfoBase *winInfo, QString &innerId);
|
AppInfo *identifyWindow(WindowInfoBase *winInfo, QString &innerId);
|
||||||
void markAppLaunched(AppInfo *appInfo);
|
void markAppLaunched(AppInfo *appInfo);
|
||||||
void deleteWindow(XWindow xid);
|
|
||||||
|
|
||||||
ForceQuitAppMode getForceQuitAppStatus();
|
ForceQuitAppMode getForceQuitAppStatus();
|
||||||
QVector<QString> getWinIconPreferredApps();
|
QVector<QString> getWinIconPreferredApps();
|
||||||
|
@ -188,16 +188,6 @@ void Entries::handleActiveWindowChanged(XWindow activeWindId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Entries::deleteWindow(XWindow xid)
|
|
||||||
{
|
|
||||||
for (auto entry : items) {
|
|
||||||
if (entry->containsWindow(xid)) {
|
|
||||||
entry->deleteWindow(xid);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Entries::updateEntriesMenu()
|
void Entries::updateEntriesMenu()
|
||||||
{
|
{
|
||||||
for (auto entry : items) {
|
for (auto entry : items) {
|
||||||
|
@ -47,7 +47,6 @@ public:
|
|||||||
Entry *getDockedEntryByDesktopFile(const QString &desktopFile);
|
Entry *getDockedEntryByDesktopFile(const QString &desktopFile);
|
||||||
QString queryWindowIdentifyMethod(XWindow windowId);
|
QString queryWindowIdentifyMethod(XWindow windowId);
|
||||||
void handleActiveWindowChanged(XWindow activeWindId);
|
void handleActiveWindowChanged(XWindow activeWindId);
|
||||||
void deleteWindow(XWindow xid);
|
|
||||||
void updateEntriesMenu();
|
void updateEntriesMenu();
|
||||||
void insertCb(Entry *entry, int index);
|
void insertCb(Entry *entry, int index);
|
||||||
void removeCb(Entry *entry);
|
void removeCb(Entry *entry);
|
||||||
|
@ -439,6 +439,7 @@ void Entry::updateExportWindowInfos()
|
|||||||
Q_EMIT windowInfosChanged(infos);
|
Q_EMIT windowInfosChanged(infos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新导出的窗口信息
|
||||||
exportWindowInfos = infos;
|
exportWindowInfos = infos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -447,7 +448,11 @@ bool Entry::detachWindow(WindowInfoBase *info)
|
|||||||
{
|
{
|
||||||
info->setEntry(nullptr);
|
info->setEntry(nullptr);
|
||||||
XWindow winId = info->getXid();
|
XWindow winId = info->getXid();
|
||||||
deleteWindow(winId);
|
if (windowInfoMap.contains(winId)) {
|
||||||
|
WindowInfoBase *info = windowInfoMap[winId];
|
||||||
|
windowInfoMap.remove(winId);
|
||||||
|
delete info;
|
||||||
|
}
|
||||||
|
|
||||||
if (windowInfoMap.isEmpty()) {
|
if (windowInfoMap.isEmpty()) {
|
||||||
if (!isDocked) {
|
if (!isDocked) {
|
||||||
@ -509,16 +514,6 @@ bool Entry::containsWindow(XWindow xid)
|
|||||||
return windowInfoMap.find(xid) != windowInfoMap.end();
|
return windowInfoMap.find(xid) != windowInfoMap.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Entry::deleteWindow(XWindow xid)
|
|
||||||
{
|
|
||||||
if (windowInfoMap.contains(xid)) {
|
|
||||||
WindowInfoBase *info = windowInfoMap[xid];
|
|
||||||
windowInfoMap.remove(xid);
|
|
||||||
exportWindowInfos.remove(xid);
|
|
||||||
delete info;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理菜单项
|
// 处理菜单项
|
||||||
void Entry::handleMenuItem(uint32_t timestamp, QString itemId)
|
void Entry::handleMenuItem(uint32_t timestamp, QString itemId)
|
||||||
{
|
{
|
||||||
@ -639,7 +634,7 @@ void Entry::active(uint32_t timestamp)
|
|||||||
dock->doActiveWindow(xid);
|
dock->doActiveWindow(xid);
|
||||||
} else {
|
} else {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
bool hiddenAtom = XCB->getAtom("_NET_WM_STATE_HIDDEN");
|
XWindow hiddenAtom = XCB->getAtom("_NET_WM_STATE_HIDDEN");
|
||||||
for (auto state : XCB->getWMState(xid)) {
|
for (auto state : XCB->getWMState(xid)) {
|
||||||
if (hiddenAtom == state) {
|
if (hiddenAtom == state) {
|
||||||
found = true;
|
found = true;
|
||||||
|
@ -76,7 +76,6 @@ public:
|
|||||||
bool attachWindow(WindowInfoBase *info);
|
bool attachWindow(WindowInfoBase *info);
|
||||||
void launchApp(uint32_t timestamp);
|
void launchApp(uint32_t timestamp);
|
||||||
bool containsWindow(XWindow xid);
|
bool containsWindow(XWindow xid);
|
||||||
void deleteWindow(XWindow xid);
|
|
||||||
|
|
||||||
void handleMenuItem(uint32_t timestamp, QString itemId);
|
void handleMenuItem(uint32_t timestamp, QString itemId);
|
||||||
void handleDragDrop(uint32_t timestamp, QStringList files);
|
void handleDragDrop(uint32_t timestamp, QStringList files);
|
||||||
|
Loading…
Reference in New Issue
Block a user