Reduce the cost of querying window positions to the x server.
Categories
(Core :: Widget, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: nical, Assigned: nical)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Converting from widget-local to screen coordinates is very expensive on x11 because it has to issue a blocking message to the x server to query the window position, and that call can block for arbitarily long times if the compositor is busy.
Also I believe wayland expects you to only deal in window-local coordinates.
Comment 1•5 years ago
|
||
Is caching the window screen position something feasible?
Assignee | ||
Comment 2•5 years ago
|
||
Masayuki, I'm told you know your way around the event handling code.
Comment 3•5 years ago
|
||
Yeah, I think that nsWindow
should cache the screen position and it should be updated when widget is moved. Then, WidgetEvent
should store screen coordinates. I bet that our Event.screenX
etc do wrong thing:
https://searchfox.org/mozilla-central/rev/dc4560dcaafd79375b9411fdbbaaebb0a59a93ac/dom/events/Event.cpp#531-561
They computes latest position of the event. But I think that they should return screen coordinates at the event is synthesized. Especially this works odd when an event is cached to a variable in JS.
(I still don't check other browsers' behavior yet, though.)
smaug: Any thoughts?
Comment 4•5 years ago
|
||
Ah, but this bug reports only for the first thing, I found these lines:
https://searchfox.org/mozilla-central/rev/dc4560dcaafd79375b9411fdbbaaebb0a59a93ac/widget/gtk/nsWindow.cpp#2349,2353
https://searchfox.org/mozilla-central/rev/dc4560dcaafd79375b9411fdbbaaebb0a59a93ac/widget/gtk/nsWindow.cpp#3063,3072-3073
Comment 5•5 years ago
|
||
Caching window position should be doable. Don't BrowserChilds already do that in child processes?
Assignee | ||
Updated•4 years ago
|
Comment 6•4 years ago
|
||
Also I believe wayland expects you to only deal in window-local coordinates.
There is no global coordinate space at all in Wayland. There are only per-surface local coordinate spaces.
Assignee | ||
Comment 7•4 years ago
|
||
Updated•4 years ago
|
Comment 8•4 years ago
|
||
I think it would be a good idea to rename this bug to match the patch, or to move the patch to a new bug.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Comment 10•4 years ago
|
||
bugherder |
Comment 11•4 years ago
|
||
Should this be backed out from beta because of the regressions?
Assignee | ||
Comment 12•4 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #11)
Should this be backed out from beta because of the regressions?
Either that or uplifting the most recent patch of bug 1652743 which is equivalent to backing this out and another patch that landed on top of it.
Description
•