2007-11-27 22:40:25 +03:00
|
|
|
/********************************************************************
|
2007-04-29 21:35:43 +04:00
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
|
2007-11-27 22:40:25 +03:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
#include "deleted.h"
|
|
|
|
|
|
|
|
#include "workspace.h"
|
|
|
|
#include "client.h"
|
Keep Deleted transients above old parents
Summary:
If a modal window is closed, usually, it will go behind its parent. The
reason for this is that Workspace::constrainedStackingOrder() puts only
AbstractClient transients above parents, not Deleted transients.
So, if fade/glide/scale effect animates the disappearing of a transient,
unfortunately, one can't see that animation.
BUG: 397448
FIXED-IN: 5.15.0
Test Plan:
=== Closing of a transient and parent window
Before:
https://www.youtube.com/watch?v=XiLq7EAVCp0
After:
https://www.youtube.com/watch?v=cH_Ki-sqY8M
=== Scale effect
Before:
https://www.youtube.com/watch?v=Eb2a3U7R10I
After:
https://www.youtube.com/watch?v=4AKu3fdrnYQ
=== Sheet effect
Before:
https://www.youtube.com/watch?v=xPPSnR5FUU0
After:
https://www.youtube.com/watch?v=o_hxTNT-5Hg
=== Popup menus on Wayland
Before:
https://www.youtube.com/watch?v=5DnrY8p3F5A
After:
https://www.youtube.com/watch?v=7XEo8n_CrCc
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: abetts, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14868
2018-10-15 16:04:05 +03:00
|
|
|
#include "group.h"
|
2013-04-26 12:41:24 +04:00
|
|
|
#include "netinfo.h"
|
2011-07-14 00:50:31 +04:00
|
|
|
#include "shadow.h"
|
Keep Deleted transients above old parents
Summary:
If a modal window is closed, usually, it will go behind its parent. The
reason for this is that Workspace::constrainedStackingOrder() puts only
AbstractClient transients above parents, not Deleted transients.
So, if fade/glide/scale effect animates the disappearing of a transient,
unfortunately, one can't see that animation.
BUG: 397448
FIXED-IN: 5.15.0
Test Plan:
=== Closing of a transient and parent window
Before:
https://www.youtube.com/watch?v=XiLq7EAVCp0
After:
https://www.youtube.com/watch?v=cH_Ki-sqY8M
=== Scale effect
Before:
https://www.youtube.com/watch?v=Eb2a3U7R10I
After:
https://www.youtube.com/watch?v=4AKu3fdrnYQ
=== Sheet effect
Before:
https://www.youtube.com/watch?v=xPPSnR5FUU0
After:
https://www.youtube.com/watch?v=o_hxTNT-5Hg
=== Popup menus on Wayland
Before:
https://www.youtube.com/watch?v=5DnrY8p3F5A
After:
https://www.youtube.com/watch?v=7XEo8n_CrCc
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: abetts, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14868
2018-10-15 16:04:05 +03:00
|
|
|
#include "shell_client.h"
|
2014-07-23 11:20:28 +04:00
|
|
|
#include "decorations/decoratedclient.h"
|
|
|
|
#include "decorations/decorationrenderer.h"
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2013-09-02 15:14:39 +04:00
|
|
|
#include <QDebug>
|
|
|
|
|
2007-04-29 21:35:43 +04:00
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2013-05-08 15:39:06 +04:00
|
|
|
Deleted::Deleted()
|
|
|
|
: Toplevel()
|
2011-01-30 17:34:42 +03:00
|
|
|
, delete_refcount(1)
|
2013-09-10 10:13:33 +04:00
|
|
|
, m_frame(XCB_WINDOW_NONE)
|
2011-01-30 17:34:42 +03:00
|
|
|
, no_border(true)
|
2012-04-07 18:43:27 +04:00
|
|
|
, m_layer(UnknownLayer)
|
2012-07-21 20:09:58 +04:00
|
|
|
, m_minimized(false)
|
2013-06-03 17:08:05 +04:00
|
|
|
, m_modal(false)
|
2013-06-24 02:13:08 +04:00
|
|
|
, m_wasClient(false)
|
2016-06-01 20:46:35 +03:00
|
|
|
, m_wasCurrentTab(true)
|
2014-07-23 11:20:28 +04:00
|
|
|
, m_decorationRenderer(nullptr)
|
2016-01-27 16:14:37 +03:00
|
|
|
, m_fullscreen(false)
|
2018-06-21 10:42:16 +03:00
|
|
|
, m_keepAbove(false)
|
|
|
|
, m_keepBelow(false)
|
Keep Deleted transients above old parents
Summary:
If a modal window is closed, usually, it will go behind its parent. The
reason for this is that Workspace::constrainedStackingOrder() puts only
AbstractClient transients above parents, not Deleted transients.
So, if fade/glide/scale effect animates the disappearing of a transient,
unfortunately, one can't see that animation.
BUG: 397448
FIXED-IN: 5.15.0
Test Plan:
=== Closing of a transient and parent window
Before:
https://www.youtube.com/watch?v=XiLq7EAVCp0
After:
https://www.youtube.com/watch?v=cH_Ki-sqY8M
=== Scale effect
Before:
https://www.youtube.com/watch?v=Eb2a3U7R10I
After:
https://www.youtube.com/watch?v=4AKu3fdrnYQ
=== Sheet effect
Before:
https://www.youtube.com/watch?v=xPPSnR5FUU0
After:
https://www.youtube.com/watch?v=o_hxTNT-5Hg
=== Popup menus on Wayland
Before:
https://www.youtube.com/watch?v=5DnrY8p3F5A
After:
https://www.youtube.com/watch?v=7XEo8n_CrCc
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: abetts, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14868
2018-10-15 16:04:05 +03:00
|
|
|
, m_wasActive(false)
|
|
|
|
, m_wasX11Client(false)
|
|
|
|
, m_wasWaylandClient(false)
|
|
|
|
, m_wasGroupTransient(false)
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
Deleted::~Deleted()
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
|
|
|
if (delete_refcount != 0)
|
2014-12-05 13:42:15 +03:00
|
|
|
qCCritical(KWIN_CORE) << "Deleted client has non-zero reference count (" << delete_refcount << ")";
|
2011-01-30 17:34:42 +03:00
|
|
|
assert(delete_refcount == 0);
|
2015-11-16 16:14:07 +03:00
|
|
|
if (workspace()) {
|
|
|
|
workspace()->removeDeleted(this);
|
|
|
|
}
|
Keep Deleted transients above old parents
Summary:
If a modal window is closed, usually, it will go behind its parent. The
reason for this is that Workspace::constrainedStackingOrder() puts only
AbstractClient transients above parents, not Deleted transients.
So, if fade/glide/scale effect animates the disappearing of a transient,
unfortunately, one can't see that animation.
BUG: 397448
FIXED-IN: 5.15.0
Test Plan:
=== Closing of a transient and parent window
Before:
https://www.youtube.com/watch?v=XiLq7EAVCp0
After:
https://www.youtube.com/watch?v=cH_Ki-sqY8M
=== Scale effect
Before:
https://www.youtube.com/watch?v=Eb2a3U7R10I
After:
https://www.youtube.com/watch?v=4AKu3fdrnYQ
=== Sheet effect
Before:
https://www.youtube.com/watch?v=xPPSnR5FUU0
After:
https://www.youtube.com/watch?v=o_hxTNT-5Hg
=== Popup menus on Wayland
Before:
https://www.youtube.com/watch?v=5DnrY8p3F5A
After:
https://www.youtube.com/watch?v=7XEo8n_CrCc
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: abetts, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14868
2018-10-15 16:04:05 +03:00
|
|
|
for (Toplevel *toplevel : qAsConst(m_transientFor)) {
|
|
|
|
if (auto *deleted = qobject_cast<Deleted *>(toplevel)) {
|
|
|
|
deleted->removeTransient(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (Deleted *transient : qAsConst(m_transients)) {
|
|
|
|
transient->removeTransientFor(this);
|
|
|
|
}
|
2008-05-21 02:01:49 +04:00
|
|
|
deleteEffectWindow();
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2011-01-30 17:34:42 +03:00
|
|
|
Deleted* Deleted::create(Toplevel* c)
|
|
|
|
{
|
2013-05-08 15:39:06 +04:00
|
|
|
Deleted* d = new Deleted();
|
2011-01-30 17:34:42 +03:00
|
|
|
d->copyToDeleted(c);
|
2013-05-08 15:39:06 +04:00
|
|
|
workspace()->addDeleted(d, c);
|
2007-04-29 21:35:43 +04:00
|
|
|
return d;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2008-07-28 15:49:43 +04:00
|
|
|
|
|
|
|
// to be used only from Workspace::finishCompositing()
|
2013-04-26 11:47:45 +04:00
|
|
|
void Deleted::discard()
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2008-07-28 15:49:43 +04:00
|
|
|
delete_refcount = 0;
|
|
|
|
delete this;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2011-01-30 17:34:42 +03:00
|
|
|
void Deleted::copyToDeleted(Toplevel* c)
|
|
|
|
{
|
|
|
|
assert(dynamic_cast< Deleted* >(c) == NULL);
|
|
|
|
Toplevel::copyToDeleted(c);
|
2007-04-29 21:35:43 +04:00
|
|
|
desk = c->desktop();
|
2010-05-12 00:30:20 +04:00
|
|
|
activityList = c->activities();
|
2011-01-30 17:34:42 +03:00
|
|
|
contentsRect = QRect(c->clientPos(), c->clientSize());
|
2015-12-08 12:11:26 +03:00
|
|
|
m_contentPos = c->clientContentPos();
|
2009-11-26 02:32:35 +03:00
|
|
|
transparent_rect = c->transparentRect();
|
2012-04-07 18:43:27 +04:00
|
|
|
m_layer = c->layer();
|
2013-09-10 10:13:33 +04:00
|
|
|
m_frame = c->frameId();
|
2015-03-04 09:56:51 +03:00
|
|
|
m_opacity = c->opacity();
|
2015-03-04 10:26:57 +03:00
|
|
|
m_type = c->windowType(true);
|
2015-03-04 10:53:51 +03:00
|
|
|
m_windowRole = c->windowRole();
|
2011-01-30 17:34:42 +03:00
|
|
|
if (WinInfo* cinfo = dynamic_cast< WinInfo* >(info))
|
2007-04-29 21:35:43 +04:00
|
|
|
cinfo->disable();
|
2015-12-03 19:34:00 +03:00
|
|
|
if (AbstractClient *client = dynamic_cast<AbstractClient*>(c)) {
|
2009-07-29 15:07:28 +04:00
|
|
|
no_border = client->noBorder();
|
2011-01-30 17:34:42 +03:00
|
|
|
if (!no_border) {
|
2015-12-03 19:34:00 +03:00
|
|
|
client->layoutDecorationRects(decoration_left,
|
|
|
|
decoration_top,
|
|
|
|
decoration_right,
|
|
|
|
decoration_bottom);
|
2014-10-21 09:46:44 +04:00
|
|
|
if (client->isDecorated()) {
|
|
|
|
if (Decoration::Renderer *renderer = client->decoratedClient()->renderer()) {
|
2014-07-23 11:20:28 +04:00
|
|
|
m_decorationRenderer = renderer;
|
|
|
|
m_decorationRenderer->reparent(this);
|
|
|
|
}
|
|
|
|
}
|
2009-07-29 15:07:28 +04:00
|
|
|
}
|
2015-09-14 10:06:41 +03:00
|
|
|
m_wasClient = true;
|
|
|
|
m_minimized = client->isMinimized();
|
|
|
|
m_modal = client->isModal();
|
2013-06-03 17:08:05 +04:00
|
|
|
m_mainClients = client->mainClients();
|
2015-09-11 16:55:23 +03:00
|
|
|
foreach (AbstractClient *c, m_mainClients) {
|
|
|
|
connect(c, &AbstractClient::windowClosed, this, &Deleted::mainClientClosed);
|
2013-06-03 17:08:05 +04:00
|
|
|
}
|
2016-01-27 16:14:37 +03:00
|
|
|
m_fullscreen = client->isFullScreen();
|
2016-06-01 20:46:35 +03:00
|
|
|
m_wasCurrentTab = client->isCurrentTab();
|
2018-06-21 10:42:16 +03:00
|
|
|
m_keepAbove = client->keepAbove();
|
|
|
|
m_keepBelow = client->keepBelow();
|
|
|
|
m_caption = client->caption();
|
Keep Deleted transients above old parents
Summary:
If a modal window is closed, usually, it will go behind its parent. The
reason for this is that Workspace::constrainedStackingOrder() puts only
AbstractClient transients above parents, not Deleted transients.
So, if fade/glide/scale effect animates the disappearing of a transient,
unfortunately, one can't see that animation.
BUG: 397448
FIXED-IN: 5.15.0
Test Plan:
=== Closing of a transient and parent window
Before:
https://www.youtube.com/watch?v=XiLq7EAVCp0
After:
https://www.youtube.com/watch?v=cH_Ki-sqY8M
=== Scale effect
Before:
https://www.youtube.com/watch?v=Eb2a3U7R10I
After:
https://www.youtube.com/watch?v=4AKu3fdrnYQ
=== Sheet effect
Before:
https://www.youtube.com/watch?v=xPPSnR5FUU0
After:
https://www.youtube.com/watch?v=o_hxTNT-5Hg
=== Popup menus on Wayland
Before:
https://www.youtube.com/watch?v=5DnrY8p3F5A
After:
https://www.youtube.com/watch?v=7XEo8n_CrCc
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: abetts, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14868
2018-10-15 16:04:05 +03:00
|
|
|
|
|
|
|
m_wasActive = client->isActive();
|
|
|
|
|
|
|
|
const auto *x11Client = qobject_cast<Client *>(client);
|
|
|
|
m_wasGroupTransient = x11Client && x11Client->groupTransient();
|
|
|
|
|
|
|
|
if (m_wasGroupTransient) {
|
|
|
|
const auto members = x11Client->group()->members();
|
|
|
|
for (Client *member : members) {
|
|
|
|
if (member != client) {
|
|
|
|
addTransientFor(member);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
AbstractClient *transientFor = client->transientFor();
|
|
|
|
if (transientFor != nullptr) {
|
|
|
|
addTransientFor(transientFor);
|
|
|
|
}
|
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
}
|
Keep Deleted transients above old parents
Summary:
If a modal window is closed, usually, it will go behind its parent. The
reason for this is that Workspace::constrainedStackingOrder() puts only
AbstractClient transients above parents, not Deleted transients.
So, if fade/glide/scale effect animates the disappearing of a transient,
unfortunately, one can't see that animation.
BUG: 397448
FIXED-IN: 5.15.0
Test Plan:
=== Closing of a transient and parent window
Before:
https://www.youtube.com/watch?v=XiLq7EAVCp0
After:
https://www.youtube.com/watch?v=cH_Ki-sqY8M
=== Scale effect
Before:
https://www.youtube.com/watch?v=Eb2a3U7R10I
After:
https://www.youtube.com/watch?v=4AKu3fdrnYQ
=== Sheet effect
Before:
https://www.youtube.com/watch?v=xPPSnR5FUU0
After:
https://www.youtube.com/watch?v=o_hxTNT-5Hg
=== Popup menus on Wayland
Before:
https://www.youtube.com/watch?v=5DnrY8p3F5A
After:
https://www.youtube.com/watch?v=7XEo8n_CrCc
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: abetts, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14868
2018-10-15 16:04:05 +03:00
|
|
|
|
|
|
|
m_wasWaylandClient = qobject_cast<ShellClient *>(c) != nullptr;
|
|
|
|
m_wasX11Client = !m_wasWaylandClient;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2013-05-31 21:15:51 +04:00
|
|
|
void Deleted::unrefWindow()
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
|
|
|
if (--delete_refcount > 0)
|
2007-04-29 21:35:43 +04:00
|
|
|
return;
|
2013-05-31 21:15:51 +04:00
|
|
|
// needs to be delayed
|
|
|
|
// a) when calling from effects, otherwise it'd be rather complicated to handle the case of the
|
|
|
|
// window going away during a painting pass
|
|
|
|
// b) to prevent dangeling pointers in the stacking order, see bug #317765
|
|
|
|
deleteLater();
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
|
|
|
int Deleted::desktop() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
return desk;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2010-05-12 00:30:20 +04:00
|
|
|
QStringList Deleted::activities() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2010-05-12 00:30:20 +04:00
|
|
|
return activityList;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2010-05-12 00:30:20 +04:00
|
|
|
|
2007-07-18 19:01:59 +04:00
|
|
|
QPoint Deleted::clientPos() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-07-18 19:01:59 +04:00
|
|
|
return contentsRect.topLeft();
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-07-18 19:01:59 +04:00
|
|
|
|
|
|
|
QSize Deleted::clientSize() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2007-07-18 19:01:59 +04:00
|
|
|
return contentsRect.size();
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-07-18 19:01:59 +04:00
|
|
|
|
2011-01-30 17:34:42 +03:00
|
|
|
void Deleted::debug(QDebug& stream) const
|
|
|
|
{
|
2007-04-29 21:35:43 +04:00
|
|
|
stream << "\'ID:" << window() << "\' (deleted)";
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2007-04-29 21:35:43 +04:00
|
|
|
|
2014-07-25 14:55:28 +04:00
|
|
|
void Deleted::layoutDecorationRects(QRect& left, QRect& top, QRect& right, QRect& bottom) const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2009-07-29 15:07:28 +04:00
|
|
|
left = decoration_left;
|
|
|
|
top = decoration_top;
|
|
|
|
right = decoration_right;
|
|
|
|
bottom = decoration_bottom;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2009-07-29 15:07:28 +04:00
|
|
|
|
|
|
|
QRect Deleted::decorationRect() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2014-07-23 11:20:28 +04:00
|
|
|
return rect();
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2009-07-29 15:07:28 +04:00
|
|
|
|
2009-11-26 02:32:35 +03:00
|
|
|
QRect Deleted::transparentRect() const
|
2011-01-30 17:34:42 +03:00
|
|
|
{
|
2009-11-26 02:32:35 +03:00
|
|
|
return transparent_rect;
|
2011-01-30 17:34:42 +03:00
|
|
|
}
|
2009-11-26 02:32:35 +03:00
|
|
|
|
2012-01-15 13:51:09 +04:00
|
|
|
bool Deleted::isDeleted() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-09-06 11:09:31 +04:00
|
|
|
NET::WindowType Deleted::windowType(bool direct, int supportedTypes) const
|
|
|
|
{
|
|
|
|
Q_UNUSED(direct)
|
2015-03-04 10:26:57 +03:00
|
|
|
Q_UNUSED(supportedTypes)
|
|
|
|
return m_type;
|
2012-09-06 11:09:31 +04:00
|
|
|
}
|
|
|
|
|
2013-06-03 17:08:05 +04:00
|
|
|
void Deleted::mainClientClosed(Toplevel *client)
|
|
|
|
{
|
2015-09-14 14:53:46 +03:00
|
|
|
if (AbstractClient *c = dynamic_cast<AbstractClient*>(client))
|
|
|
|
m_mainClients.removeAll(c);
|
2013-06-03 17:08:05 +04:00
|
|
|
}
|
|
|
|
|
Keep Deleted transients above old parents
Summary:
If a modal window is closed, usually, it will go behind its parent. The
reason for this is that Workspace::constrainedStackingOrder() puts only
AbstractClient transients above parents, not Deleted transients.
So, if fade/glide/scale effect animates the disappearing of a transient,
unfortunately, one can't see that animation.
BUG: 397448
FIXED-IN: 5.15.0
Test Plan:
=== Closing of a transient and parent window
Before:
https://www.youtube.com/watch?v=XiLq7EAVCp0
After:
https://www.youtube.com/watch?v=cH_Ki-sqY8M
=== Scale effect
Before:
https://www.youtube.com/watch?v=Eb2a3U7R10I
After:
https://www.youtube.com/watch?v=4AKu3fdrnYQ
=== Sheet effect
Before:
https://www.youtube.com/watch?v=xPPSnR5FUU0
After:
https://www.youtube.com/watch?v=o_hxTNT-5Hg
=== Popup menus on Wayland
Before:
https://www.youtube.com/watch?v=5DnrY8p3F5A
After:
https://www.youtube.com/watch?v=7XEo8n_CrCc
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: abetts, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14868
2018-10-15 16:04:05 +03:00
|
|
|
void Deleted::transientForClosed(Toplevel *toplevel, Deleted *deleted)
|
|
|
|
{
|
|
|
|
if (deleted == nullptr) {
|
|
|
|
m_transientFor.removeAll(toplevel);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const int index = m_transientFor.indexOf(toplevel);
|
|
|
|
if (index == -1) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_transientFor[index] = deleted;
|
|
|
|
deleted->addTransient(this);
|
|
|
|
}
|
|
|
|
|
2013-09-10 10:13:33 +04:00
|
|
|
xcb_window_t Deleted::frameId() const
|
|
|
|
{
|
|
|
|
return m_frame;
|
|
|
|
}
|
|
|
|
|
2015-03-04 09:56:51 +03:00
|
|
|
double Deleted::opacity() const
|
|
|
|
{
|
|
|
|
return m_opacity;
|
|
|
|
}
|
|
|
|
|
2015-03-04 10:53:51 +03:00
|
|
|
QByteArray Deleted::windowRole() const
|
|
|
|
{
|
|
|
|
return m_windowRole;
|
|
|
|
}
|
|
|
|
|
Keep Deleted transients above old parents
Summary:
If a modal window is closed, usually, it will go behind its parent. The
reason for this is that Workspace::constrainedStackingOrder() puts only
AbstractClient transients above parents, not Deleted transients.
So, if fade/glide/scale effect animates the disappearing of a transient,
unfortunately, one can't see that animation.
BUG: 397448
FIXED-IN: 5.15.0
Test Plan:
=== Closing of a transient and parent window
Before:
https://www.youtube.com/watch?v=XiLq7EAVCp0
After:
https://www.youtube.com/watch?v=cH_Ki-sqY8M
=== Scale effect
Before:
https://www.youtube.com/watch?v=Eb2a3U7R10I
After:
https://www.youtube.com/watch?v=4AKu3fdrnYQ
=== Sheet effect
Before:
https://www.youtube.com/watch?v=xPPSnR5FUU0
After:
https://www.youtube.com/watch?v=o_hxTNT-5Hg
=== Popup menus on Wayland
Before:
https://www.youtube.com/watch?v=5DnrY8p3F5A
After:
https://www.youtube.com/watch?v=7XEo8n_CrCc
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: abetts, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14868
2018-10-15 16:04:05 +03:00
|
|
|
void Deleted::addTransient(Deleted *transient)
|
|
|
|
{
|
|
|
|
m_transients.append(transient);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Deleted::removeTransient(Deleted *transient)
|
|
|
|
{
|
|
|
|
m_transients.removeAll(transient);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Deleted::addTransientFor(AbstractClient *parent)
|
|
|
|
{
|
|
|
|
m_transientFor.append(parent);
|
|
|
|
connect(parent, &AbstractClient::windowClosed, this, &Deleted::transientForClosed);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Deleted::removeTransientFor(Deleted *parent)
|
|
|
|
{
|
|
|
|
m_transientFor.removeAll(parent);
|
|
|
|
}
|
|
|
|
|
2007-04-29 21:35:43 +04:00
|
|
|
} // namespace
|
|
|
|
|