Skip to content

Commit

Permalink
window list changed skip self
Browse files Browse the repository at this point in the history
  • Loading branch information
justforlxz committed Mar 23, 2018
1 parent 7271abb commit d7ea9ac
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions frame/mainframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ void MainFrame::screenChanged()
resize(screen.width(), TOPHEIGHT);
move(screen.x(), screen.y() - TOPHEIGHT);
m_mainPanel->move(0, 0);
move(0, 0);

xcb_ewmh_connection_t m_ewmh_connection;
xcb_intern_atom_cookie_t *cookie = xcb_ewmh_init_atoms(QX11Info::connection(), &m_ewmh_connection);
Expand Down Expand Up @@ -161,21 +160,25 @@ void MainFrame::onWindowListChanged()
QList<WId> newList;
// create new DForeignWindow
for (WId wid : reinterpret_cast<QVector<quint32>(*)()>(wmClientList)()) {
if (wid == this->topLevelWidget()->internalWinId()) {
continue;
}

newList << wid;

if (!m_windowList.keys().contains(wid)) {
DForeignWindow *w = DForeignWindow::fromWinId(wid);
if (!w) {
continue;
}

#ifdef QT_DEBUG
if (w->wmClass() != "deepin-topbar") {
connect(w, &DForeignWindow::windowStateChanged, this, &MainFrame::onWindowStateChanged);
}
connect(w, &DForeignWindow::windowStateChanged, this, &MainFrame::onWindowStateChanged);
w->windowStateChanged(w->windowState());
#else
w->windowStateChanged(Qt::WindowNoState);
#endif

m_windowList[wid] = w;
m_windowIdList << wid;
}
Expand Down

0 comments on commit d7ea9ac

Please sign in to comment.