Re: Cursor sizes on wayland
Am 8. Mai 2018 17:05:57 MESZ schrieb Aleix Pol : >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. Cheers Martin
Re: Cursor sizes on wayland
On Tue, May 8, 2018 at 8:57 PM, Martin Flöser wrote: > > > Am 8. Mai 2018 17:05:57 MESZ schrieb Aleix Pol : >>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. Aleix
Re: Cursor sizes on wayland
On Wed, May 9, 2018 at 12:08 PM, Aleix Pol wrote: > On Tue, May 8, 2018 at 8:57 PM, Martin Flöser wrote: >> >> >> Am 8. Mai 2018 17:05:57 MESZ schrieb Aleix Pol : >>>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. > > Aleix Ping? Am I not making sense? Aleix
Re: Cursor sizes on wayland
Am 2018-05-09 12:08, schrieb Aleix Pol: On Tue, May 8, 2018 at 8:57 PM, Martin Flöser wrote: Am 8. Mai 2018 17:05:57 MESZ schrieb Aleix Pol : 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
Re: Cursor sizes on wayland
On Sun, May 13, 2018 at 5:34 PM, Martin Flöser wrote: > Am 2018-05-09 12:08, schrieb Aleix Pol: >> >> On Tue, May 8, 2018 at 8:57 PM, Martin Flöser wrote: >>> >>> >>> >>> Am 8. Mai 2018 17:05:57 MESZ schrieb Aleix Pol : 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
Re: Cursor sizes on wayland
We definitely need to scale the cursor image to device pixels in DRM Output. That's code we need to add that I simply haven't done yet; it wasn't a high priority as we also have the concept of just cursors being bigger X-style. Your Qt patch will allow us to do that whilst keeping assets drawn in native resolutions. > 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). I think having cursors match the surface is absolutely fine (Qt's current state). If everything was working properly in the worst case it gets upscaled/downscaled, but should still be the same size on screen. --- However, that's all somewhat unrelated to the bug Aleix showed me. Me not implementing wl_output style scaling would put the cursor simply always too small or always too big. Especially as Qt didn't do anything at the time. Yet we saw it bounce about all over the place. That seems more a bug of the X-style scaling David
Re: Cursor sizes on wayland
On Mon, May 14, 2018 at 7:42 PM, David Edmundson wrote: > We definitely need to scale the cursor image to device pixels in DRM Output. > That's code we need to add that I simply haven't done yet; it wasn't a high > priority as we also have the concept of just cursors being bigger X-style. > Your Qt patch will allow us to do that whilst keeping assets drawn in native > resolutions. > >> 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). > > I think having cursors match the surface is absolutely fine (Qt's current > state). If everything was working properly in the worst case it gets > upscaled/downscaled, but should still be the same size on screen. > > --- > > However, that's all somewhat unrelated to the bug Aleix showed me. > > Me not implementing wl_output style scaling would put the cursor simply > always too small or always too big. Especially as Qt didn't do anything at > the time. > Yet we saw it bounce about all over the place. That seems more a bug of the > X-style scaling > > David I don't think the scaling of the cursor matches the scaling of the client. I can clearly see the cursor twice the size on the low dpi screens while windows are about as big. Aleix