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

Authored by davidedmundson on Fri, Nov 8, 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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Fri, Nov 8, 10:46 AM
Restricted Application added a project: KWin. · View Herald TranscriptFri, Nov 8, 10:46 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Fri, Nov 8, 10:46 AM
zzag added a subscriber: zzag.Tue, Nov 12, 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.Wed, Nov 13, 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.Wed, Nov 13, 6:07 PM
This revision is now accepted and ready to land.Wed, Nov 13, 6:07 PM
This revision was automatically updated to reflect the committed changes.