Closed Bug 1605724 Opened 5 years ago Closed 5 years ago

[GTK] Dialog boxes are shrank after Bug 1602939

Categories

(Core :: Widget: Gtk, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla74
Tracking Status
firefox-esr68 --- unaffected
firefox72 --- unaffected
firefox73 --- fixed
firefox74 --- fixed

People

(Reporter: stransky, Assigned: emilio)

References

(Blocks 1 open bug, Regressed 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(3 files)

Attached image dialog.png

Dialog boxes on Wayland are shrank on Wayland after Bug 1602939, see the attached picture.

Priority: -- → P2

This happens also on X11.

This is because the icon hasn't loaded by the time we size the popup, and when it loads it makes stuff wrap.

This is what I'm seeing in bug 1606617.

See Also: → 1606617

Tim, applying this rule to GTK too fixes it.

It changes the sizes of the icons a bit though. An alternative would be to use an HTML <img> instead of list-style-image, as that'd block onload and we'd have a known point in time where we can call SizeToContent.

Alternatively we could probably override nsImageFrame::GetIntrinsicSize so that it works more like <html:img> and interacts better with HTML layout.

Thoughts?

Flags: needinfo?(ntim.bugs)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #2)

Tim, applying this rule to GTK too fixes it.

It changes the sizes of the icons a bit though.

That's my main concern, it may also be possible that different GTK distros have different icon sizes.

An alternative would be to use an HTML <img> instead of list-style-image, as that'd block onload and we'd have a known point in time where we can call SizeToContent.

I thought about that, but unfortunately, each platform uses a different image, so we'd have to duplicate the .question-icon CSS, but adapted for HTML <img>.

Alternatively we could probably override nsImageFrame::GetIntrinsicSize so that it works more like <html:img> and interacts better with HTML layout.

That sounds fine to me, but I don't know much about how much breakage this would cause. I guess you'll know more about this solution :)

Flags: needinfo?(ntim.bugs)

https://hg.mozilla.org/mozilla-central/rev/234701139a2a61d1262e609c9d8ac42384ecafda

Removed the following CSS rule:

#iconContainer {
-moz-box-pack: center;
min-height: 55px; /* maximum icon height + icon margin /
min-width: 58px; /
maximum icon width + icon margin */
}

Which enforced the size of the icon row.

The icon loads asynchronously, so by the first time we fire DOMContentLoaded it
may not have loaded yet. This means that sizeToContent() will size the window to
an smaller size and stuff will wrap around when it loads.

<image> doesn't block onload so even delaying this wouldn't work.

Instead, call sizeToContent() again when it loads so that we size the window
right again.

Alternatively / on top of this, we could add a wrapper around the <image>
again and fix its width, may be better too...

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Summary: [Wayland] Dialog boxes are shrank after Bug 1602939 → [GTK] Dialog boxes are shrank after Bug 1602939

https://hg.mozilla.org/mozilla-central/rev/234701139a2a61d1262e609c9d8ac42384ecafda

Removed the following CSS rule:

#iconContainer {
-moz-box-pack: center;
min-height: 55px; /* maximum icon height + icon margin /
min-width: 58px; /
maximum icon width + icon margin */
}

Which enforced the size of the icon row.

The icon loads asynchronously, so by the first time we fire DOMContentLoaded it
may not have loaded yet. This means that sizeToContent() will size the window to
an smaller size and stuff will wrap around when it loads.

<image> doesn't block onload so even delaying this wouldn't work.

Restore the wrapper to ensure loading the icon or not doesn't affect layout of
the dialog.

Dao, ni? for https://phabricator.services.mozilla.com/D58704#1790630. I think that path is fine to land for now regardless anyway but I wanted your opinion.

Flags: needinfo?(dao+bmo)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #6)

Dao, ni? for https://phabricator.services.mozilla.com/D58704#1790630. I think that path is fine to land for now regardless anyway but I wanted your opinion.

Replied there

Flags: needinfo?(dao+bmo)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7e410d72f9b0
Call sizeToContent() again when the icon loads if it hasn't loaded yet. r=dao
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74

This bug affects Firefox 73 beta, although I only see it with the Wayland backend. Do you think this is a "wontfix" for the 73 release?

(In reply to Viktor Jägersküpper from comment #10)

This bug affects Firefox 73 beta, although I only see it with the Wayland backend. Do you think this is a "wontfix" for the 73 release?

No, we should probably uplift it, specially now that's early enough. Thanks for the reminder.

Comment on attachment 9118691 [details]
Bug 1605724 - Call sizeToContent() again when the icon loads if it hasn't loaded yet. r=dao,ntim

Beta/Release Uplift Approval Request

  • User impact if declined: dialogs appear cut off on Linux (at least with gtk + wayland, but I could repro on kde too).
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: comment 0
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Sizes the dialog again when the layout changes.
  • String changes made/needed: none
Attachment #9118691 - Flags: approval-mozilla-beta?
Attachment #9118692 - Flags: approval-mozilla-beta?
Attachment #9118692 - Flags: approval-mozilla-beta?

Comment on attachment 9118691 [details]
Bug 1605724 - Call sizeToContent() again when the icon loads if it hasn't loaded yet. r=dao,ntim

Fix for mis-sized dialog boxes on Linux. Approved for 73.0b3.

Attachment #9118691 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f81ec1f37a25
Ensure loading the dialog icons doesn't change over-all layout. r=dao

In an attempt to reproduce the issue for a proper fix verification, we were unable to reproduce the issue on our available setups. (Ubuntu16/Ubuntu 18/Ubuntu19).
With a clean Fedora31 on a VM, I've noticed the window exhibiting the issue for a fraction of a second before jumping to the proper size before resizing to the proper values.

In regards to this, clearing the qe+ flag since the issue appears to not affect vanilla versions of the OS.

@Martin, if your team could provide an image with wayland set up we could load it on a virtual machine.
For this, probably your confirmation if this is fixed on the current builds would suffice.

Flags: qe-verify+ → needinfo?(stransky)

(In reply to Cristian Fogel, QA [:cfogel] from comment #17)

With a clean Fedora31 on a VM, I've noticed the window exhibiting the issue for a fraction of a second before jumping to the proper size before resizing to the proper values.

Fedora 31 / Gnome is a good testcase, Wayland is enabled by default there.

Flags: needinfo?(stransky)

I tested latest nightly and looks fixed to me.

Status: RESOLVED → VERIFIED
Regressions: 1633806
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: