[libkwineffects] Construct correct mouse event when forwarding to QtQuickView
ClosedPublic

Authored by davidedmundson on Nov 8 2019, 10:46 AM.

Details

Summary

Original code (copied from Aurorae) created a QMouseEvent for
QHoverEvents. Whilst it apparently worked, it's technically wrong.

It's safer to have an explicit type check given we come from a downcast
QEvent* and then build the correct event.

Test Plan

Hovered some icons

Diff Detail

Repository
R108 KWin
Branch
aurorae2
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 18590
Build 18608: arc lint + arc unit
davidedmundson created this revision.Nov 8 2019, 10:46 AM
Restricted Application added a project: KWin. · View Herald TranscriptNov 8 2019, 10:46 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Nov 8 2019, 10:46 AM
zzag added a subscriber: zzag.Nov 12 2019, 7:23 PM
zzag added inline comments.
libkwineffects/kwineffectquickview.cpp
206

Why did you put Q_FALLTHOURGH here? No compiler will complain about implicit fallthough in this case.

libkwineffects/kwineffectquickview.cpp
206

No specific reason. No compiler will complain about its presence either.
It's the same thing.

zzag added inline comments.Nov 13 2019, 5:59 PM
libkwineffects/kwineffectquickview.cpp
206

Okay, I see. Could you please drop these Q_FALLTHOUGH macros? There are a couple of reasons to do that:

(a) Putting Q_FALLTHOUGH or [[fallthrough]] in empty case blocks is uncommon
(b) It saves some vertical space

zzag accepted this revision.Nov 13 2019, 6:07 PM
This revision is now accepted and ready to land.Nov 13 2019, 6:07 PM
This revision was automatically updated to reflect the committed changes.