|
2 | 2 |
|
3 | 3 | #include "app/applicationexceptionhandler.h" |
4 | 4 | #include "common/log.h" |
5 | | -#include "common/settings.h" |
6 | 5 |
|
7 | 6 | #include "platform/dummy/dummyclipboard.h" |
8 | 7 | #include "winplatform.h" |
@@ -298,26 +297,22 @@ bool WinPlatform::setPreventScreenCapture(WId winId, bool prevent) |
298 | 297 | // Remote desktop clients are screen capture systems — applying |
299 | 298 | // WDA_EXCLUDEFROMCAPTURE makes windows invisible to the remote viewer. |
300 | 299 | if (prevent && GetSystemMetrics(SM_REMOTESESSION)) { |
| 300 | + if (!SetWindowDisplayAffinity(window, WDA_NONE)) |
| 301 | + log("Failed to clear display affinity in remote session", LogWarning); |
| 302 | + |
301 | 303 | static bool logged = false; |
302 | 304 | if (!logged) { |
303 | 305 | logged = true; |
304 | 306 | log("Skipping screen capture prevention in remote desktop session", LogWarning); |
305 | | - |
306 | | - const QLatin1String optionKey("Options/screen_capture_warning_acknowledged"); |
307 | | - Settings settings; |
308 | | - if (!settings.value(optionKey, false).toBool()) { |
309 | | - QMessageBox::warning( |
310 | | - nullptr, |
311 | | - QObject::tr("Screen Capture Prevention Unavailable"), |
312 | | - QObject::tr( |
313 | | - "The option to hide from screenshots is enabled but cannot" |
314 | | - " take effect in a remote desktop session. Window content" |
315 | | - " may be visible to screen capture.")); |
316 | | - settings.setValue(optionKey, true); |
317 | | - } |
| 307 | + QMessageBox::warning( |
| 308 | + nullptr, |
| 309 | + QObject::tr("Screen Capture Prevention Unavailable"), |
| 310 | + QObject::tr( |
| 311 | + "The option to hide from screenshots is enabled but cannot" |
| 312 | + " take effect in a remote desktop session. Window content" |
| 313 | + " may be visible to screen capture.")); |
318 | 314 | } |
319 | 315 |
|
320 | | - SetWindowDisplayAffinity(window, WDA_NONE); |
321 | 316 | return false; |
322 | 317 | } |
323 | 318 |
|
|
0 commit comments