2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2006 Lubos Lunak <l.lunak@kde.org>
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
#include "deleted.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"
|
2021-08-12 14:16:08 +00:00
|
|
|
#include "virtualdesktops.h"
|
2022-03-23 10:13:38 +00:00
|
|
|
#include "workspace.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()
|
2022-04-22 17:39:12 +00:00
|
|
|
: Window()
|
2013-09-10 06:13:33 +00:00
|
|
|
, m_frame(XCB_WINDOW_NONE)
|
2012-04-07 14:43:27 +00:00
|
|
|
, m_layer(UnknownLayer)
|
2021-05-26 09:34:35 +00:00
|
|
|
, m_shade(false)
|
2016-01-27 13:14:37 +00:00
|
|
|
, m_fullscreen(false)
|
2018-11-12 10:47:36 +00:00
|
|
|
, m_wasPopupWindow(false)
|
2019-03-19 14:01:29 +00:00
|
|
|
, m_wasOutline(false)
|
2021-05-12 18:56:16 +00:00
|
|
|
, m_wasLockScreen(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
|
|
|
{
|
2015-11-16 13:14:07 +00:00
|
|
|
if (workspace()) {
|
|
|
|
workspace()->removeDeleted(this);
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2023-01-07 20:51:34 +00:00
|
|
|
std::unique_ptr<WindowItem> Deleted::createItem(Scene *scene)
|
2022-05-09 15:47:12 +00:00
|
|
|
{
|
|
|
|
Q_UNREACHABLE();
|
|
|
|
}
|
|
|
|
|
2022-04-22 17:39:12 +00:00
|
|
|
Deleted *Deleted::create(Window *c)
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2022-03-23 10:13:38 +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
|
|
|
|
2022-04-22 17:39:12 +00:00
|
|
|
void Deleted::copyToDeleted(Window *window)
|
2022-04-17 15:43:54 +00:00
|
|
|
{
|
|
|
|
Q_ASSERT(!window->isDeleted());
|
2022-04-22 17:39:12 +00:00
|
|
|
Window::copyToDeleted(window);
|
2022-04-17 15:43:54 +00:00
|
|
|
desk = window->desktop();
|
|
|
|
m_desktops = window->desktops();
|
|
|
|
activityList = window->activities();
|
2022-05-16 20:13:39 +00:00
|
|
|
contentsRect = QRectF(window->clientPos(), window->clientSize());
|
2022-04-17 15:43:54 +00:00
|
|
|
m_layer = window->layer();
|
|
|
|
m_frame = window->frameId();
|
|
|
|
m_type = window->windowType();
|
|
|
|
m_windowRole = window->windowRole();
|
|
|
|
m_shade = window->isShade();
|
2022-04-23 08:33:23 +00:00
|
|
|
m_mainWindows = window->mainWindows();
|
2022-10-31 19:02:23 +00:00
|
|
|
for (Window *w : std::as_const(m_mainWindows)) {
|
2023-03-13 19:21:11 +00:00
|
|
|
connect(w, &Window::closed, this, &Deleted::mainWindowClosed);
|
2022-04-17 15:43:54 +00:00
|
|
|
}
|
|
|
|
m_fullscreen = window->isFullScreen();
|
|
|
|
m_caption = window->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
|
|
|
|
2022-10-31 19:02:23 +00:00
|
|
|
for (auto vd : std::as_const(m_desktops)) {
|
2022-10-14 12:28:53 +00:00
|
|
|
connect(vd, &QObject::destroyed, this, [=, this] {
|
2019-01-10 17:32:40 +00:00
|
|
|
m_desktops.removeOne(vd);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-04-17 15:43:54 +00:00
|
|
|
m_wasPopupWindow = window->isPopupWindow();
|
|
|
|
m_wasOutline = window->isOutline();
|
|
|
|
m_wasLockScreen = window->isLockScreen();
|
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;
|
|
|
|
}
|
|
|
|
|
2022-05-16 20:13:39 +00:00
|
|
|
QPointF 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
|
|
|
|
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
|
|
|
|
{
|
2015-03-04 07:26:57 +00:00
|
|
|
return m_type;
|
2012-09-06 07:09:31 +00:00
|
|
|
}
|
|
|
|
|
2022-04-23 08:33:23 +00:00
|
|
|
void Deleted::mainWindowClosed(Window *window)
|
2013-06-03 13:08:05 +00:00
|
|
|
{
|
2022-04-23 08:33:23 +00:00
|
|
|
m_mainWindows.removeAll(window);
|
2013-06-03 13:08:05 +00:00
|
|
|
}
|
|
|
|
|
2013-09-10 06:13:33 +00:00
|
|
|
xcb_window_t Deleted::frameId() const
|
|
|
|
{
|
|
|
|
return m_frame;
|
|
|
|
}
|
|
|
|
|
2022-10-21 14:24:42 +00:00
|
|
|
QString Deleted::windowRole() const
|
2015-03-04 07:53:51 +00:00
|
|
|
{
|
|
|
|
return m_windowRole;
|
|
|
|
}
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
} // namespace
|