[Differential] [Commented On] D3159: Set wayland output scale

graesslin (Martin Gräßlin) noreply at phabricator.kde.org
Mon Nov 7 11:57:18 UTC 2016


graesslin added inline comments.

INLINE COMMENTS

> x11windowed_backend.cpp:201-205
> +            //generally we don't need to normalise input to the output scale; however because we're getting input
> +            //from a host window that doesn't understand scaling, we need to apply it ourselves so the cursor matches
> +            pointerMotion(QPointF((event->root_x - (*it).xPosition.x() + (*it).internalPosition.x()) / it->scale,
> +                                  (event->root_y - (*it).xPosition.y() + (*it).internalPosition.y()) / it->scale),
>                            event->time);

QPointF supports operator/, so that should be possible to simplify a bit.

> x11windowed_backend.cpp:234-235
>              }
> -            pointerMotion(QPointF(event->root_x - (*it).xPosition.x() + (*it).internalPosition.x(),
> -                                  event->root_y - (*it).xPosition.y() + (*it).internalPosition.y()),
> +            pointerMotion(QPointF((event->root_x - (*it).xPosition.x() + (*it).internalPosition.x()) / it->scale,
> +                                  (event->root_y - (*it).xPosition.y() + (*it).internalPosition.y()) / it->scale),
>                            event->time);

same here

> x11windowed_backend.cpp:370-371
> +
> +    pointerMotion(QPointF((event->root_x - (*it).xPosition.x() + (*it).internalPosition.x()) / it->scale,
> +                            (event->root_y - (*it).xPosition.y() + (*it).internalPosition.y()) / it->scale),
>                    event->time);

and here

> scene_qpainter.cpp:311-313
> +    const QRect target = QRect(toplevel->clientPos(), toplevel->clientSize());
> +    const QRect src = QRect(toplevel->clientPos() + toplevel->clientContentPos(), pixmap->image().size());
> +    painter->drawImage(target, pixmap->image(), src);

I don't understand how the scaling comes in here?

> scene_qpainter.cpp:321
>          }
>          paintSubSurface(painter, toplevel->clientPos(), static_cast<QPainterWindowPixmap*>(pixmap));
>      }

paintSubSurface probably also needs the adjustment

> shell_client.cpp:392
>      markAsMapped();
> -    m_clientSize = fbo->size();
>      doSetGeometry(QRect(geom.topLeft(), m_clientSize));

removing that line will break internal windows such as Alt+Tab, etc. etc on SceneOpenGL

REPOSITORY
  rKWIN KWin

BRANCH
  scaling

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

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: davidedmundson, graesslin, #plasma
Cc: broulik, graesslin, plasma-devel, kwin, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20161107/2927f645/attachment-0001.html>


More information about the Plasma-devel mailing list