wayland: Only load HiddenPreviews options in X11

HiddenPreviews was a hack to not inform X11 that windows were minimised,
so that their previews kept working.

On wayland the user facing setting is not visible but the value is
loaded which is a bad combination.

CCBUG: 415286
This commit is contained in:
David Edmundson 2024-06-03 08:36:53 +00:00
parent 26d9361695
commit 1c3a987d74

View file

@ -787,17 +787,19 @@ void Options::loadConfig()
}
setGlPreferBufferSwap(c);
HiddenPreviews previews = Options::defaultHiddenPreviews();
// 4 - off, 5 - shown, 6 - always, other are old values
int hps = config.readEntry("HiddenPreviews", 5);
if (hps == 4) {
previews = HiddenPreviewsNever;
} else if (hps == 5) {
previews = HiddenPreviewsShown;
} else if (hps == 6) {
previews = HiddenPreviewsAlways;
if (kwinApp()->operationMode() == Application::OperationModeX11) {
HiddenPreviews previews = Options::defaultHiddenPreviews();
// 4 - off, 5 - shown, 6 - always, other are old values
int hps = config.readEntry("HiddenPreviews", 5);
if (hps == 4) {
previews = HiddenPreviewsNever;
} else if (hps == 5) {
previews = HiddenPreviewsShown;
} else if (hps == 6) {
previews = HiddenPreviewsAlways;
}
setHiddenPreviews(previews);
}
setHiddenPreviews(previews);
auto interfaceToKey = [](OpenGLPlatformInterface interface) {
switch (interface) {