This removes some code which was creating new Objective C classes at runtime.
I originally wrote this code because NSVisualEffectView was a new class that
was added in 10.10, and we were building with a pre-10.10 SDK.
These days we build with the 10.11 SDK, which has NSVisualEffectView, and we
only run on 10.12+.
Differential Revision: https://phabricator.services.mozilla.com/D94622
- Make WaylandAllocateShmMemory() fallible.
- Implement WaylandReAllocateShmMemory() to re-allocate Shm pool.
- Remove WaylandShmPool::Resize() and use WaylandShmPool::Create() only.
- Implement and use WaylandShmPool::Release().
- Make WindowSurfaceWayland::CreateWaylandBuffer() as fallible.
Differential Revision: https://phabricator.services.mozilla.com/D94735
Non wayland unified builds end up with a different set of files
combined which ends up causing the conflict. Remove the 'using namespace
mozilla::gfx' to avoid this.
Differential Revision: https://phabricator.services.mozilla.com/D94825
This should make the optimization landed earlier in this bug apply for
some of the NotifyThemeChanged() calls in nsWindow.cpp which are causing
all the extra invalidations.
If we know that system colors/fonts didn't change, we can avoid doing a
bunch of reflow work and the patch from earlier in the bug can avoid
re-rasterizing images too.
Differential Revision: https://phabricator.services.mozilla.com/D94425
Detect GPUs on Apple Silicon Macs using the AGXAccelerator IOService similarly to Chromium's method.
This may need updating for future Apple Silicon hardware, but works with the device on the DTK.
Differential Revision: https://phabricator.services.mozilla.com/D93120
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Rather than wrapping an NSPrintInfo in nsPrintSettingsX, where we then have two
(potentially conflicting) sources of truth about various settings, we treat the
settings in the base nsPrintInfo class as authoritative, and just apply them to
a temporary NSPrintInfo when needed to interact with platform APIs.
Differential Revision: https://phabricator.services.mozilla.com/D92966
This is regression by bug 1672095. `GeckoEditableSupport` expects that
NOTIFY_IME_OF_BLUR is always sent. I would like to allow this even if
IME content observer is being destroyed.
To reproduce this, we have to lost application focus, I cannot write
geckoview-junit test.
Differential Revision: https://phabricator.services.mozilla.com/D94414
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Patch by Bernard Igiri <bigiri@mozilla.com>
Replacing async events with async method calls that use JSWindowActors to communicate with the parent process.
This will simplify these calls, bring the relevant code into local scope, and eliminate the need for MessageChannel.
Eliminating the MessageChannel dependency allows us to move the ASRouter initialization out of ASRouterFeed and into
JSWindowActors.
Differential Revision: https://phabricator.services.mozilla.com/D71796
The latest launcher process ping showed one of the reasons why we failed to
detour `NtMapViewOfSection` is that `MMPolicyBase::FindRegion` failed to find
a free region. Inspecting the function carefully, there were three problems.
Firstly, `FindRegion` did not fully scan the given range. To randomize
the address of a free region we use, we start scanning from a random address
within the given range. The problem is we scan only addresses bigger than
that random address, without scanning smaller addresses. Probably this is
the reason why `FindRegion` fails.
Secondly, `FindRegion` may return an address not aligned with the allocation
granularity because `VirtualQueryEx` returns such an address. If that happens,
the subsequent mapping API fails with the alignment error.
Lastly, when we randomize an address to start scanning from, we divide a random
number by `maxOffset`, but with that, we never start scanning from the last
region. It does not affect the product's behavior, but to have fair randomization,
a divisor should be `maxOffset + 1`.
This patch fixes all of these three problems along with a new test program.
Differential Revision: https://phabricator.services.mozilla.com/D94110
Similar to bug 1280653, it appears that GLX invalidates the back buffer
while we are drawing. The only indication we get of this are resize and
configure events from X. We suppress the configure event for popups for
various reasons, so this patch explicitly generates a forced recomposite
of the frame. It does it immediately so that most of the time it should
beat the presentation of the buffer and avoid displaying of the bad
frame to the user; popups generally are not complicated and should have
plenty of budget to perform the second composite.
Differential Revision: https://phabricator.services.mozilla.com/D93862
After Bug 1669239, The way we use `PuppetWidget::Paint` starts to be
more async. For instance, `PuppetWidget::Invalidate` will schedule
an async `PaintTask`, when the `PaintTask` runs, it'll request
the next `Tick` to paint which is also async.
It starts to cause some tests to fail because of the timing. This
patch just improves the overall usage to be less async.
Differential Revision: https://phabricator.services.mozilla.com/D93855
For Big Sur toolbar search fields, don't return YES from _isToolbarMode(). And adjust the search field border for better spacing after the search icon.
Differential Revision: https://phabricator.services.mozilla.com/D93705
Draw toolbar button segment backgrounds manually on Big Sur to workaround a problem where they are filled with the toolbar gradient.
Differential Revision: https://phabricator.services.mozilla.com/D93578
Otherwise on Windows, we have a ColorID::Scrollbar but not any of the other scrollbar part
colors, and the Windows-provided value for Scrollbar doesn't work well
with the default values for the other scrollbar parts that come from the
non-native theme.
Differential Revision: https://phabricator.services.mozilla.com/D93728
This removes the CoreUI draw calls for scrollbars.
We already have code to manually draw scrollbars, which is used to support the
scrollbar-color CSS property. But this code was only used for non-overlay
scrollbars in the past, because scrollbar-color only affects non-overlay scrollbars.
This patch adjusts that custom drawing code to work for overlay scrollbars as well.
It computes the correct sizes, positions, and colors, to match native scrollbars.
The scrollbar track drawing code is changed from "background fill with strokes on
top" to "multiple adjacent non-overlapping filled rectangle segments" so that it
works better with translucent track colors.
Differential Revision: https://phabricator.services.mozilla.com/D93715
Currently, `IMEStateManager` sets `InputContext` to disable IME when the
menu keyboard event listener is installed, but does not destroy
`IMEContentObserver` which may be in a remote process. And similarly,
it setns `InputContext` to enable IME when the menu keyboard event listener
is uninstalled, but does not make `IMEContentObserver` which may be in a remote
process send `NOTIFY_IME_OF_FOCUS` again. Therefore, from point of view of
native IME handlers in widget, `NOTIFY_IME_OF_FOCUS` won't be sent in this
case, but `TSFTextStore::SetInputContext()` expects that it'll be followed
by `NOTIFY_IME_OF_FOCUS` unless it's called for `FOCUS_NOT_CHANGED`.
Therefore, `sEnabledTextStore` is `nullptr` when this bug occurs.
For fixing this bug **quickly**, this patch makes
`TSFTextStore::SetInputContext()` treat `MENU_LOST_PSEUDO_FOCUS` as
`FOCUS_NOT_CHANGED` to create `TSFTextStore` instance if new state is
"enabled".
Ideally, we should redesign `IMEStateManager` because while menu keyboard
event listener has pseudo focus, web apps may change focus or create something
complicated cases.
Unfortunately, we still cannot write automated tests for `TSFTextStore`
due to bug 1322744.
Differential Revision: https://phabricator.services.mozilla.com/D93469
The `WillPaintWindow` call is problematic for FirstContentfulPaint
algorithm because it causes paints that outside of ticks, which would
revoke the viewer flush for the next tick, hence no firstContentful
paint entries are fired.
However, this `WillPaintWindow` call is also useful because it allows
the parent to aware that the layers are updated, so that the parent
can fire corresponding events based on the status. If we don't do it,
parent may end up not knowing that the layers are updated, so some
tests may stall because of the missing events.
The proposed solution here is simply using Tick here to satisfy both
requirements.
It's okay to remove mDirtyRegion in this patch because the
mDirtyRegion usage was for BASIC_LAYERS. BASIC_LAYERS means
BasicLayerManager which does in-process drawing which is nonsense
from the content process.
Differential Revision: https://phabricator.services.mozilla.com/D92445
It looks like the combination of cupsGetDests and filtering
CUPS_PRINTER_DISCOVERED filters a certain type of printers which shouldn't be
filtered.
As I wrote [1], cupsEnumDests didn't filter out a printer which hadn't been
configured in the system, but the printer didn't make opening the print preview
window slow at all, so it would be better than the case where users can't use
printers at all.
[1] https://phabricator.services.mozilla.com/D90508#2928340
Differential Revision: https://phabricator.services.mozilla.com/D92892
As noted in the attribute's documentation, we only intend to support a short
list of numeric values. The underlying platform code that reacts to this
attribute (added in a later patch) will screen for whether the provided value
is supported or unsupported, and will gracefully fall back as-needed.
(The corresponding frontend code will probably expose this attribute via a
dropdown widget that only allows users to choose among the supported values, so
there shouldn't really be any way to get an unsupported value into this
attribute anyway.)
Differential Revision: https://phabricator.services.mozilla.com/D86799
This should be able to avoid creating a printer-specific HTTP connection in
nsPrinterCUPS::DefaultSettings when the paper size is a PWG-recognized size.
The current maximum error when comparing paper sizes is 4 points. This may need
to be revised later.
Differential Revision: https://phabricator.services.mozilla.com/D91497
We will use the fallback, PWG paper sizes for localization of paper sizes in
the CUPS backend when possible. This will make paper names more consistent, and
may allow us to avoid extra connections in CUPS.
This also makes the paper size data constexpr data. The localized paper data is
held in a RefPtr as it will be shared with the printers created by the printers
when we start using localized PWG names where possible.
Differential Revision: https://phabricator.services.mozilla.com/D91496
On Linux, Firefox is listening on notify::scale-factor to detect DPI
change. However, scale-factor is an int and on the lower-end side of
the DPI scale, some devices are using fractional scale factors encoded
into Xft/DPI setting. Changing from ×1 to ×1.5 scale is therefore
undetected.
The proposed change is two-folds:
- remove use of a cached sDPI value and rely on GTK being the cache
- listening on notify::gtk-xft-dpi to trigger a DPI change
What is missing:
- performance evaluation of not caching sDPI (on a 10s session
loading 2 pages, there is an "overhead" of 6ms on my setup, nothing
visible from my point of view)
- when changing Xft/DPI and scale, the change is done twice, this
seems harmless
Differential Revision: https://phabricator.services.mozilla.com/D92095
This is the third attempt to investigate the launcher failure of our detour.
The previous commits d8315e4ed18d and 1b81ea85c43d added the assembly bytes
of a detour target and a special error code `DetourResultCode` to the launcher
failure ping.
In the latest telemetry data, however, the most common value of `hresult`
is still `ERROR_UNIDENTIFIED_ERROR`, meaning the previous commit missed to
set an error code in the common fallible codepath we wanted to know.
Besides `ERROR_UNIDENTIFIED_ERROR`, we're seeing `DETOUR_PATCHER_DO_RESERVE_ERROR`
in the telemetry, but having that code is not enough to pinpoint a falling
operation.
For further investigation, this patch adds ten more values to `DetourResultCode`.
`FUNCHOOKCROSSPROCESS_COPYSTUB_ERROR` is the last codepath we forgot to cover
in the previous commit. The values of `MMPOLICY_RESERVE_*` are to investigate
`DETOUR_PATCHER_DO_RESERVE_ERROR` in the MMPolicy level. In both cases, we add
the last Windows error code to `DetourError::mOrigBytes`.
Differential Revision: https://phabricator.services.mozilla.com/D92974
This is mostly a revert of the patch in bug 1425686 that removed the old
probe, but rebased to new code locations and clang-formatted. The histogram
entry is also updated with new bug numbers and fields.
The next patch will refine some of these telemetry recording points; the patch
is split into two for easier reviewing as this part is basically what landed
originally.
Differential Revision: https://phabricator.services.mozilla.com/D92995
Track delayed commits in a global list and don't store them in actual wayland surfaces.
When a delayed commit is called, check that the associated wayland surface is still valid.
Differential Revision: https://phabricator.services.mozilla.com/D92432
This is the third attempt to investigate the launcher failure of our detour.
The previous commits d8315e4ed18d and 1b81ea85c43d added the assembly bytes
of a detour target and a special error code `DetourResultCode` to the launcher
failure ping.
In the latest telemetry data, however, the most common value of `hresult`
is still `ERROR_UNIDENTIFIED_ERROR`, meaning the previous commit missed to
set an error code in the common fallible codepath we wanted to know.
Besides `ERROR_UNIDENTIFIED_ERROR`, we're seeing `DETOUR_PATCHER_DO_RESERVE_ERROR`
in the telemetry, but having that code is not enough to pinpoint a falling
operation.
For further investigation, this patch adds ten more values to `DetourResultCode`.
`FUNCHOOKCROSSPROCESS_COPYSTUB_ERROR` is the last codepath we forgot to cover
in the previous commit. The values of `MMPOLICY_RESERVE_*` are to investigate
`DETOUR_PATCHER_DO_RESERVE_ERROR` in the MMPolicy level. In both cases, we add
the last Windows error code to `DetourError::mOrigBytes`.
Differential Revision: https://phabricator.services.mozilla.com/D92974
Currently margin values only change when the window goes fullscreen, causes unexpected white borders when moving to a lower-DPI display. This patch fixes that by updating the values whenever DPI changes.
Differential Revision: https://phabricator.services.mozilla.com/D89493
The tooltip width can be real number in the hidpi display setup
or when the font scaling is used. In this case the nsWindow GTK
implementation will cut out the non integer part which leads to
narrowing the tooltip and later overflowing the text which
is in the tooltip to next line. This workaround patch adds
a one pixel to the tooltip frame when the tooltip has real number
width or height.
Differential Revision: https://phabricator.services.mozilla.com/D92620
In order to only call `EnableControl()` twice, once in in `Open()` and another one in `Close()`, so reduce other necessary call of `EnableControl()`.
Differential Revision: https://phabricator.services.mozilla.com/D92118
When close the event source, it should be responsible to clear up and reset the virtual control interface, rather than doing so by `Media Control Server` via setting some empty results.
Differential Revision: https://phabricator.services.mozilla.com/D92116