D15735: [effects/wobblywindows] Optimize wobbly windows effect

Vlad Zagorodniy <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
zzag added a comment.


  In D15735#332660 <https://phabricator.kde.org/D15735#332660>, @anthonyfieroni wrote:
  
  > @zzag did you test it, especially on Wayland?
  
  
  No, I didn't. Currently, I don't have much time to test the patch.

INLINE COMMENTS

> wobblywindows.cpp:60-136
> +static const ParameterSet pset[] = {
> +    {
> +        0.15,
> +        0.80,
> +        0.10,
> +        20.0,
> +        20.0,

Please revert this change.

> wobblywindows.cpp:269
>      // Could we just set a subset of the screen to be repainted ?
> -    if (windows.count() != 0) {
> +    if (!windows.empty()) {
>          m_updateRegion = QRegion();

We don't need this check. Please delete it.

(if windows.isEmpty() is equal to true, then prePaintScreen, prePaintWindow, etc won't be called)

> wobblywindows.cpp:283
>  }
> -const qreal maxTime = 10.0;
>  void WobblyWindowsEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time)

Please revert this change.

> wobblywindows.cpp:309
>  {
> -    if (!(mask & PAINT_SCREEN_TRANSFORMED) && windows.contains(w)) {
> -        WindowWobblyInfos& wwi = windows[w];
> +    QHash< const EffectWindow*,  WindowWobblyInfos >::iterator it;
> +    if (!(mask & PAINT_SCREEN_TRANSFORMED) && (it = windows.find(w)) != windows.end()) {

Please use const_iterator.

> wobblywindows.cpp:358-373
> +void WobblyWindowsEffect::adjustWindowWobblyAbilities(WindowWobblyInfos& wwi, const QRectF& rect)
> +{
> +    if (rect.y() != wwi.resize_original_rect.y()) {
> +        wwi.can_wobble_top = true;
> +    }
> +    if (rect.x() != wwi.resize_original_rect.x()) {
> +        wwi.can_wobble_left = true;

Please revert this change.

> wobblywindows.cpp:490
> +        if (it != windows.end()) {
>              // could this happen ??
> +            WindowWobblyInfos& wwi = it.value();

FWIW, we do not connect to windowShown, so this can never happen, at least right now.

> wobblywindows.h:139-143
> -    void cancelWindowGrab(KWin::EffectWindow *w, int grabRole);
> -    void startMovedResized(EffectWindow* w);
> -    void stepMovedResized(EffectWindow* w);
> -    bool updateWindowWobblyDatas(EffectWindow* w, qreal time);
> -

Please revert this change.

REPOSITORY
  R108 KWin

REVISION DETAIL
  https://phabricator.kde.org/D15735

To: anthonyfieroni, #kwin, zzag
Cc: kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.