Provides a virtual method in Screens where backends can supply the scale
of each screen, this is then set on each output.
For the X windowed backend this value is taken from a command line
parameter.
graesslin |
Plasma |
Provides a virtual method in Screens where backends can supply the scale
of each screen, this is then set on each output.
For the X windowed backend this value is taken from a command line
parameter.
Ran windowed mode with --scale 1 and 2
then kate --platform=wayland from another screen.
On the latter case UI elements were scaled up correctly
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
I suggest to also implement in the virtual platform in order to be able to auto-test it.
main_wayland.cpp | ||
---|---|---|
532 | careful here: copy and paste error | |
642 | hmm I'm not sure whether we should implement it as an int factor. Even if Wayland only supports integer scaling, I think that's a bad idea and we should rather go with fractal scaling from the start. Of course towards Wayland we need to expose it as integer scaling. But in case Wayland gets an update we would be prepared. | |
wayland_server.cpp | ||
373 | At the moment KWin doesn't scale yet. I think we should not start to export scale to Wayland as long as we don't support it. The idea behind the scale in Wayland is that the compositor itself scales up all surfaces which don't provide the correct scale factor. Just mentioning in case you are not aware of it. |
main_wayland.cpp | ||
---|---|---|
642 | Makes sense to me. I'll do that change. | |
wayland_server.cpp | ||
373 | I started doing the relevant surface scaling, but that's quite a bit more complex than it might first appear (and the Qt QPA needs multiple patches...) so I need to split this into multiple smaller parts. Personally, I think setting this now is fine because I haven't implemented anything in the DRM backend, so this is only going to affect kwin when this config option is explicitly set. |
plugins/platforms/x11/windowed/x11windowed_backend.cpp | ||
---|---|---|
477–480 | QVector<T> &QVector::fill(const T &value, int size = -1) Assigns value to all items in the vector. If size is different from -1 (the default), the vector is resized to size size beforehand. |
WIP: high DPI scaling support in kwin.
Surface events are all normalised by surface_scale
Output is normalised to output_scale
From a kwin POV this means:
This branch adds support for qpainter in x11windowed. It will be expanded over time.
DO NOT MERGE AS-IS.
plugins/platforms/x11/windowed/x11windowed_backend.cpp | ||
---|---|---|
201–202 | QPointF supports operator/, so that should be possible to simplify a bit. | |
232–233 | same here | |
368–369 | and here | |
scene_qpainter.cpp | ||
311–313 ↗ | (On Diff #7966) | I don't understand how the scaling comes in here? |
321 ↗ | (On Diff #7966) | paintSubSurface probably also needs the adjustment |
shell_client.cpp | ||
392 ↗ | (On Diff #7966) | removing that line will break internal windows such as Alt+Tab, etc. etc on SceneOpenGL |
scene_qpainter.cpp | ||
---|---|---|
311–313 ↗ | (On Diff #7966) | I'm harnassing QPainter's internal scaling. The old code: painter->drawImage(toplevel->clientPos(), pixmap->image(), src); internally is: painter->drawImage(QRect(toplevel->clientPos(), pixmap->image().size()), pixmap->image() My patch changes that to: painter->drawImage(QRect(toplevel->clientPos(), topLevel->clientSize()), pixmap->image(), So no matter how big or small pixmap->image is, it will be scaled to fit the client size. |
scene_qpainter.cpp | ||
---|---|---|
311–313 ↗ | (On Diff #7966) | ah so that's basically the "scale everything up" if output has a scale, but not yet the "surface has a scale of 2"? |
scene_qpainter.cpp | ||
---|---|---|
311–313 ↗ | (On Diff #7966) | What this code is doing is painting in output normalised space; no matter what size buffer the surface happens to have. Conversion from output normalised to hardware pixels happens in this (pre-existing line) m_painter->setWindow(geometry); Previously this was just a translation, however, because I we create the buffer size*scale , this has a scale too. So for a 2x buffer on a 1x screen, we scale the image down in this line |
Add a scale method to the backends and proxy this to wl_output
Also add a --scale argument for testing