Changeset View
Changeset View
Standalone View
Standalone View
src/Platforms/PlatformKWinWayland.cpp
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | 86 | { | |||
---|---|---|---|---|---|
88 | if (QApplication::screens().count() > 1) { | 88 | if (QApplication::screens().count() > 1) { | ||
89 | lSupportedModes |= Platform::GrabMode::CurrentScreen; | 89 | lSupportedModes |= Platform::GrabMode::CurrentScreen; | ||
90 | } | 90 | } | ||
91 | return lSupportedModes; | 91 | return lSupportedModes; | ||
92 | } | 92 | } | ||
93 | 93 | | |||
94 | Platform::ShutterModes PlatformKWinWayland::supportedShutterModes() const | 94 | Platform::ShutterModes PlatformKWinWayland::supportedShutterModes() const | ||
95 | { | 95 | { | ||
96 | return { ShutterMode::OnClick }; | 96 | return { ShutterMode::Immediate | ShutterMode::OnClick }; | ||
97 | } | 97 | } | ||
apol: Should probably make sure that it's Plasma 5, or when we release Plasma 6 this will stop… | |||||
98 | 98 | | |||
99 | void PlatformKWinWayland::doGrab(ShutterMode theShutterMode, GrabMode theGrabMode, bool theIncludePointer, bool theIncludeDecorations) | 99 | void PlatformKWinWayland::doGrab(ShutterMode theShutterMode, GrabMode theGrabMode, bool theIncludePointer, bool theIncludeDecorations) | ||
100 | { | 100 | { | ||
101 | if (theShutterMode != ShutterMode::OnClick) { | | |||
102 | emit newScreenshotFailed(); | | |||
103 | return; | | |||
104 | } | | |||
105 | | ||||
106 | switch(theGrabMode) { | 101 | switch(theGrabMode) { | ||
107 | case GrabMode::AllScreens: { | 102 | case GrabMode::AllScreens: { | ||
108 | doGrabHelper(QStringLiteral("screenshotFullscreen"), theIncludePointer); | 103 | doGrabHelper(QStringLiteral("screenshotFullscreen"), theIncludePointer); | ||
109 | return; | 104 | return; | ||
110 | } | 105 | } | ||
111 | case GrabMode::CurrentScreen: { | 106 | case GrabMode::CurrentScreen: { | ||
112 | doGrabHelper(QStringLiteral("screenshotScreen"), theIncludePointer); | 107 | doGrabHelper(QStringLiteral("screenshotScreen"), theIncludePointer); | ||
113 | return; | 108 | return; | ||
114 | } | 109 | } | ||
115 | case GrabMode::WindowUnderCursor: { | 110 | case GrabMode::WindowUnderCursor: { | ||
116 | int lOpMask = theIncludeDecorations ? 1 : 0; | 111 | int lOpMask = theIncludeDecorations ? 1 : 0; | ||
117 | if (theIncludePointer) { | 112 | if (theIncludePointer) { | ||
probably doesn't make a difference because it's not called often but you can call splitRef and skip allocating a few of strings you don't need. apol: probably doesn't make a difference because it's not called often but you can call splitRef and… | |||||
Didn't know about splitRef, what a nice function, that makes split so much more efficient meven: Didn't know about splitRef, what a nice function, that makes split so much more efficient | |||||
118 | lOpMask |= 1 << 1; | 113 | lOpMask |= 1 << 1; | ||
119 | } | 114 | } | ||
120 | doGrabHelper(QStringLiteral("interactive"), lOpMask); | 115 | doGrabHelper(QStringLiteral("interactive"), lOpMask); | ||
121 | return; | 116 | return; | ||
122 | } | 117 | } | ||
123 | case GrabMode::InvalidChoice: | 118 | case GrabMode::InvalidChoice: | ||
124 | case GrabMode::ActiveWindow: | 119 | case GrabMode::ActiveWindow: | ||
125 | case GrabMode::TransientWithParent: | 120 | case GrabMode::TransientWithParent: | ||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |
Should probably make sure that it's Plasma 5, or when we release Plasma 6 this will stop working.