2007-11-27 19:40:25 +00:00
|
|
|
/********************************************************************
|
2007-04-29 17:35:43 +00: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 19:40:25 +00: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 17:35:43 +00: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 13:04:05 +00:00
|
|
|
#include "group.h"
|
2013-04-26 08:41:24 +00:00
|
|
|
#include "netinfo.h"
|
2011-07-13 20:50:31 +00: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 13:04:05 +00:00
|
|
|
#include "shell_client.h"
|
2014-07-23 07:20:28 +00:00
|
|
|
#include "decorations/decoratedclient.h"
|
|
|
|
#include "decorations/decorationrenderer.h"
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2013-09-02 11:14:39 +00:00
|
|
|
#include <QDebug>
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2013-05-08 11:39:06 +00:00
|
|
|
Deleted::Deleted()
|
|
|
|
: Toplevel()
|
2011-01-30 14:34:42 +00:00
|
|
|
, delete_refcount(1)
|
2013-09-10 06:13:33 +00:00
|
|
|
, m_frame(XCB_WINDOW_NONE)
|
2011-01-30 14:34:42 +00:00
|
|
|
, no_border(true)
|
2012-04-07 14:43:27 +00:00
|
|
|
, m_layer(UnknownLayer)
|
2012-07-21 16:09:58 +00:00
|
|
|
, m_minimized(false)
|
2013-06-03 13:08:05 +00:00
|
|
|
, m_modal(false)
|
2013-06-23 22:13:08 +00:00
|
|
|
, m_wasClient(false)
|
2016-06-01 17:46:35 +00:00
|
|
|
, m_wasCurrentTab(true)
|
2014-07-23 07:20:28 +00:00
|
|
|
, m_decorationRenderer(nullptr)
|
2016-01-27 13:14:37 +00:00
|
|
|
, m_fullscreen(false)
|
2018-06-21 07:42:16 +00: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 13:04:05 +00:00
|
|
|
, m_wasActive(false)
|
|
|
|
, m_wasX11Client(false)
|
|
|
|
, m_wasWaylandClient(false)
|
|
|
|
, m_wasGroupTransient(false)
|
2018-11-12 10:47:36 +00:00
|
|
|
, m_wasPopupWindow(false)
|
2019-03-19 14:01:29 +00:00
|
|
|
, m_wasOutline(false)
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
Deleted::~Deleted()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
|
|
|
if (delete_refcount != 0)
|
2014-12-05 10:42:15 +00:00
|
|
|
qCCritical(KWIN_CORE) << "Deleted client has non-zero reference count (" << delete_refcount << ")";
|
2011-01-30 14:34:42 +00:00
|
|
|
assert(delete_refcount == 0);
|
2015-11-16 13:14:07 +00: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 13:04:05 +00: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-20 22:01:49 +00:00
|
|
|
deleteEffectWindow();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
Deleted* Deleted::create(Toplevel* c)
|
|
|
|
{
|
2013-05-08 11:39:06 +00:00
|
|
|
Deleted* d = new Deleted();
|
2011-01-30 14:34:42 +00:00
|
|
|
d->copyToDeleted(c);
|
2013-05-08 11:39:06 +00:00
|
|
|
workspace()->addDeleted(d, c);
|
2007-04-29 17:35:43 +00:00
|
|
|
return d;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2008-07-28 11:49:43 +00:00
|
|
|
|
|
|
|
// to be used only from Workspace::finishCompositing()
|
2013-04-26 07:47:45 +00:00
|
|
|
void Deleted::discard()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2008-07-28 11:49:43 +00:00
|
|
|
delete_refcount = 0;
|
|
|
|
delete this;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
void Deleted::copyToDeleted(Toplevel* c)
|
|
|
|
{
|
|
|
|
assert(dynamic_cast< Deleted* >(c) == NULL);
|
|
|
|
Toplevel::copyToDeleted(c);
|
2007-04-29 17:35:43 +00:00
|
|
|
desk = c->desktop();
|
[wayland] Use the new plasma virtual desktop protocol
Summary:
implement virtual desktop support for Wayland.
use the new virtual desktop protocol from D12820
The VirtualDesktopManager class needed some big change in order
to accomodate it, which is where most changes are.
Other than that, it's mostly connections to wire up
VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)
Depends on D12820
Other notable detail, is the client visibility updated to reflect the presence
of the client in the plasmavirtualdesktop.
(and the unSetDesktop concept)
Test Plan: used a bit a plasma session together with D12820, D13748 and D13746
Reviewers: #plasma, #kwin, graesslin, davidedmundson
Reviewed By: #plasma, #kwin, davidedmundson
Subscribers: hein, zzag, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D13887
2018-10-29 22:29:15 +00:00
|
|
|
m_desktops = c->desktops();
|
2010-05-11 20:30:20 +00:00
|
|
|
activityList = c->activities();
|
2011-01-30 14:34:42 +00:00
|
|
|
contentsRect = QRect(c->clientPos(), c->clientSize());
|
2015-12-08 09:11:26 +00:00
|
|
|
m_contentPos = c->clientContentPos();
|
2009-11-25 23:32:35 +00:00
|
|
|
transparent_rect = c->transparentRect();
|
2012-04-07 14:43:27 +00:00
|
|
|
m_layer = c->layer();
|
2013-09-10 06:13:33 +00:00
|
|
|
m_frame = c->frameId();
|
2015-03-04 06:56:51 +00:00
|
|
|
m_opacity = c->opacity();
|
2018-11-21 21:55:22 +00:00
|
|
|
m_type = c->windowType();
|
2015-03-04 07:53:51 +00:00
|
|
|
m_windowRole = c->windowRole();
|
2011-01-30 14:34:42 +00:00
|
|
|
if (WinInfo* cinfo = dynamic_cast< WinInfo* >(info))
|
2007-04-29 17:35:43 +00:00
|
|
|
cinfo->disable();
|
2015-12-03 16:34:00 +00:00
|
|
|
if (AbstractClient *client = dynamic_cast<AbstractClient*>(c)) {
|
2009-07-29 11:07:28 +00:00
|
|
|
no_border = client->noBorder();
|
2011-01-30 14:34:42 +00:00
|
|
|
if (!no_border) {
|
2015-12-03 16:34:00 +00:00
|
|
|
client->layoutDecorationRects(decoration_left,
|
|
|
|
decoration_top,
|
|
|
|
decoration_right,
|
|
|
|
decoration_bottom);
|
2014-10-21 05:46:44 +00:00
|
|
|
if (client->isDecorated()) {
|
|
|
|
if (Decoration::Renderer *renderer = client->decoratedClient()->renderer()) {
|
2014-07-23 07:20:28 +00:00
|
|
|
m_decorationRenderer = renderer;
|
|
|
|
m_decorationRenderer->reparent(this);
|
|
|
|
}
|
|
|
|
}
|
2009-07-29 11:07:28 +00:00
|
|
|
}
|
2015-09-14 07:06:41 +00:00
|
|
|
m_wasClient = true;
|
|
|
|
m_minimized = client->isMinimized();
|
|
|
|
m_modal = client->isModal();
|
2013-06-03 13:08:05 +00:00
|
|
|
m_mainClients = client->mainClients();
|
2015-09-11 13:55:23 +00:00
|
|
|
foreach (AbstractClient *c, m_mainClients) {
|
2018-11-01 11:10:48 +00:00
|
|
|
addTransientFor(c);
|
2015-09-11 13:55:23 +00:00
|
|
|
connect(c, &AbstractClient::windowClosed, this, &Deleted::mainClientClosed);
|
2013-06-03 13:08:05 +00:00
|
|
|
}
|
2016-01-27 13:14:37 +00:00
|
|
|
m_fullscreen = client->isFullScreen();
|
2016-06-01 17:46:35 +00:00
|
|
|
m_wasCurrentTab = client->isCurrentTab();
|
2018-06-21 07:42:16 +00: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 13:04:05 +00:00
|
|
|
|
|
|
|
m_wasActive = client->isActive();
|
|
|
|
|
2018-12-31 17:57:13 +00:00
|
|
|
m_wasGroupTransient = client->groupTransient();
|
2007-04-29 17:35:43 +00: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 13:04:05 +00:00
|
|
|
|
2019-01-10 17:32:40 +00:00
|
|
|
for (auto vd : m_desktops) {
|
|
|
|
connect(vd, &QObject::destroyed, this, [=] {
|
|
|
|
m_desktops.removeOne(vd);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
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 13:04:05 +00:00
|
|
|
m_wasWaylandClient = qobject_cast<ShellClient *>(c) != nullptr;
|
|
|
|
m_wasX11Client = !m_wasWaylandClient;
|
2018-11-12 10:47:36 +00:00
|
|
|
m_wasPopupWindow = c->isPopupWindow();
|
2019-03-19 14:01:29 +00:00
|
|
|
m_wasOutline = c->isOutline();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2013-05-31 17:15:51 +00:00
|
|
|
void Deleted::unrefWindow()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
|
|
|
if (--delete_refcount > 0)
|
2007-04-29 17:35:43 +00:00
|
|
|
return;
|
2013-05-31 17:15:51 +00: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 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
int Deleted::desktop() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
return desk;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2010-05-11 20:30:20 +00:00
|
|
|
QStringList Deleted::activities() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2010-05-11 20:30:20 +00:00
|
|
|
return activityList;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2010-05-11 20:30:20 +00:00
|
|
|
|
2018-11-07 16:22:41 +00:00
|
|
|
QVector<VirtualDesktop *> Deleted::desktops() const
|
[wayland] Use the new plasma virtual desktop protocol
Summary:
implement virtual desktop support for Wayland.
use the new virtual desktop protocol from D12820
The VirtualDesktopManager class needed some big change in order
to accomodate it, which is where most changes are.
Other than that, it's mostly connections to wire up
VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)
Depends on D12820
Other notable detail, is the client visibility updated to reflect the presence
of the client in the plasmavirtualdesktop.
(and the unSetDesktop concept)
Test Plan: used a bit a plasma session together with D12820, D13748 and D13746
Reviewers: #plasma, #kwin, graesslin, davidedmundson
Reviewed By: #plasma, #kwin, davidedmundson
Subscribers: hein, zzag, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D13887
2018-10-29 22:29:15 +00:00
|
|
|
{
|
|
|
|
return m_desktops;
|
|
|
|
}
|
|
|
|
|
2007-07-18 15:01:59 +00:00
|
|
|
QPoint Deleted::clientPos() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-07-18 15:01:59 +00:00
|
|
|
return contentsRect.topLeft();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-07-18 15:01:59 +00:00
|
|
|
|
|
|
|
QSize Deleted::clientSize() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-07-18 15:01:59 +00:00
|
|
|
return contentsRect.size();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-07-18 15:01:59 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
void Deleted::debug(QDebug& stream) const
|
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
stream << "\'ID:" << window() << "\' (deleted)";
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2014-07-25 10:55:28 +00:00
|
|
|
void Deleted::layoutDecorationRects(QRect& left, QRect& top, QRect& right, QRect& bottom) const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2009-07-29 11:07:28 +00:00
|
|
|
left = decoration_left;
|
|
|
|
top = decoration_top;
|
|
|
|
right = decoration_right;
|
|
|
|
bottom = decoration_bottom;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2009-07-29 11:07:28 +00:00
|
|
|
|
|
|
|
QRect Deleted::decorationRect() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2014-07-23 07:20:28 +00:00
|
|
|
return rect();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2009-07-29 11:07:28 +00:00
|
|
|
|
2009-11-25 23:32:35 +00:00
|
|
|
QRect Deleted::transparentRect() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2009-11-25 23:32:35 +00:00
|
|
|
return transparent_rect;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2009-11-25 23:32:35 +00:00
|
|
|
|
2012-01-15 09:51:09 +00:00
|
|
|
bool Deleted::isDeleted() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-09-06 07:09:31 +00:00
|
|
|
NET::WindowType Deleted::windowType(bool direct, int supportedTypes) const
|
|
|
|
{
|
|
|
|
Q_UNUSED(direct)
|
2015-03-04 07:26:57 +00:00
|
|
|
Q_UNUSED(supportedTypes)
|
|
|
|
return m_type;
|
2012-09-06 07:09:31 +00:00
|
|
|
}
|
|
|
|
|
2013-06-03 13:08:05 +00:00
|
|
|
void Deleted::mainClientClosed(Toplevel *client)
|
|
|
|
{
|
2015-09-14 11:53:46 +00:00
|
|
|
if (AbstractClient *c = dynamic_cast<AbstractClient*>(client))
|
|
|
|
m_mainClients.removeAll(c);
|
2013-06-03 13:08:05 +00: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 13:04:05 +00: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 06:13:33 +00:00
|
|
|
xcb_window_t Deleted::frameId() const
|
|
|
|
{
|
|
|
|
return m_frame;
|
|
|
|
}
|
|
|
|
|
2015-03-04 06:56:51 +00:00
|
|
|
double Deleted::opacity() const
|
|
|
|
{
|
|
|
|
return m_opacity;
|
|
|
|
}
|
|
|
|
|
2015-03-04 07:53:51 +00:00
|
|
|
QByteArray Deleted::windowRole() const
|
|
|
|
{
|
|
|
|
return m_windowRole;
|
|
|
|
}
|
|
|
|
|
2018-11-30 09:58:45 +00:00
|
|
|
QVector<uint> Deleted::x11DesktopIds() const
|
|
|
|
{
|
|
|
|
const auto desks = desktops();
|
|
|
|
QVector<uint> x11Ids;
|
|
|
|
x11Ids.reserve(desks.count());
|
|
|
|
std::transform(desks.constBegin(), desks.constEnd(),
|
|
|
|
std::back_inserter(x11Ids),
|
|
|
|
[] (const VirtualDesktop *vd) {
|
|
|
|
return vd->x11DesktopNumber();
|
|
|
|
}
|
|
|
|
);
|
|
|
|
return x11Ids;
|
|
|
|
}
|
|
|
|
|
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 13:04:05 +00: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 17:35:43 +00:00
|
|
|
} // namespace
|
|
|
|
|