You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think hit testing is broken in general, I see this behavior on every site. I think it may be related to hidpi screens; servo thinks the mouse is in the center of the window when its actually on the far right.
It looks like something has changed to do with how / where DPI scaling is applied, either in Servo or in Glutin / Winit. Specifically, in the hit test method in compositor.rs, we receive a DevicePoint but debug logs suggest that it is actually not a true device point, but has the DPI scale un-applied.
This appears to fix hit testing on my Linux machine in the tests I've tried thus far.
@jdm or @cbrewster Would you be able to check if this also fixes it on a Mac?
If it does, the proper fix will involve working out what changed and either restoring the previous behavior (so we are getting a true DevicePoint in this method) or modifying the method and signatures to reflect that it is no longer a DevicePoint. We'll still need to handle other scale factors, such as page zoom, which I've ignored in the patch above for now.
@jdm OK, I confirmed the issue is from #21087. It looks like winit now returns events in logical units, rather than device units. That patch will need to be re-worked in order to handle this - it looks like it gets logical / device units confused in a few places, by constructing those types directly from the scalar values, I think.
Activity
cbrewster commentedon Jul 12, 2018
I think hit testing is broken in general, I see this behavior on every site. I think it may be related to hidpi screens; servo thinks the mouse is in the center of the window when its actually on the far right.
gw3583 commentedon Jul 12, 2018
I can also reproduce this on Linux - I'll investigate today.
gw3583 commentedon Jul 12, 2018
It looks like something has changed to do with how / where DPI scaling is applied, either in Servo or in Glutin / Winit. Specifically, in the hit test method in
compositor.rs, we receive aDevicePointbut debug logs suggest that it is actually not a true device point, but has the DPI scale un-applied.As a quick hack, I applied the following patch:
This appears to fix hit testing on my Linux machine in the tests I've tried thus far.
@jdm or @cbrewster Would you be able to check if this also fixes it on a Mac?
If it does, the proper fix will involve working out what changed and either restoring the previous behavior (so we are getting a true DevicePoint in this method) or modifying the method and signatures to reflect that it is no longer a DevicePoint. We'll still need to handle other scale factors, such as page zoom, which I've ignored in the patch above for now.
jdm commentedon Jul 13, 2018
@gw3583 Yes, that patch fixes the issue for me as well.
atouchet commentedon Jul 13, 2018
This might be due to the winit/glutin update in #21087. There were some HiDPI changes there: https://github.com/tomaka/winit/blob/master/CHANGELOG.md
gw3583 commentedon Jul 16, 2018
@jdm OK, I confirmed the issue is from #21087. It looks like winit now returns events in logical units, rather than device units. That patch will need to be re-worked in order to handle this - it looks like it gets logical / device units confused in a few places, by constructing those types directly from the scalar values, I think.
jdm commentedon Jul 16, 2018
Thanks for investigating!
jdm commentedon Jul 17, 2018
This change fixed the hit testing for me.
Auto merge of #21190 - jdm:lets-get-physical, r=gw3583
Auto merge of #21190 - jdm:lets-get-physical, r=gw3583