D26381: Port DesktopGrid QtQuickWindow to EffectQuickView

Méven Car noreply at phabricator.kde.org
Mon Jan 6 12:55:23 GMT 2020


meven added a comment.


  Suggest to convert foreach loops.
  Not necessary though. Feel free to ignore/mark as done.

INLINE COMMENTS

> desktopgrid.cpp:105
>  {
> -    foreach (DesktopButtonsView *view, m_desktopButtonsViews)
> +    foreach (auto *view, m_desktopButtonsViews)
>          view->deleteLater();

Could you convert those foreach you touch

> desktopgrid.cpp:197
>      // paint the add desktop button
> -    foreach (DesktopButtonsView *view, m_desktopButtonsViews) {
> -        if (!view->effectWindow) {
> -            EffectWindow *viewWindow = effects->findWindow(view->winId());
> -            if (viewWindow) {
> -                viewWindow->setData(WindowForceBlurRole, QVariant(true));
> -                view->effectWindow = viewWindow;
> -            }
> -        }
> -        if (view->effectWindow) {
> -            WindowPaintData d(view->effectWindow);
> -            d.multiplyOpacity(timeline.currentValue());
> -            effects->drawWindow(view->effectWindow, PAINT_WINDOW_TRANSLUCENT, infiniteRegion(), d);
> -        }
> +    foreach (auto *view, m_desktopButtonsViews) {
> +        view->rootItem()->setOpacity(timeline.currentValue());

Same

> desktopgrid.cpp:461
>      if (!(wasWindowMove || wasDesktopMove)) {
> -        foreach (DesktopButtonsView *view, m_desktopButtonsViews) {
> -            if (view->geometry().contains(me->pos())) {
> -                const QPoint widgetPos = view->mapFromGlobal(me->pos());
> -                QMouseEvent event(me->type(), widgetPos, me->pos(), me->button(), me->buttons(), me->modifiers());
> -                view->windowInputMouseEvent(&event);
> +        foreach (auto *view, m_desktopButtonsViews) {
> +            view->forwardMouseEvent(me);

Could you convert those foreach you touch

> desktopgrid.cpp:1037
>                      return;
> -                foreach (DesktopButtonsView *view, m_desktopButtonsViews) {
> +                foreach (auto *view, m_desktopButtonsViews) {
>                      view->hide();

Same

REPOSITORY
  R108 KWin

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

To: davidedmundson, #kwin
Cc: meven, zzag, kwin, LeGast00n, The-Feren-OS-Dev, sbergeron, jraleigh, zachus, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20200106/ea127ed3/attachment-0001.html>


More information about the kwin mailing list