On Sun, May 13, 2018 at 5:34 PM, Martin Flöser <mgraess...@kde.org> wrote: > Am 2018-05-09 12:08, schrieb Aleix Pol: >> >> On Tue, May 8, 2018 at 8:57 PM, Martin Flöser <mgraess...@kde.org> wrote: >>> >>> >>> >>> Am 8. Mai 2018 17:05:57 MESZ schrieb Aleix Pol <aleix...@kde.org>: >>>> >>>> Hi, >>>> I've been looking into getting a consistent cursor look on wayland, >>>> which is specially daunting because of scaling. >>>> >>>> I'd like to look into fixing it for xwayland clients. Would somebody >>>> be able to shed some light into the issue so I can understand it and >>>> fix it? >>>> >>> Xwayland clients use the normal X11 API to set cursors. Xwayland just >>> forwards them through the Wayland protocol. The env variable for cursor size >>> is the same on Wayland and X11, so there should not be any difference. >>> >>> I'm not sure what exactly you want to look into. Personally I had the >>> feeling that apps started to act crazy concerning cursor sizes - on Wayland >>> and on X11. Normally there just should not be any difference. There's one >>> env variable controlling it and if all apps would just use it and not do >>> crazy stuff instead it would just work. >> >> >> Well, setting the cursor size isn't any useful if you have two >> monitors. I have it configured at resolution-dependent at the moment >> and sometimes I lose my cursor on my high dpi screen. >> If I use something bigger, when I move it to my external monitor I get >> a monstrosity. >> >> David mentioned at the sprint that we maybe should be correcting its >> scale on the kwin size, if it's not being scaled yet. > > > This might be part of the solution. This needs a more general solution and > might require changes to Wayland protocols and each toolkit and KWin. > > For "normal" windows we use the wl_surface::enter to inform on which output > they are. Thus they can adjust for different dpi. Similar there is the scale > information on a wl_surface. > > For a cursor wl_surface KWin neither emits the output information nor uses > the scale information. Both would be relative easy to implement. But only > makes sense if toolkits support it. Last time I looked at Qt code, Qt did > not (but that's some time ago). > > So to get this properly working, I would suggest to add the output > enter/leave information to cursor surfaces and honor scale in KWin. Then add > the same to QtWayland if it doesn't exist already. > > Cheers > Martin
The scale information should already be available in the surface, and if it's not, then it should be added: https://codereview.qt-project.org/#/c/227665/ Still we need to use this information. Aleix