Changeset View
Changeset View
Standalone View
Standalone View
effects.cpp
1 | /******************************************************************** | 1 | /******************************************************************** | ||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | 2 | KWin - the KDE window manager | ||
3 | This file is part of the KDE project. | 3 | This file is part of the KDE project. | ||
4 | 4 | | |||
5 | Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org> | 5 | Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org> | ||
6 | Copyright (C) 2010, 2011 Martin Gräßlin <mgraesslin@kde.org> | 6 | Copyright (C) 2010, 2011 Martin Gräßlin <mgraesslin@kde.org> | ||
7 | Copyright (C) 2019 Vlad Zahorodnii <vladzzag@gmail.com> | ||||
7 | 8 | | |||
8 | This program is free software; you can redistribute it and/or modify | 9 | This program is free software; you can redistribute it and/or modify | ||
9 | it under the terms of the GNU General Public License as published by | 10 | it under the terms of the GNU General Public License as published by | ||
10 | the Free Software Foundation; either version 2 of the License, or | 11 | the Free Software Foundation; either version 2 of the License, or | ||
11 | (at your option) any later version. | 12 | (at your option) any later version. | ||
12 | 13 | | |||
13 | This program is distributed in the hope that it will be useful, | 14 | This program is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
▲ Show 20 Lines • Show All 1931 Lines • ▼ Show 20 Line(s) | |||||
1946 | 1947 | | |||
1947 | void EffectWindowImpl::setSceneWindow(Scene::Window* w) | 1948 | void EffectWindowImpl::setSceneWindow(Scene::Window* w) | ||
1948 | { | 1949 | { | ||
1949 | sw = w; | 1950 | sw = w; | ||
1950 | } | 1951 | } | ||
1951 | 1952 | | |||
1952 | QRegion EffectWindowImpl::shape() const | 1953 | QRegion EffectWindowImpl::shape() const | ||
1953 | { | 1954 | { | ||
1954 | if (isX11Client() && sceneWindow()) { | 1955 | if (sw) { | ||
1955 | return sceneWindow()->bufferShape(); | 1956 | return sw->decorationShape() | sw->bufferShape().translated(toplevel->clientPos()); | ||
1956 | } | 1957 | } | ||
1957 | return geometry(); | 1958 | return geometry(); | ||
1958 | } | 1959 | } | ||
1959 | 1960 | | |||
1960 | QRect EffectWindowImpl::decorationInnerRect() const | 1961 | QRect EffectWindowImpl::decorationInnerRect() const | ||
1961 | { | 1962 | { | ||
1962 | auto client = qobject_cast<X11Client *>(toplevel); | 1963 | auto client = qobject_cast<X11Client *>(toplevel); | ||
1963 | return client ? client->transparentRect() : contentsRect(); | 1964 | return client ? client->transparentRect() : contentsRect(); | ||
▲ Show 20 Lines • Show All 449 Lines • Show Last 20 Lines |