commit 818526928e5bcc6a1d6b5eba96090e17d1f48f42
parent cb259a99960bbaf565ec620e1d84ee6d2767c936
Author: stransky <stransky@redhat.com>
Date: Wed, 10 Dec 2025 09:43:55 +0000
Bug 2004363 [Linux] Log correctly rounded coordinates r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D275210
Diffstat:
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
@@ -4235,11 +4235,14 @@ gboolean nsWindow::OnShellConfigureEvent(GdkEventConfigure* aEvent) {
#ifdef MOZ_LOGGING
if (LOG_ENABLED()) {
- auto scale = FractionalScaleFactor();
- LOG("nsWindow::OnShellConfigureEvent() [%d,%d] -> [%d x %d] scale %.2f "
- "(scaled size %.2f x %.2f)\n",
- aEvent->x, aEvent->y, aEvent->width, aEvent->height, scale,
- aEvent->width * scale, aEvent->height * scale);
+ auto widgetArea =
+ DesktopIntRect(aEvent->x, aEvent->y, aEvent->width, aEvent->height);
+ auto scaledWidgetArea = ToLayoutDevicePixels(widgetArea);
+ LOG("nsWindow::OnShellConfigureEvent() [%d, %d] -> [%d x %d] scale %.2f "
+ "(scaled size %d x %d)\n",
+ widgetArea.x, widgetArea.y, widgetArea.width, widgetArea.height,
+ FractionalScaleFactor(), scaledWidgetArea.width,
+ scaledWidgetArea.height);
}
#endif
@@ -4265,15 +4268,19 @@ gboolean nsWindow::OnShellConfigureEvent(GdkEventConfigure* aEvent) {
}
void nsWindow::OnContainerSizeAllocate(GtkAllocation* aAllocation) {
- LOG("nsWindow::OnContainerSizeAllocate [%d,%d] -> [%d x %d] scaled [%.2f] "
- "[%.2f x %.2f]",
- aAllocation->x, aAllocation->y, aAllocation->width, aAllocation->height,
- FractionalScaleFactor(), aAllocation->width * FractionalScaleFactor(),
- aAllocation->height * FractionalScaleFactor());
-
mHasReceivedSizeAllocate = true;
mReceivedClientArea = DesktopIntRect(aAllocation->x, aAllocation->y,
aAllocation->width, aAllocation->height);
+#ifdef MOZ_LOGGING
+ if (LOG_ENABLED()) {
+ auto scaledClientAread = ToLayoutDevicePixels(mReceivedClientArea);
+ LOG("nsWindow::OnContainerSizeAllocate [%d,%d] -> [%d x %d] scaled [%.2f] "
+ "[%d x %d]",
+ aAllocation->x, aAllocation->y, aAllocation->width, aAllocation->height,
+ FractionalScaleFactor(), scaledClientAread.width,
+ scaledClientAread.height);
+ }
+#endif
// Bounds will get updated on the main configure.
// Gecko permits running nested event loops during processing of events,