Use Transform enum internally
ClosedPublic

Authored by romangg on Nov 26 2019, 10:54 PM.

Details

Summary

Instead of using Qt::ScreenOrientation use an enum class that is directly
mapped to KWayland's transformation enums. This simplifies the code.

Test Plan

Compiles and transformations work as before.

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.
romangg created this revision.Nov 26 2019, 10:54 PM
Restricted Application added a project: KWin. · View Herald TranscriptNov 26 2019, 10:54 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
romangg requested review of this revision.Nov 26 2019, 10:54 PM
zzag accepted this revision.Nov 26 2019, 11:17 PM
zzag added a subscriber: zzag.
zzag added inline comments.
abstract_wayland_output.cpp
154

Make these two helpers static.

This revision is now accepted and ready to land.Nov 26 2019, 11:17 PM
This revision was automatically updated to reflect the committed changes.
romangg added inline comments.Nov 27 2019, 8:11 PM
abstract_wayland_output.cpp
154

Forgot to add it. Does it really make a difference in C++ though? To my knowledge it doesn't.

zzag added inline comments.Nov 27 2019, 8:52 PM
abstract_wayland_output.cpp
154

Yes, it does make a difference. Using static will result in symbols local to the translation unit. Using inline will result in weak symbols. The second thing is that inline just gives a hint to inline the function. The compiler may ignore that hint, but it can also inline functions that are not marked with the inline keyword. So, making functions inline in this case is kind of pointless.