Closed Bug 1450279 Opened 4 years ago Closed 4 years ago

Replace CAN_DRAW_IN_TITLEBAR with a run-time check

Categories

(Firefox :: Toolbars and Customization, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 61
Tracking Status
firefox61 --- fixed

People

(Reporter: dao, Assigned: dao)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Currently we show the title bar checkboxes even for Gtk versions where we can't draw in the title bar. We should hide them in that case.
(Sorry, public holidays here, I won't be able to review this before Tuesday.)
Comment on attachment 8963970 [details]
Bug 1450279 - Replace CAN_DRAW_IN_TITLEBAR with a run-time check.

https://reviewboard.mozilla.org/r/232782/#review238698

::: browser/base/content/browser-tabsintitlebar.js:69
(Diff revision 1)
> +      case "windows":
> +      case "cocoa":
> +        isSupported = true;
> +        break;
> +      case "gtk3":
> +        isSupported = window.matchMedia("(-moz-gtk-csd-available)");

It's unfortunate we don't have an easy way to share this across windows, to avoid each window checking the media query itself...

::: browser/components/customizableui/CustomizeMode.jsm:105
(Diff revision 1)
>  
>    // There are two palettes - there's the palette that can be overlayed with
>    // toolbar items in browser.xul. This is invisible, and never seen by the
>    // user. Then there's the visible palette, which gets populated and displayed
>    // to the user when in customizing mode.
> -  this.visiblePalette = this.document.getElementById(kPaletteId);
> +  this.visiblePalette = this.$(kPaletteId);

Can you file a good-first-bug to update the remaining uses of `this.document.getElementById` in CustomizeMode.jsm to use this new helper thing?
Attachment #8963970 - Flags: review?(gijskruitbosch+bugs) → review+
Pushed by dgottwald@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9fe6dc8bc9f0
Replace CAN_DRAW_IN_TITLEBAR with a run-time check. r=Gijs
https://hg.mozilla.org/mozilla-central/rev/9fe6dc8bc9f0
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 61
Blocks: 1451242
You need to log in before you can comment on or make changes to this bug.