2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2013-04-26 08:41:24 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 1999, 2000 Matthias Ettrich <ettrich@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2003 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2013 Martin Gräßlin <mgraesslin@kde.org>
|
2013-04-26 08:41:24 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2013-04-26 08:41:24 +00:00
|
|
|
// own
|
|
|
|
#include "netinfo.h"
|
|
|
|
// kwin
|
2019-09-24 08:48:08 +00:00
|
|
|
#include "x11client.h"
|
2017-09-13 19:44:07 +00:00
|
|
|
#include "rootinfo_filter.h"
|
2013-04-26 08:41:24 +00:00
|
|
|
#include "virtualdesktops.h"
|
|
|
|
#include "workspace.h"
|
2013-09-02 11:14:39 +00:00
|
|
|
// Qt
|
|
|
|
#include <QDebug>
|
2013-04-26 08:41:24 +00:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
2013-04-29 10:17:42 +00:00
|
|
|
extern int screen_number;
|
2013-04-26 08:41:24 +00:00
|
|
|
|
Use nullptr everywhere
Summary:
Because KWin is a very old project, we use three kinds of null pointer
literals: 0, NULL, and nullptr. Since C++11, it's recommended to use
nullptr keyword.
This change converts all usages of 0 and NULL literal to nullptr. Even
though it breaks git history, we need to do it in order to have consistent
code as well to ease code reviews (it's very tempting for some people to
add unrelated changes to their patches, e.g. converting NULL to nullptr).
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson, romangg
Reviewed By: #kwin, davidedmundson, romangg
Subscribers: romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23618
2019-09-19 14:46:54 +00:00
|
|
|
RootInfo *RootInfo::s_self = nullptr;
|
2013-04-29 10:17:42 +00:00
|
|
|
|
|
|
|
RootInfo *RootInfo::create()
|
|
|
|
{
|
|
|
|
Q_ASSERT(!s_self);
|
2022-02-08 22:22:38 +00:00
|
|
|
xcb_window_t supportWindow = xcb_generate_id(kwinApp()->x11Connection());
|
2013-04-29 10:17:42 +00:00
|
|
|
const uint32_t values[] = {true};
|
2022-02-08 22:28:03 +00:00
|
|
|
xcb_create_window(kwinApp()->x11Connection(), XCB_COPY_FROM_PARENT, supportWindow, kwinApp()->x11RootWindow(),
|
2013-05-27 18:05:29 +00:00
|
|
|
0, 0, 1, 1, 0, XCB_COPY_FROM_PARENT,
|
2013-04-29 10:17:42 +00:00
|
|
|
XCB_COPY_FROM_PARENT, XCB_CW_OVERRIDE_REDIRECT, values);
|
|
|
|
const uint32_t lowerValues[] = { XCB_STACK_MODE_BELOW }; // See usage in layers.cpp
|
|
|
|
// we need to do the lower window with a roundtrip, otherwise NETRootInfo is not functioning
|
2022-02-08 22:22:38 +00:00
|
|
|
ScopedCPointer<xcb_generic_error_t> error(xcb_request_check(kwinApp()->x11Connection(),
|
|
|
|
xcb_configure_window_checked(kwinApp()->x11Connection(), supportWindow, XCB_CONFIG_WINDOW_STACK_MODE, lowerValues)));
|
2013-04-29 10:17:42 +00:00
|
|
|
if (!error.isNull()) {
|
2014-12-05 10:42:15 +00:00
|
|
|
qCDebug(KWIN_CORE) << "Error occurred while lowering support window: " << error->error_code;
|
2013-04-29 10:17:42 +00:00
|
|
|
}
|
|
|
|
|
2014-03-17 07:30:58 +00:00
|
|
|
const NET::Properties properties = NET::Supported |
|
2013-04-29 10:17:42 +00:00
|
|
|
NET::SupportingWMCheck |
|
|
|
|
NET::ClientList |
|
|
|
|
NET::ClientListStacking |
|
|
|
|
NET::DesktopGeometry |
|
|
|
|
NET::NumberOfDesktops |
|
|
|
|
NET::CurrentDesktop |
|
|
|
|
NET::ActiveWindow |
|
|
|
|
NET::WorkArea |
|
|
|
|
NET::CloseWindow |
|
|
|
|
NET::DesktopNames |
|
|
|
|
NET::WMName |
|
|
|
|
NET::WMVisibleName |
|
|
|
|
NET::WMDesktop |
|
|
|
|
NET::WMWindowType |
|
|
|
|
NET::WMState |
|
|
|
|
NET::WMStrut |
|
|
|
|
NET::WMIconGeometry |
|
|
|
|
NET::WMIcon |
|
|
|
|
NET::WMPid |
|
|
|
|
NET::WMMoveResize |
|
|
|
|
NET::WMFrameExtents |
|
2014-03-17 07:30:58 +00:00
|
|
|
NET::WMPing;
|
|
|
|
const NET::WindowTypes types = NET::NormalMask |
|
2013-04-29 10:17:42 +00:00
|
|
|
NET::DesktopMask |
|
|
|
|
NET::DockMask |
|
|
|
|
NET::ToolbarMask |
|
|
|
|
NET::MenuMask |
|
|
|
|
NET::DialogMask |
|
|
|
|
NET::OverrideMask |
|
|
|
|
NET::UtilityMask |
|
2014-03-17 07:30:58 +00:00
|
|
|
NET::SplashMask; // No compositing window types here unless we support them also as managed window types
|
|
|
|
const NET::States states = NET::Modal |
|
2013-04-29 10:17:42 +00:00
|
|
|
//NET::Sticky | // Large desktops not supported (and probably never will be)
|
|
|
|
NET::MaxVert |
|
|
|
|
NET::MaxHoriz |
|
|
|
|
NET::Shaded |
|
|
|
|
NET::SkipTaskbar |
|
|
|
|
NET::KeepAbove |
|
|
|
|
//NET::StaysOnTop | // The same like KeepAbove
|
|
|
|
NET::SkipPager |
|
|
|
|
NET::Hidden |
|
|
|
|
NET::FullScreen |
|
|
|
|
NET::KeepBelow |
|
2018-05-24 04:33:39 +00:00
|
|
|
NET::DemandsAttention |
|
Support NET_WM_STATE_FOCUSED
Summary:
This is used by GTK clients to know whether to draw as though they have
focus or not. Whilst it's most visible for CSDs headers, use of the
active/inactive palette (or backdrop class in GTK terms) applies
everywhere.
Rationale of the flag is to allow the WM to hint visual states without
giving input, i.e so you can hint that the parent of a modal dialog
should be shown as active. Though kwin only sets it on the truly active
window to match the behaviour our other windows follow.
BUG: 398832
I expect this to be potentially controversial as it's new code in X11,
so in advance:
* Unlike GTK_FRAME_EXTENTS, it is part of the specificiation (albeit
1.4) even i3 supports it.
* It does fix a real world issue
* It's only 2 lines (plus trivial boiler plate in kwindowsystem)
* It's in code path that we rely on for our existing code
* If there's a situation where this does break, the worst that will
happen is a client gets a visual hint to have focus incorrectly, which
ultimately is the same as the current state
Test Plan:
Used my CSS for breeze-gtk
moved between windows
Reviewers: #kwin, rooty, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, ognarb, ngraham, rooty, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19613
2019-05-10 14:32:55 +00:00
|
|
|
NET::SkipSwitcher |
|
|
|
|
NET::Focused;
|
2014-03-17 07:30:58 +00:00
|
|
|
NET::Properties2 properties2 = NET::WM2UserTime |
|
2013-04-29 10:17:42 +00:00
|
|
|
NET::WM2StartupId |
|
|
|
|
NET::WM2AllowedActions |
|
|
|
|
NET::WM2RestackWindow |
|
|
|
|
NET::WM2MoveResizeWindow |
|
|
|
|
NET::WM2ExtendedStrut |
|
|
|
|
NET::WM2KDETemporaryRules |
|
|
|
|
NET::WM2ShowingDesktop |
|
|
|
|
NET::WM2DesktopLayout |
|
|
|
|
NET::WM2FullPlacement |
|
|
|
|
NET::WM2FullscreenMonitors |
|
2015-01-22 14:46:12 +00:00
|
|
|
NET::WM2KDEShadow |
|
[x11] Add support for _GTK_FRAME_EXTENTS
Summary:
KDE is known for having a strong view on the client-side decorations vs
server-side decorations issue. The main argument raised against CSD is
that desktop will look less consistent when clients start drawing window
decorations by themselves, which is somewhat true. It all ties to how
well each toolkit is integrated with the desktop environment.
KDE doesn't control the desktop market on Linux. Another big "player"
is GNOME. Both KDE and GNOME have very polarized views on in which
direction desktop should move forward. The KDE community is pushing more
toward server-side decorations while the GNOME community is pushing
more toward client-side decorations. Both communities have developed
great applications and it's not rare to see a GNOME application being
used in KDE Plasma. The only problem is that these different views are
not left behind the curtain and our users pay the price. Resizing GTK
clients in Plasma became practically impossible due to resize borders
having small hit area.
When a client draws its window decoration, it's more likely that it also
draws the drop-shadow around the decoration. The compositor must know
the extents of the shadow so things like snapping and so on work as
expected. And here lies the problem... While the xdg-shell protocol has
a way to specify such things, the NetWM spec doesn't have anything like
that. There's _GTK_FRAME_EXTENTS in the wild, however the problem with
it is that it's a proprietary atom, which is specific only to GTK apps.
Due to that, _GTK_FRAME_EXTENTS wasn't implemented because implementing
anything like that would require major changes in how we think about
geometry.
Recent xdg-shell window geometry patches adjusted geometry abstractions
in kwin to such a degree that it's very easy to add support for client
side decorated clients on X11. We just have to make sure that the
X11Client class provides correct buffer geometry and frame geometry when
the gtk frame extents are set.
Even though the X11 code is feature frozen, I still think it's worth
to have _GTK_FRAME_EXTENTS support in kwin because it will fix the resize
issues. Also, because KWin/Wayland is unfortunately far from becoming
default, it will help us with testing some implementation bits of the
window geometry from xdg-shell.
BUG: 390550
FIXED-IN: 5.18.0
Test Plan:
Things like quick tiling, maximizing, tiling scripts and so on work as
expected with GTK clients.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: cblack, trmdi, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24660
2019-10-08 08:46:59 +00:00
|
|
|
NET::WM2OpaqueRegion |
|
|
|
|
NET::WM2GTKFrameExtents;
|
2022-02-28 18:58:35 +00:00
|
|
|
#if KWIN_BUILD_ACTIVITIES
|
2014-09-16 06:05:08 +00:00
|
|
|
properties2 |= NET::WM2Activities;
|
|
|
|
#endif
|
2014-03-17 07:30:58 +00:00
|
|
|
const NET::Actions actions = NET::ActionMove |
|
2013-04-29 10:17:42 +00:00
|
|
|
NET::ActionResize |
|
|
|
|
NET::ActionMinimize |
|
|
|
|
NET::ActionShade |
|
|
|
|
//NET::ActionStick | // Sticky state is not supported
|
|
|
|
NET::ActionMaxVert |
|
|
|
|
NET::ActionMaxHoriz |
|
|
|
|
NET::ActionFullScreen |
|
|
|
|
NET::ActionChangeDesktop |
|
2014-03-17 07:30:58 +00:00
|
|
|
NET::ActionClose;
|
2013-04-29 10:17:42 +00:00
|
|
|
|
2014-03-17 07:30:58 +00:00
|
|
|
s_self = new RootInfo(supportWindow, "KWin", properties, types, states, properties2, actions, screen_number);
|
2013-04-29 10:17:42 +00:00
|
|
|
return s_self;
|
|
|
|
}
|
|
|
|
|
|
|
|
void RootInfo::destroy()
|
|
|
|
{
|
2017-09-30 11:31:14 +00:00
|
|
|
if (!s_self) {
|
|
|
|
return;
|
|
|
|
}
|
2013-04-29 10:17:42 +00:00
|
|
|
xcb_window_t supportWindow = s_self->supportWindow();
|
|
|
|
delete s_self;
|
Use nullptr everywhere
Summary:
Because KWin is a very old project, we use three kinds of null pointer
literals: 0, NULL, and nullptr. Since C++11, it's recommended to use
nullptr keyword.
This change converts all usages of 0 and NULL literal to nullptr. Even
though it breaks git history, we need to do it in order to have consistent
code as well to ease code reviews (it's very tempting for some people to
add unrelated changes to their patches, e.g. converting NULL to nullptr).
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson, romangg
Reviewed By: #kwin, davidedmundson, romangg
Subscribers: romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23618
2019-09-19 14:46:54 +00:00
|
|
|
s_self = nullptr;
|
2022-02-08 22:22:38 +00:00
|
|
|
xcb_destroy_window(kwinApp()->x11Connection(), supportWindow);
|
2013-04-29 10:17:42 +00:00
|
|
|
}
|
|
|
|
|
2014-03-17 07:30:58 +00:00
|
|
|
RootInfo::RootInfo(xcb_window_t w, const char *name, NET::Properties properties, NET::WindowTypes types,
|
|
|
|
NET::States states, NET::Properties2 properties2, NET::Actions actions, int scr)
|
2022-02-08 22:22:38 +00:00
|
|
|
: NETRootInfo(kwinApp()->x11Connection(), w, name, properties, types, states, properties2, actions, scr)
|
2017-08-03 14:31:20 +00:00
|
|
|
, m_activeWindow(activeWindow())
|
2017-09-13 19:44:07 +00:00
|
|
|
, m_eventFilter(std::make_unique<RootInfoFilter>(this))
|
2013-04-26 08:41:24 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void RootInfo::changeNumberOfDesktops(int n)
|
|
|
|
{
|
|
|
|
VirtualDesktopManager::self()->setCount(n);
|
|
|
|
}
|
|
|
|
|
|
|
|
void RootInfo::changeCurrentDesktop(int d)
|
|
|
|
{
|
|
|
|
VirtualDesktopManager::self()->setCurrent(d);
|
|
|
|
}
|
|
|
|
|
2013-11-18 12:58:35 +00:00
|
|
|
void RootInfo::changeActiveWindow(xcb_window_t w, NET::RequestSource src, xcb_timestamp_t timestamp, xcb_window_t active_window)
|
2013-04-26 08:41:24 +00:00
|
|
|
{
|
|
|
|
Workspace *workspace = Workspace::self();
|
2019-09-24 08:48:08 +00:00
|
|
|
if (X11Client *c = workspace->findClient(Predicate::WindowMatch, w)) {
|
2019-09-06 14:30:26 +00:00
|
|
|
if (timestamp == XCB_CURRENT_TIME)
|
2013-04-26 08:41:24 +00:00
|
|
|
timestamp = c->userTime();
|
|
|
|
if (src != NET::FromApplication && src != FromTool)
|
|
|
|
src = NET::FromTool;
|
|
|
|
if (src == NET::FromTool)
|
|
|
|
workspace->activateClient(c, true); // force
|
|
|
|
else if (c == workspace->mostRecentlyActivatedClient()) {
|
|
|
|
return; // WORKAROUND? With > 1 plasma activities, we cause this ourselves. bug #240673
|
|
|
|
} else { // NET::FromApplication
|
2019-09-24 08:48:08 +00:00
|
|
|
X11Client *c2;
|
2013-04-26 08:41:24 +00:00
|
|
|
if (workspace->allowClientActivation(c, timestamp, false, true))
|
|
|
|
workspace->activateClient(c);
|
|
|
|
// if activation of the requestor's window would be allowed, allow activation too
|
2019-09-06 14:30:26 +00:00
|
|
|
else if (active_window != XCB_WINDOW_NONE
|
Use nullptr everywhere
Summary:
Because KWin is a very old project, we use three kinds of null pointer
literals: 0, NULL, and nullptr. Since C++11, it's recommended to use
nullptr keyword.
This change converts all usages of 0 and NULL literal to nullptr. Even
though it breaks git history, we need to do it in order to have consistent
code as well to ease code reviews (it's very tempting for some people to
add unrelated changes to their patches, e.g. converting NULL to nullptr).
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson, romangg
Reviewed By: #kwin, davidedmundson, romangg
Subscribers: romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23618
2019-09-19 14:46:54 +00:00
|
|
|
&& (c2 = workspace->findClient(Predicate::WindowMatch, active_window)) != nullptr
|
2013-04-26 08:41:24 +00:00
|
|
|
&& workspace->allowClientActivation(c2,
|
|
|
|
timestampCompare(timestamp, c2->userTime() > 0 ? timestamp : c2->userTime()), false, true)) {
|
|
|
|
workspace->activateClient(c);
|
|
|
|
} else
|
|
|
|
c->demandAttention();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-18 12:58:35 +00:00
|
|
|
void RootInfo::restackWindow(xcb_window_t w, RequestSource src, xcb_window_t above, int detail, xcb_timestamp_t timestamp)
|
2013-04-26 08:41:24 +00:00
|
|
|
{
|
2019-09-24 08:48:08 +00:00
|
|
|
if (X11Client *c = Workspace::self()->findClient(Predicate::WindowMatch, w)) {
|
2019-09-06 14:30:26 +00:00
|
|
|
if (timestamp == XCB_CURRENT_TIME)
|
2013-04-26 08:41:24 +00:00
|
|
|
timestamp = c->userTime();
|
|
|
|
if (src != NET::FromApplication && src != FromTool)
|
|
|
|
src = NET::FromTool;
|
|
|
|
c->restackWindow(above, detail, src, timestamp, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-18 12:58:35 +00:00
|
|
|
void RootInfo::closeWindow(xcb_window_t w)
|
2013-04-26 08:41:24 +00:00
|
|
|
{
|
2019-09-24 08:48:08 +00:00
|
|
|
X11Client *c = Workspace::self()->findClient(Predicate::WindowMatch, w);
|
2013-04-26 08:41:24 +00:00
|
|
|
if (c)
|
|
|
|
c->closeWindow();
|
|
|
|
}
|
|
|
|
|
2013-11-18 12:58:35 +00:00
|
|
|
void RootInfo::moveResize(xcb_window_t w, int x_root, int y_root, unsigned long direction)
|
2013-04-26 08:41:24 +00:00
|
|
|
{
|
2019-09-24 08:48:08 +00:00
|
|
|
X11Client *c = Workspace::self()->findClient(Predicate::WindowMatch, w);
|
2013-04-26 08:41:24 +00:00
|
|
|
if (c) {
|
|
|
|
updateXTime(); // otherwise grabbing may have old timestamp - this message should include timestamp
|
|
|
|
c->NETMoveResize(x_root, y_root, (Direction)direction);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-18 12:58:35 +00:00
|
|
|
void RootInfo::moveResizeWindow(xcb_window_t w, int flags, int x, int y, int width, int height)
|
2013-04-26 08:41:24 +00:00
|
|
|
{
|
2019-09-24 08:48:08 +00:00
|
|
|
X11Client *c = Workspace::self()->findClient(Predicate::WindowMatch, w);
|
2013-04-26 08:41:24 +00:00
|
|
|
if (c)
|
|
|
|
c->NETMoveResizeWindow(flags, x, y, width, height);
|
|
|
|
}
|
|
|
|
|
2013-11-18 12:58:35 +00:00
|
|
|
void RootInfo::gotPing(xcb_window_t w, xcb_timestamp_t timestamp)
|
2013-04-26 08:41:24 +00:00
|
|
|
{
|
2019-09-24 08:48:08 +00:00
|
|
|
if (X11Client *c = Workspace::self()->findClient(Predicate::WindowMatch, w))
|
2013-04-26 08:41:24 +00:00
|
|
|
c->gotPing(timestamp);
|
|
|
|
}
|
|
|
|
|
|
|
|
void RootInfo::changeShowingDesktop(bool showing)
|
|
|
|
{
|
|
|
|
Workspace::self()->setShowingDesktop(showing);
|
|
|
|
}
|
|
|
|
|
2017-08-03 14:31:20 +00:00
|
|
|
void RootInfo::setActiveClient(AbstractClient *client)
|
|
|
|
{
|
|
|
|
const xcb_window_t w = client ? client->window() : xcb_window_t{XCB_WINDOW_NONE};
|
|
|
|
if (m_activeWindow == w) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
m_activeWindow = w;
|
|
|
|
setActiveWindow(m_activeWindow);
|
|
|
|
}
|
|
|
|
|
2013-04-26 08:41:24 +00:00
|
|
|
// ****************************************
|
|
|
|
// WinInfo
|
|
|
|
// ****************************************
|
|
|
|
|
2019-09-24 08:48:08 +00:00
|
|
|
WinInfo::WinInfo(X11Client *c, xcb_window_t window,
|
2014-03-04 09:48:23 +00:00
|
|
|
xcb_window_t rwin, NET::Properties properties, NET::Properties2 properties2)
|
2022-02-08 22:22:38 +00:00
|
|
|
: NETWinInfo(kwinApp()->x11Connection(), window, rwin, properties, properties2, NET::WindowManager), m_client(c)
|
2013-04-26 08:41:24 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void WinInfo::changeDesktop(int desktop)
|
|
|
|
{
|
|
|
|
Workspace::self()->sendClientToDesktop(m_client, desktop, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void WinInfo::changeFullscreenMonitors(NETFullscreenMonitors topology)
|
|
|
|
{
|
|
|
|
m_client->updateFullscreenMonitors(topology);
|
|
|
|
}
|
|
|
|
|
2014-02-03 08:37:08 +00:00
|
|
|
void WinInfo::changeState(NET::States state, NET::States mask)
|
2013-04-26 08:41:24 +00:00
|
|
|
{
|
|
|
|
mask &= ~NET::Sticky; // KWin doesn't support large desktops, ignore
|
|
|
|
mask &= ~NET::Hidden; // clients are not allowed to change this directly
|
|
|
|
state &= mask; // for safety, clear all other bits
|
|
|
|
|
|
|
|
if ((mask & NET::FullScreen) != 0 && (state & NET::FullScreen) == 0)
|
|
|
|
m_client->setFullScreen(false, false);
|
|
|
|
if ((mask & NET::Max) == NET::Max)
|
|
|
|
m_client->setMaximize(state & NET::MaxVert, state & NET::MaxHoriz);
|
|
|
|
else if (mask & NET::MaxVert)
|
2014-12-02 12:49:08 +00:00
|
|
|
m_client->setMaximize(state & NET::MaxVert, m_client->maximizeMode() & MaximizeHorizontal);
|
2013-04-26 08:41:24 +00:00
|
|
|
else if (mask & NET::MaxHoriz)
|
2014-12-02 12:49:08 +00:00
|
|
|
m_client->setMaximize(m_client->maximizeMode() & MaximizeVertical, state & NET::MaxHoriz);
|
2013-04-26 08:41:24 +00:00
|
|
|
|
|
|
|
if (mask & NET::Shaded)
|
|
|
|
m_client->setShade(state & NET::Shaded ? ShadeNormal : ShadeNone);
|
|
|
|
if (mask & NET::KeepAbove)
|
|
|
|
m_client->setKeepAbove((state & NET::KeepAbove) != 0);
|
|
|
|
if (mask & NET::KeepBelow)
|
|
|
|
m_client->setKeepBelow((state & NET::KeepBelow) != 0);
|
|
|
|
if (mask & NET::SkipTaskbar)
|
2015-06-06 20:08:12 +00:00
|
|
|
m_client->setOriginalSkipTaskbar((state & NET::SkipTaskbar) != 0);
|
2013-04-26 08:41:24 +00:00
|
|
|
if (mask & NET::SkipPager)
|
|
|
|
m_client->setSkipPager((state & NET::SkipPager) != 0);
|
2018-05-24 04:33:39 +00:00
|
|
|
if (mask & NET::SkipSwitcher)
|
|
|
|
m_client->setSkipSwitcher((state & NET::SkipSwitcher) != 0);
|
2013-04-26 08:41:24 +00:00
|
|
|
if (mask & NET::DemandsAttention)
|
|
|
|
m_client->demandAttention((state & NET::DemandsAttention) != 0);
|
|
|
|
if (mask & NET::Modal)
|
|
|
|
m_client->setModal((state & NET::Modal) != 0);
|
|
|
|
// unsetting fullscreen first, setting it last (because e.g. maximize works only for !isFullScreen() )
|
|
|
|
if ((mask & NET::FullScreen) != 0 && (state & NET::FullScreen) != 0)
|
|
|
|
m_client->setFullScreen(true, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
void WinInfo::disable()
|
|
|
|
{
|
Use nullptr everywhere
Summary:
Because KWin is a very old project, we use three kinds of null pointer
literals: 0, NULL, and nullptr. Since C++11, it's recommended to use
nullptr keyword.
This change converts all usages of 0 and NULL literal to nullptr. Even
though it breaks git history, we need to do it in order to have consistent
code as well to ease code reviews (it's very tempting for some people to
add unrelated changes to their patches, e.g. converting NULL to nullptr).
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson, romangg
Reviewed By: #kwin, davidedmundson, romangg
Subscribers: romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23618
2019-09-19 14:46:54 +00:00
|
|
|
m_client = nullptr; // only used when the object is passed to Deleted
|
2013-04-26 08:41:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|