Don't use deprecated QDesktopWidget
ClosedPublic

Authored by zzag on Jul 10 2019, 2:12 PM.

Details

Summary

QApplication::desktop() is deprecated. It is advised to use
QGuiApplication::screens() instead.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
zzag created this revision.Jul 10 2019, 2:12 PM
Restricted Application added a project: KWin. · View Herald TranscriptJul 10 2019, 2:12 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Jul 10 2019, 2:12 PM
zzag added inline comments.Jul 10 2019, 2:12 PM
kcmkwin/kwinscreenedges/monitor.cpp
54

Is there nicer way to retrieve QScreen from QWidget?

davidedmundson added inline comments.
kcmkwin/kwinscreenedges/monitor.cpp
54

I'm not really sure it's that important. You have one preview, but the thing you're affecting changes all N screens.

Showing dimensions of the primary screen is just as valid.

Also the previous use of availableGeometry is almost certainly wrong. It's a preview of a monitor, therefore why exclude panels?

zzag added inline comments.Jul 10 2019, 2:33 PM
kcmkwin/kwinscreenedges/monitor.cpp
54

I'm not really sure it's that important. You have one preview, but the thing you're affecting changes all N screens.

Hmm, I just wanted to preserve current behavior. Am I missing something?

It's a preview of a monitor, therefore why exclude panels?

I have no idea, but yeah it doesn't make sense given that the monitor preview reflects dimensions of the screen on which the kcm is shown.

zzag updated this revision to Diff 61516.Jul 10 2019, 2:43 PM

Don't use availableGeometry.

apol accepted this revision.Jul 10 2019, 2:54 PM
apol added a subscriber: apol.

Cool stuff!
I remember looking into QDesktopWidget years ago and finding it quite problematic as it triggered a shitload of QWidget events that we don't need here.

This revision is now accepted and ready to land.Jul 10 2019, 2:54 PM
This revision was automatically updated to reflect the committed changes.