This is a workaround for https://gitlab.gnome.org/GNOME/gtk/issues/1395
Gtk+ controls window active appearance by window-state-event signal
but gecko uses focus-in/out signals.
So we need to set the the titlebar state
when window-state-event comes *after* focus-in/out signals.
Differential Revision: https://phabricator.services.mozilla.com/D13051
--HG--
extra : moz-landing-system : lando
Keep our old 'progressbar' as an alias for now, but unship
'progresschunk' by restricting it to UA/chrome sheets only.
Unship 'progresschunk-vertical' by removing it since it's
not used internally for anything.
This is based on patch by Mike Conley (:mconley)
The left/right toolbox placement can be adjusted later as we know at toolkit level where the buttons are
so we can set border/padding accordingly.
Depends on D8529
Differential Revision: https://phabricator.services.mozilla.com/D8549
--HG--
extra : moz-landing-system : lando
This saves one word per static atom, per process.
The `nsGkAtoms` change is only a small part of this commit.
In regen_atoms.py:
- There is now only one link name per platform: nsGkAtoms::sAtoms[].
- But there is a new constant per atom, giving the index into
nsGkAtoms::sAtoms[].
- And the `atom!` macro for each atom indexes into nsGkAtoms::sAtoms[] using
the index constant.
- A couple of `*mut` pointers are now `*const`.
Elsewhere, the `(nsStaticAtom*)` casts within the `AppendElement()` calls are
necessary to avoid link errors, presumably due to some template instantiation
wrinkle.
--HG--
extra : rebase_source : 629642e708c8bc6e27d6057beae5f35955fdd837
When any scrollbar color is specified, or scrollbar-width is thin, we
switch to use the fallback rendering.
The change to xulscrollbars.css is for ensuring that the scrollbar is
displayed for scrollbar-width: thin when there is no scrollbar color
specified. It wouldn't affect cases where -moz-appearance takes effect.
This also changes the fallback width of the scrollbars. Since the two
widths was picked rather randomly, I think it should be fine to change
it if a value looks better than the old one, especially on Linux which
is the main usecase for this fallback rendering.
Differential Revision: https://phabricator.services.mozilla.com/D3952
--HG--
extra : moz-landing-system : lando
The '-moz-menulist-button' value currently behavies identically to the
'menulist-button' value. This is not implemented as an alias because later
patches in this patch series will change the behavior of our pre-existing
'menulist-button' value to more closely match what Chrome does.
The '-moz-menulist-button' value currently behavies identically to the
'menulist-button' value. This is not implemented as an alias because later
patches in this patch series will change the behavior of our pre-existing
'menulist-button' value to more closely match what Chrome does.
--HG--
extra : rebase_source : b66bf6427db5be2eb12f4e0aa36d22a4da46555a
This builds on bug 1428676 and introduces StyleAppearance, which replaces the
NS_THEME_* constants.
Really sorry for the size of the patch.
There's a non-trivial change in the gtk theme, which I submitted separately as
bug 1478385.
Differential Revision: https://phabricator.services.mozilla.com/D2361
MozReview-Commit-ID: DiSmMWK7Krp
aWidgetType is a NS_THEME_* constant. What this code is comparing is not.
This was exposed by a patch of mine converting -moz-appearance to be an enum
class.
MozReview-Commit-ID: 9BsbYk04vop
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.
MozReview-Commit-ID: 5UQVHElSpCr
--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
This patch implements a workaround which alows us to emulate
overlay scrollbars for some Gtk+ themes (Ubuntu/Ambiance),
when an inactive scrollbar thumb is smaller than the active one.
We calculate thumb margin as thumb class margin + difference margin
between active and inactive scrollbars.
Also remove boolean parameter from GetScrollbarMetrics() and implement
GetActiveScrollbarMetrics() to get metrics for active scrollbar.
MozReview-Commit-ID: 2zje5OZskYw
--HG--
extra : rebase_source : dd50dc52d9d0942c9dcfbf72d217f3c6ee82c21a
Ubuntu/Ambiance has tiny scrollbars when it's not hovered by mouse and large
ones when it's hovered/active. Our current Gtk+ toolkit code does not support such scrollbar
resize on the fly.
We use a workaround as we get size of active (hovered) scrollbar only and that
we pass to gecko. Then we draw scrolbar smaller when it's not hovered and full sized
when it's hovered.
MozReview-Commit-ID: mxt9q5Bcg9
--HG--
extra : rebase_source : f77304653f730ea1bca6fb453568f945b022c442
This function doesn't use any StackingContextHelper state anymore.
We should make what it does clearer and move it to a better place.
--HG--
extra : rebase_source : 1727be9657169547d842ec9b6887837abedbefdf
Currently we can only have one type of WebRenderUserData on an Item. We already
have a hash table of WebRenderUserData so it's not hard to include type in the
hash to support one per type.
MozReview-Commit-ID: geJ0BeWv8b
Some themes (Ambiance for instance) uses first-child/last-child css selectors
to style titlebar buttons. Ubuntu Ambiance theme places titlebar buttons closer
by negative margin applied to them.
We put titlebar buttons to GtkBox as well as Gtk+ does and also keep
the button order here to match first-child/last-child selectors. It also means
we must have maximize/restore as one button to keep the correct order.
MozReview-Commit-ID: 9mqljOa4Vu7
--HG--
extra : rebase_source : 9c31a2073d1bb247ce9d0240333143661b8ae4b8
A lot of "WARNING: Invalid monitor scale: -1" appering for the puppet widget since
fix for bug 1439881 landed. We don't need to print the warning, fallback to 1 is
sufficient enough.
MozReview-Commit-ID: 73BGc8neUmu
--HG--
extra : rebase_source : 74b2a818a29514095b5c56b05966cff5e4e9ba60
Because of rounding errors there's a change that returned monitor scale
is 0. That would lead to SIGFPE because it's later used in division.
MozReview-Commit-ID: 4d7nHaBm4XG
--HG--
extra : rebase_source : d7fb5c64698d1e99afc223d401b30e0eb168fdb4
This fixes regression introduced by hidpi support for wayland in
case devPixelsPerPx is set (bug 1431337).
MozReview-Commit-ID: DOh0aTcxbVG
--HG--
extra : rebase_source : ac3ac449a99e0123b8a64ea36f25d312bb3c4483
We need to use scaling factor of the monitor on which application is actually positioned.
Previously we used ScreenHelperGTK::GetGTKMonitorScaleFactor() which use the first monitor.
This does not work on hidpi+normal dpi monitors setup.
The GetSystemFontInfo() cannot return scaled value of the font by default monitor
scale factor. We need to scale it in nsLookAndFeel::GetFontImpl
by aDevPixPerCSSPixel like implementation for Windows does.
We also need to check layout.css.devPixelsPerPx because we cannot
scale per monitor when this preference is set to positive number.
MozReview-Commit-ID: AwT2NvkEqvz
--HG--
extra : rebase_source : 5b956a6abd7d215b06ebcd8c56e34c038d012940
We need to use scaling factor of the monitor on which application is actually positioned.
Previously we used ScreenHelperGTK::GetGTKMonitorScaleFactor() which use the first monitor.
This does not work on hidpi+normal dpi monitors setup.
The GetSystemFontInfo() cannot return scaled value of the font by default monitor
scale factor. We need to scale it in nsLookAndFeel::GetFontImpl
by aDevPixPerCSSPixel like implementation for Windows does.
We also need to check layout.css.devPixelsPerPx because we cannot
scale per monitor when this preference is set to positive number.
MozReview-Commit-ID: AwT2NvkEqvz
--HG--
extra : rebase_source : 36d64957e017486d99c4302346ab64e47b5e2cc6
Render titlebar button icons as a part of -moz-window-button-* appearence. It allows us to
theme the icons accordingly. We add a GtkImage widget to header bar buttons as Gtk+ does and
store icon pixel data there and render it at moz_gtk_header_bar_button_paint() as a part
of the buttons. It means that the toolbar buttons are not containers and
moz_gtk_get_widget_border() returns zero border for them.
Also implement GetToolbarButtonMetrics() per button.
MozReview-Commit-ID: gkAu3VmE3q
--HG--
extra : rebase_source : d1df34537901342969d1e33524b414a2786df541