Skip to content

Commit

Permalink
showdesktop ignore the setting keeping above client
Browse files Browse the repository at this point in the history
  • Loading branch information
kylin-ccn committed Aug 13, 2021
1 parent 8e4a53a commit 827437e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
31 changes: 18 additions & 13 deletions x11client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2136,7 +2136,7 @@ void X11Client::takeFocus()
// 最小化其它所有窗口
for (X11Client *c : workspace()->clientList()) {
//由skipTaskbar()改为c->skipTaskbar(), 对于图像查看器打开二级窗口打开图像是一个瞬态窗口(skipTaskbar),如果不忽略,则会被最小化,导致激活图像查看器后看不到打开图像窗口
if (this == c || c->isDock() || c->isDesktop() || c->skipTaskbar()) {
if (this == c || c->isDock() || c->isDesktop() || c->skipTaskbar() || c->keepAbove()) {
continue;
}
// 在进入到显示桌面模式后可能还有活跃的窗口,此时不要最小化,(如进入这个模式后才新建的窗口,新建窗口的那一瞬间其实也已聚焦会进入该函数)
Expand Down Expand Up @@ -2164,18 +2164,7 @@ void X11Client::takeFocus()
{
//当某窗口有瞬态窗口,但瞬态窗口不是该激活窗口时,除了该窗口需要最小化,其瞬态窗口也需最小化
//例子:当开启了带有关于二级窗口的文件管理器和终端,显示桌面后,激活终端时,才不会出现文件管理器窗口
if(c->transients().count() > 0)
{
for (auto it = c->transients().constBegin(); it != c->transients().constEnd(); ++it) {
X11Client* pTransients = qobject_cast<X11Client *>(*it);
if (!pTransients)
{
continue;
}
pTransients->minimize(true);
}
}
c->minimize(true);
closeSubTransientRecursively((AbstractClient *)c);
}
}
workspace()->setShowingDesktop(false);
Expand Down Expand Up @@ -2834,6 +2823,22 @@ QMatrix4x4 X11Client::inputTransformation() const
return matrix;
}

//ljlj
void X11Client::closeSubTransientRecursively(AbstractClient *c)
{
int cnt = c->transients().count();
if(cnt > 0) {
for (int i = 0; i < cnt; i++) {
AbstractClient *c1 = c->transients().at(i);
closeSubTransientRecursively(c1);
}
c->minimize(true);
} else {
c->minimize(true);
return;
}
}

Xcb::Property X11Client::fetchShowOnScreenEdge() const
{
return Xcb::Property(false, window(), atoms->kde_screen_edge_show, XCB_ATOM_CARDINAL, 0, 1);
Expand Down
1 change: 1 addition & 0 deletions x11client.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class UKUI_KWIN_EXPORT X11Client : public AbstractClient

QMatrix4x4 inputTransformation() const override;

void closeSubTransientRecursively(AbstractClient *c); //ljlj 递归关闭子瞬态窗口
bool isTransient() const override;
bool groupTransient() const override;
bool wasOriginallyGroupTransient() const;
Expand Down

0 comments on commit 827437e

Please sign in to comment.