[effects/snaphelper] Do massive overhaul
ClosedPublic

Authored by zzag on Sep 22 2018, 5:18 PM.

Details

Summary

This patch fixes some of issues that the Snap Helper effect currently
has:

  • If a window is being moved, there are visual artifacts (cause: missing addRepaint's);
  • It uses addRepaintFull;
  • For some reason, if a window goes deleted, it will be kept around as long as the Snap Helper effect needs it (visually, it doesn't look good).

Among other changes:

  • Use variables to store color and width of grid lines;
  • Use new connect syntax;
  • Port to TimeLine;
  • Fix coding style in some places.
Test Plan

Tried the effect with different rendering backends, no longer see visual
artifacts when moving or resizing windows.

Diff Detail

Repository
R108 KWin
Branch
effects-snaphelper-massive-overhaul
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 4359
Build 4377: arc lint + arc unit
zzag created this revision.Sep 22 2018, 5:18 PM
Restricted Application added a project: KWin. · View Herald TranscriptSep 22 2018, 5:18 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Sep 22 2018, 5:18 PM
zzag updated this revision to Diff 42168.Sep 23 2018, 7:36 AM
  • XRender: Match how window outline is render with OpenGL and QPainter rendering backend;
  • More const.
zzag added a comment.Sep 29 2018, 7:54 AM

Before:

After:

Before:

After:

zzag updated this revision to Diff 44528.Oct 31 2018, 9:06 AM

Coding style cleanup.

zzag updated this revision to Diff 44529.Oct 31 2018, 9:13 AM

Small cleanup.

zzag updated this revision to Diff 44530.Oct 31 2018, 9:24 AM

Don't issue unnecessary repaints.

zzag added a comment.Nov 4 2018, 3:44 PM

Could someone please review it?

romangg accepted this revision.Nov 5 2018, 2:45 PM
romangg added a subscriber: romangg.

Some small nitpicks. Good to go.

effects/snaphelper/snaphelper.cpp
56

Not linear anymore? Then mention in commit message.

effects/snaphelper/snaphelper.h
55

Second private. Remove.

56

Why is it a member variable? Since it does not get changed, better as a static in the cpp file. Same for m_lineColor below.

This revision is now accepted and ready to land.Nov 5 2018, 2:45 PM
zzag updated this revision to Diff 44910.Nov 5 2018, 2:58 PM
  • Delete superfluous 'private' access modifier;
  • Make m_lineColor and m_lineWidth static;
  • Use linear easing curve.
This revision was automatically updated to reflect the committed changes.