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