Changeset View
Changeset View
Standalone View
Standalone View
effects/thumbnailaside/thumbnailaside.cpp
Show All 17 Lines | |||||
18 | You should have received a copy of the GNU General Public License | 18 | You should have received a copy of the GNU General Public License | ||
19 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
20 | *********************************************************************/ | 20 | *********************************************************************/ | ||
21 | 21 | | |||
22 | #include "thumbnailaside.h" | 22 | #include "thumbnailaside.h" | ||
23 | // KConfigSkeleton | 23 | // KConfigSkeleton | ||
24 | #include "thumbnailasideconfig.h" | 24 | #include "thumbnailasideconfig.h" | ||
25 | 25 | | |||
26 | #include <QAction> | | |||
27 | #include <KGlobalAccel> | 26 | #include <KGlobalAccel> | ||
28 | #include <KLocalizedString> | 27 | #include <KLocalizedString> | ||
29 | 28 | | |||
29 | #include <QAction> | ||||
30 | #include <QMatrix4x4> | ||||
31 | | ||||
30 | namespace KWin | 32 | namespace KWin | ||
31 | { | 33 | { | ||
32 | 34 | | |||
33 | ThumbnailAsideEffect::ThumbnailAsideEffect() | 35 | ThumbnailAsideEffect::ThumbnailAsideEffect() | ||
34 | { | 36 | { | ||
35 | initConfig<ThumbnailAsideConfig>(); | 37 | initConfig<ThumbnailAsideConfig>(); | ||
36 | QAction* a = new QAction(this); | 38 | QAction* a = new QAction(this); | ||
37 | a->setObjectName(QStringLiteral("ToggleCurrentThumbnail")); | 39 | a->setObjectName(QStringLiteral("ToggleCurrentThumbnail")); | ||
Show All 19 Lines | 54 | { | |||
57 | screen = ThumbnailAsideConfig::screen(); // Xinerama screen TODO add gui option | 59 | screen = ThumbnailAsideConfig::screen(); // Xinerama screen TODO add gui option | ||
58 | arrange(); | 60 | arrange(); | ||
59 | } | 61 | } | ||
60 | 62 | | |||
61 | void ThumbnailAsideEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) | 63 | void ThumbnailAsideEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) | ||
62 | { | 64 | { | ||
63 | painted = QRegion(); | 65 | painted = QRegion(); | ||
64 | effects->paintScreen(mask, region, data); | 66 | effects->paintScreen(mask, region, data); | ||
67 | | ||||
68 | const QMatrix4x4 projectionMatrix = data.projectionMatrix(); | ||||
65 | foreach (const Data & d, windows) { | 69 | foreach (const Data & d, windows) { | ||
66 | if (painted.intersects(d.rect)) { | 70 | if (painted.intersects(d.rect)) { | ||
67 | WindowPaintData data(d.window); | 71 | WindowPaintData data(d.window, projectionMatrix); | ||
68 | data.multiplyOpacity(opacity); | 72 | data.multiplyOpacity(opacity); | ||
69 | QRect region; | 73 | QRect region; | ||
70 | setPositionTransformations(data, region, d.window, d.rect, Qt::KeepAspectRatio); | 74 | setPositionTransformations(data, region, d.window, d.rect, Qt::KeepAspectRatio); | ||
71 | effects->drawWindow(d.window, PAINT_WINDOW_OPAQUE | PAINT_WINDOW_TRANSLUCENT | PAINT_WINDOW_TRANSFORMED | PAINT_WINDOW_LANCZOS, | 75 | effects->drawWindow(d.window, PAINT_WINDOW_OPAQUE | PAINT_WINDOW_TRANSLUCENT | PAINT_WINDOW_TRANSFORMED | PAINT_WINDOW_LANCZOS, | ||
72 | region, data); | 76 | region, data); | ||
73 | } | 77 | } | ||
74 | } | 78 | } | ||
75 | } | 79 | } | ||
▲ Show 20 Lines • Show All 117 Lines • Show Last 20 Lines |