OS print drivers/devices know nothing about page dimensions unless we tell
them. Previously, the physical page dimensions (including orientation) have
always been the same, so communicating their dimensions once at the start of
a print has been enough. In preparation for supporting different "physical"
page dimensions (in the immediate future only different page orientations) when
we save to PDF, we need to have the infrastructure to pass dimensions through
on a page-by-page basis. This patch adds that.
None of the PrintTarget subclasses do anything with this extra information yet,
but in a follow-up patch PrintTargetPDF will use this information to create
PDFs with mixed page orientations.
Differential Revision: https://phabricator.services.mozilla.com/D179423
v4l2test emits errors/warnings for every device which isn't an M2M
decoder, which can be quite a lot of devices. So only emit these as
warnings instead of critical errors. To see the output from v4l2test,
set gfx.logging.level = 5 in about:config.
Differential Revision: https://phabricator.services.mozilla.com/D181980
In GfxInfo, probe all V4L2 devices to see which of them can do M2M
hardware decode acceleration. Set the hardware decode support features
appropriately depending on what we find.
Differential Revision: https://phabricator.services.mozilla.com/D178780
Usually, this warning points at a problem (we're rendering a native
widget in light mode in a page where we should render it in dark mode).
However there are cases where we do this legitimately, for example for
the -moz-window-titlebar appearance. We render the light titlebar behind
the tabs to be able to render shadows appropriately.
We could probably only warn in some cases but honestly I don't think
that is particularly appealing, so let's remove it.
Differential Revision: https://phabricator.services.mozilla.com/D180961
We need to avoid the new for each specialization, the GetInstance of the base class does actually not create anything new.
If the UserIdleService has been instantiated earlier than shutdown we continue to hand it out via GetInstance to give other things shutting down a chance to remove their observers, but if it has never been instantiated (or it is gone as we are very, very late in shutdown) we won't create a new one.
Differential Revision: https://phabricator.services.mozilla.com/D180130
OS print drivers/devices know nothing about page dimensions unless we tell
them. Previously, the physical page dimensions (including orientation) have
always been the same, so communicating their dimensions once at the start of
a print has been enough. In preparation for supporting different "physical"
page dimensions (in the immediate future only different page orientations) when
we save to PDF, we need to have the infrastructure to pass dimensions through
on a page-by-page basis. This patch adds that.
None of the PrintTarget subclasses do anything with this extra information yet,
but in a follow-up patch PrintTargetPDF will use this information to create
PDFs with mixed page orientations.
Differential Revision: https://phabricator.services.mozilla.com/D179423
Since the headless work (bug 1129492 and co) we realistically have no
way of rendering native scrollbars in any meaningful way. Remove dead
code that used to support using a different GTK theme on content.
Differential Revision: https://phabricator.services.mozilla.com/D179616
OS print drivers/devices know nothing about page dimensions unless we tell
them. Previously, the physical page dimensions (including orientation) have
always been the same, so communicating their dimensions once at the start of
a print has been enough. In preparation for supporting different "physical"
page dimensions (in the immediate future only different page orientations) when
we save to PDF, we need to have the infrastructure to pass dimensions through
on a page-by-page basis. This patch adds that.
None of the PrintTarget subclasses do anything with this extra information yet,
but in a follow-up patch PrintTargetPDF will use this information to create
PDFs with mixed page orientations.
Depends on D179395
Differential Revision: https://phabricator.services.mozilla.com/D179423
Add separate options to control whether we build VA-API and/or V4L2
hardware video decode. These options default to enabled on the
platforms where these decoders are used.
The downstream MOZ_WAYLAND_USE_HWDECODE build option is used within the
FFmpeg platform and is only set when building against a supported
version of the FFmpeg libraries (i.e. not for ffmpeg57).
Differential Revision: https://phabricator.services.mozilla.com/D178945
And attach it to the maximized headerbar, not to the regular one. Breeze
styles the button with background-image rather than icon-source.
Differential Revision: https://phabricator.services.mozilla.com/D179389
If we set resize cursor on widget level keep it locked and prevent layout
to switch it back to default (by synthetic mouse events for instance)
until resize is finished.
Differential Revision: https://phabricator.services.mozilla.com/D179049
I was looking into simplifying our scrollbar styles:
* StyleAppearance::Resizer is not used in content, and some of the
values were only for <xul:window> which are not supported anymore.
* Statusbarpanel and Resizerpanel aren't used. Statusbar is only used
once on macOS so we only need to keep it there.
Differential Revision: https://phabricator.services.mozilla.com/D178374
I was looking into simplifying our scrollbar styles:
* StyleAppearance::Resizer is not used in content, and some of the
values were only for <xul:window> which are not supported anymore.
* Statusbarpanel and Resizerpanel aren't used. Statusbar is only used
once on macOS so we only need to keep it there.
Differential Revision: https://phabricator.services.mozilla.com/D178374
I was looking into simplifying our scrollbar styles:
* StyleAppearance::Resizer is not used in content, and some of the
values were only for <xul:window> which are not supported anymore.
* Statusbarpanel and Resizerpanel aren't used. Statusbar is only used
once on macOS so we only need to keep it there.
Differential Revision: https://phabricator.services.mozilla.com/D178374
- Remove GlobalRefRelease() from GlobalRefCountDelete(). It matches current scenario where GlobalRefCountCreate() is created an unreferenced counter
so we also should delete it without unref.
- Call explicitly GlobalRefCountDelete() from ~VideoFrameSurface() to avoid bogus error messages. DMABufSurface may be used by other parts of gecko
even when video decoder is deleted so we don't care about DMABufSurface ref state here.
- Explicitly call GlobalRefRelease()/GlobalRefCountDelete() from ~DMABufSurface(). That matches DMABufSurface() life time scenario:
- GlobalRefAdd/GlobalRefRelease in DMABUFSurfaceImage class / RDD process.
- GlobalRefCountImport()/~DMABufSurface() if DMABufSurface is transfered via. IPC bridge to content/render/compositor process.
- Add DmabufRef MOZ_LOG
Depends on D178282
Differential Revision: https://phabricator.services.mozilla.com/D178283
This does two things:
* Modify `nsXULPopupManager::ShowPopup()` so it calls `ShowPopupAsNativeMenu()`
as long as an anchor wasn't passed in, and only on Mac.
* Modify `-[MOZMenuOpeningCoordinator _openMenu:atScreenPosition:forView:withAppearance:]`
so it also takes a `aIsContextMenu` param. If the param is true, we synthesize
a right-click event and pop up a context menu as usual. If it's false, we use
`-[NSMenu popUpMenuPositioningItem:atLocation:inView:]` instead.
The reason this works is because `-[NSMenu popUpMenuPositioningItem:atLocation:inView:]`
opens the menu in a sensible place when the x-y coords are near the right edge
of the screen. In contrast, `+[NSMenu popUpContextMenu:withEvent:forView:]` will
anchor the menu's top-right corner to the mouse cursor when near the right edge.
Differential Revision: https://phabricator.services.mozilla.com/D177355
In the ImportPRIMESurfaceDescriptor method we set the sizes of the
buffers for each plane. This was done by successively halving the
buffer width and height for each successive plane. This works for
2-planar formats with 4:2:0 chroma sub-sampling (e.g. NV12) but not for
3-planar 4:2:0 formats (e.g. YUV420). Update this method to work with
all 4:2:0 formats regardless of number of planes.
Differential Revision: https://phabricator.services.mozilla.com/D178193
As noted in the bug, this var just made us call a GDK function that is now
deprecated, which enables a GDK invalidation debugging feature that's
unrelated to our actual paint/invalidation pipeline these days.
Differential Revision: https://phabricator.services.mozilla.com/D177835
The Async Clipboard API now allows using arbitrary promises for passing write data,
potentially enabling websites to delay writing data to an arbitrary future, which
may surprise the user. This patch introduces a solution: a new write request will
automatically cancel any previous pending request.
To implement that, this patch introduces a new method to nsIClipboard, new XPCOM
interfaces, and new IPC to efficiently track individual write requests. Additionally,
a new helper base class, ClipboardSetDataHelper, is introduced in widget to facilitate
platform code sharing.
Differential Revision: https://phabricator.services.mozilla.com/D174090
This is the same issue as bug 1750721, where we react to the pointer
position relative to the wrong window when the pointer is grabbed for a
popup menu. It was reintroduced in the cluster of bugs that removed and
partly readded our use of pointer grabbing (bug 1807482 in particular).
GTK 3.0 deprecated gdk_pointer_grab in favor of gdk_device_grab, and
their implementations look very similar (as does a trace of the calls
to Grab/Ungrab functions in Xlib), but nonetheless the older function
doesn't exhibit this bug.
Differential Revision: https://phabricator.services.mozilla.com/D176616
- Remove nsWaylandDisplay thread specific objects as we don't need them.
- Use nsWaylandDisplay as non-referenced objects. There's only a global one.
- Create nsWaylandDisplay global object in nsAppRunner when Firefox starts. That ensures we create it in main thread.
- Remove mEventQueue, we don't need it.
- Remove mSyncCallback, it's unused.
Differential Revision: https://phabricator.services.mozilla.com/D176125
- make nsDMABufDevice::GetDRMFd() to always open new connection to drm device.
- don't export nsDMABufDevice::mDRMFd and use it for nsDMABufDevice::mGbmDevice only.
- create nsDMABufDevice::mGbmDevice only if it's needed.
- remove wayland specific color format modifiers code.
Depends on D176404
Differential Revision: https://phabricator.services.mozilla.com/D176405
- Make dmabuf preferences static so we don't need GetDMABufDevice() to access them.
- Configure GetDMABufDevice() when it's created.
- Init dmabuf members directly in class.
- Removed unused methods.
Differential Revision: https://phabricator.services.mozilla.com/D176404
Improve naming of some of the variables, remove some redundant type
params, and avoid calling TimeStamp::Now() unnecessarily, which is not
free.
Depends on D176282
Differential Revision: https://phabricator.services.mozilla.com/D176283
Once we detect we're idle, remove the idle timer (until the frame callback
fires again, which would start the timer).
That makes vsync not fire at 1Hz on occluded windows (it makes vsync not fire
at all for those). Matching the windows behavior too.
We had this so that we didn't leak in bug 1786247, but the right fix is
bug 1828587.
Differential Revision: https://phabricator.services.mozilla.com/D176282
- Remove nsWaylandDisplay thread specific objects as we don't need them.
- Use nsWaylandDisplay as non-referenced objects. There's only a global one.
- Create nsWaylandDisplay global object in nsAppRunner when Firefox starts. That ensures we create it in main thread.
- Remove mEventQueue, we don't need it.
- Remove mSyncCallback, it's unused.
Differential Revision: https://phabricator.services.mozilla.com/D176125
To speed up Firefox start on Wayland don't use extra wl_registry for dmabuf but use nsWaylandDisplay ones.
In this patch we do:
- Move GbmFormat setup from DMABufLibWrapper to nsWaylandDisplay
- Make GbmFormat handlers static as we don't need per display setup
- Get dmabuf pixel format configs on nsWaylandDisplay main thread handlers
Differential Revision: https://phabricator.services.mozilla.com/D175467
This makes our menus closer to GTK4, and depends less on the native menu
rendering etc. Thunderbird already does this to some extent.
Leave the old code behind a pref for now (just in case). Also fix some
code in nsNativeTheme::GetContentState (fixes rendering of radio menu
items).
Differential Revision: https://phabricator.services.mozilla.com/D175664
- Run glxtest directly from GfxInfo::GetData() in case we're missing glx test data. That happens for unusual code paths
like profile manager run or xpcshell testing.
- Remove nsIGfxInfoDebug::fireTestProcess() hack to run glxtest in testsuite. We don't need that due this change.
Differential Revision: https://phabricator.services.mozilla.com/D175868
- Migrate glxtest pid and pipe fd variables to static members of GfxInfo on Linux
- Implement GfxInfo::FireGLXTestProcess() to run glxtest process.
Differential Revision: https://phabricator.services.mozilla.com/D175867
- Implement ManageChildProcess() to get data from child test process and process exit status. We use glib I/O routines there instead of
our custom implementation.
- Update GfxInfo::GetData() and GfxInfo::GetDataVAAPI() to use it.
Differential Revision: https://phabricator.services.mozilla.com/D175808
This makes our menus closer to GTK4, and depends less on the native menu
rendering etc. Thunderbird already does this to some extent.
Leave the old code behind a pref for now (just in case). Also fix some
code in nsNativeTheme::GetContentState (fixes rendering of radio menu
items).
Differential Revision: https://phabricator.services.mozilla.com/D175664
To speed up Firefox start on Wayland don't use extra wl_registry for dmabuf but use nsWaylandDisplay ones.
In this patch we do:
- Move GbmFormat setup from DMABufLibWrapper to nsWaylandDisplay
- Make GbmFormat handlers static as we don't need per display setup
- Get dmabuf pixel format configs on nsWaylandDisplay main thread handlers
Differential Revision: https://phabricator.services.mozilla.com/D175467
To speed up start Firefox on Wayland don't use extra wl_registry connection in nsGtkKeyUtils but use the one from nsWaylandDisplay.
In this patch we do:
- Remove wl_registry handlers from KeymapWrapper but use the one in nsWaylandDisplay
- Make wl_seat/wl_keyboard static and store obtained values here. We don't need to create KeymapWrapper object for it.
- Support wl_seat/wl_keyboard removal by Wayland compositor.
Differential Revision: https://phabricator.services.mozilla.com/D175464
glxtest is run later when Firefox already spawns threads. Recently glxtest runs in forked process
which doesn't work correctly in multi-thread environment, so we need to move glxtest to different binary file
and launch it as stand alone code.
Differential Revision: https://phabricator.services.mozilla.com/D173486
- Implement fire_vaapi_process() which launch VA-API test utility on given DRM device.
- Implement GfxInfo::GetDataVAAPI() which gets VA-API test results
- Run VA-API tests when FEATURE_HARDWARE_VIDEO_DECODING is probed and only if it's enabled by GfxInfo.
Differential Revision: https://phabricator.services.mozilla.com/D171995
Implemented the inverted-colors media feature from Media Queries Level 5
for all platforms.
Spec: https://drafts.csswg.org/mediaqueries-5/#inverted
Platform specific implementations:
- Windows: Checks system color filter setting, and if it is inverted
(note: Windows does not live update due to having to read a reg key)
- Mac: Checks dedicated inverted accessibility system setting
- Android: Checks dedicated inverted system setting
- Linux: No GTK API exposes anything like it so always none
Locked behind new pref `layout.css.inverted-colors.enabled`,
always off by default for now.
Also added new WPT tests (none previously).
Other browsers:
- WebKit: shipped since Safari 9.1 (Jan 2017)
- Blink: no signal
Test page: https://goose.icu/inverted-colors
Differential Revision: https://phabricator.services.mozilla.com/D173201
glxtest is run later when Firefox already spawns threads. Recently glxtest runs in forked process
which doesn't work correctly in multi-thread environment, so we need to move glxtest to different binary file
and launch it as stand alone code.
Differential Revision: https://phabricator.services.mozilla.com/D173486
- Implement fire_vaapi_process() which launch VA-API test utility on given DRM device.
- Implement GfxInfo::GetDataVAAPI() which gets VA-API test results
- Run VA-API tests when FEATURE_HARDWARE_VIDEO_DECODING is probed and only if it's enabled by GfxInfo.
Differential Revision: https://phabricator.services.mozilla.com/D171995
glxtest is run later when Firefox already spawns threads. Recently glxtest runs in forked process
which doesn't work correctly in multi-thread environment, so we need to move glxtest to different binary file
and launch it as stand alone code.
Differential Revision: https://phabricator.services.mozilla.com/D173486
- Implement fire_vaapi_process() which launch VA-API test utility on given DRM device.
- Implement GfxInfo::GetDataVAAPI() which gets VA-API test results
- Run VA-API tests when FEATURE_HARDWARE_VIDEO_DECODING is probed and only if it's enabled by GfxInfo.
Differential Revision: https://phabricator.services.mozilla.com/D171995
As above, but with a bit more type safety, plus a TLS cache so we don't
need to lock in the common case we have already initialized the wayland
display.
Differential Revision: https://phabricator.services.mozilla.com/D173964
glxtest is run later when Firefox already spawns threads. Recently glxtest runs in forked process
which doesn't work correctly in multi-thread environment, so we need to move glxtest to different binary file
and launch it as stand alone code.
Differential Revision: https://phabricator.services.mozilla.com/D173486
- Implement fire_vaapi_process() which launch VA-API test utility on given DRM device.
- Implement GfxInfo::GetDataVAAPI() which gets VA-API test results
- Run VA-API tests when FEATURE_HARDWARE_VIDEO_DECODING is probed and only if it's enabled by GfxInfo.
Differential Revision: https://phabricator.services.mozilla.com/D171995
glxtest is run later when Firefox already spawns threads. Recently glxtest runs in forked process
which doesn't work correctly in multi-thread environment, so we need to move glxtest to different binary file
and launch it as stand alone code.
Differential Revision: https://phabricator.services.mozilla.com/D173486
- Implement fire_vaapi_process() which launch VA-API test utility on given DRM device.
- Implement GfxInfo::GetDataVAAPI() which gets VA-API test results
- Run VA-API tests when FEATURE_HARDWARE_VIDEO_DECODING is probed and only if it's enabled by GfxInfo.
Differential Revision: https://phabricator.services.mozilla.com/D171995
glxtest is run later when Firefox already spawns threads. Recently glxtest runs in forked process
which doesn't work correctly in multi-thread environment, so we need to move glxtest to different binary file
and launch it as stand alone code.
Differential Revision: https://phabricator.services.mozilla.com/D173486
- Implement fire_vaapi_process() which launch VA-API test utility on given DRM device.
- Implement GfxInfo::GetDataVAAPI() which gets VA-API test results
- Run VA-API tests when FEATURE_HARDWARE_VIDEO_DECODING is probed and only if it's enabled by GfxInfo.
Differential Revision: https://phabricator.services.mozilla.com/D171995
- Implement fire_vaapi_process() which launch VA-API test utility on given DRM device.
- Implement GfxInfo::GetDataVAAPI() which gets VA-API test results
- Run VA-API tests when FEATURE_HARDWARE_VIDEO_DECODING is probed and only if it's enabled by GfxInfo.
Differential Revision: https://phabricator.services.mozilla.com/D171995
At least on my system you can get on an state where XDG_CURRENT_DESKTOP is set
to the empty string (I think this comes from sddm when launching a legacy
WM).
Found this while trying to repro bug 1820542. Unclear if this is enough to fix
the issues in comment 0 but locally it's enough to fix fvwm detection here.
Differential Revision: https://phabricator.services.mozilla.com/D172568
Implemented the prefers-reduced-transparency media query for all
platforms.
Windows and Mac have specific settings which are used, others (Android
and Linux/GTK) have it enabled if prefers-reduced-motion is also enabled
as there is no dedicated setting to check.
Locked behind new pref `layout.css.prefers-reduced-transparency.enabled`,
off by default always for now.
Also added new WPT tests (none previously).
Demo video: https://goose.icu/firefox_prt.mp4
Test page: https://goose.icu/prefers-reduced-transparency
Differential Revision: https://phabricator.services.mozilla.com/D172424
After landing bug 1819466, we started seeing a consistent uptick in
crashes on older drivers using WebGL. Given the limited population on
older drivers on nightly, this is a sign we are unable to ship EGL on
these drivers without further investigation.
Differential Revision: https://phabricator.services.mozilla.com/D171915
That code only runs in the parent process by design. And we use
infallible new so there's no need to release-assert that allocation
succeeded.
Differential Revision: https://phabricator.services.mozilla.com/D171579
We are seeing a large uptick in crashes across all channels with the
NVIDIA binary drivers, including 470, 510, 515, 520, and 525. This
crash is tracked in bug 1788573.
Differential Revision: https://phabricator.services.mozilla.com/D171512
This patch adds two new attributes to the window's `html` element, `windowclass` and `windowname`, to allow directly controlling the window's class hints on Xorg/Wayland (`res_class` and `res_name`) from the chrome/JS code. When they are set, values are used as class hints for their window. When they are not set, the current behavior of determining `res_class` and `res_name` (using `gdk_get_program_class` for `res_class` and parsing `windowtype` for `res_name`) is preserved.
Changes in `widget/nsIWidget.h` and `widget/nsBaseWidget.h` are only interface changes so that `setWindowClass` can accept three attributes. Although this patch does not affect Windows, `widget/windows/nsWindow.h` and `widget/windows/nsWindow.cpp` have been updated to comply with the new interface. `xpfe/appshell/AppWindow.cpp` has been updated to get the additional attributes and call `setWindowClass` with them. The main changes are in `widget/gtk/nsWindow.h` and `widget/gtk/nsWindow.cpp`.
Differential Revision: https://phabricator.services.mozilla.com/D169720
As part of our goal to reduce GLX usage, and our exposure to its known
threading issues, let's try to ship EGL on X11 for NVIDIA binary driver
users with version 340.108 and higher. This lowers the requirement from
470.82 and higher.
Note that this does not impact shipping WebRender support to these
users. We keep the requirement for hardware acceleration at 470.82 and
higher. Thus this should predominantly impact WebGL.
Differential Revision: https://phabricator.services.mozilla.com/D171278
What is going on here is a bad interaction between the
aspect-ratio-locking that PiP uses and CSD.
The Wayland window starts off with CSD decorations. That adds some
margin to our windows. When we un-decorate the window then eventually
GDK removes those margins, which means that we end up with a different
size, due to the aspect ratio.
PiP is special enough that is probably ok to just do this.
Differential Revision: https://phabricator.services.mozilla.com/D171075
We get sometimes two color-scheme changes on GNOME + Wayland at least,
which do unnecessary work. Avoiding that extra work is rather
straight-forward.
This is a slightly simpler approach than D171065.
Differential Revision: https://phabricator.services.mozilla.com/D171081
When we initially shipped X11 EGL on Mesa 21+, it was chosen
specifically to avoid CI issues. These appear to have mostly been
resolved with minimal annotations required to enable EGL on release.
This will allow the majority of Linux Mesa users to switch away from
GLX.
With this patch, we will match shipping X11 EGL on where we chose to
ship WebRender. Specifically that is Mesa 17+ in general, and 18.2+ for
Nouveau.
Differential Revision: https://phabricator.services.mozilla.com/D171089
Recently we add DMABufSurface reference when DMABufSurface is exported over IPC bridge by Serialize().
That no longer works as Serialize() may be called more times due to WebGL integration.
In this patch remove ref add in Serialize() (GlobalRefCountExport) and add global ref when it's
created/imported by IPC bridge.
That better matches DMABufSurface cycle in compositor as DMABufSurface is referenced on create and undef when it's deleted on compositor side.
Also add logging to ref/unref and print warning if surface ref count is already zero (we're trying to unref already 'unused' surface).
Differential Revision: https://phabricator.services.mozilla.com/D170624
LibX11 versions prior to 1.7 have a race condition that made it unsafe to use
in multiple threads. Since Firefox 104, we created a CanvasRender thread that
is used to service WebGL commands off the Renderer thread so that WebGL does
not block WebRender. If WebGL uses GLX, this can lead us to using GLX on the
two different threads. In combination with an unsafe version of libX11, this
can lead to severe instability.
We already have a FEATURE_THREADSAFE_GL in place to denote this, which was
currently used mainly for Nouveau which is also unsafe to use on multiple
threads. If this feature fails, the CanvasRender thread is not used, and
all WebGL commands go back to being on the Renderer thread as normal, avoiding
the problem.
Thus, this detects the presence of libX11 version 1.7 or greater, and if not
found, we disable FEATURE_THREADSAFE_GL to disable the CanvasRender thread.
Differential Revision: https://phabricator.services.mozilla.com/D170992
- We want to get window size from compositor widget as it matches window size used by parent RenderCompositorSWGL rendrer.
- For main thread rendering mCompositorWidget is not available so get window size directly from nsWindow.
Depends on D169906
Differential Revision: https://phabricator.services.mozilla.com/D169907
Convert the various mode* constants in nsIFilePicker into a proper
enum, and perform validation when passing it across IPC.
Differential Revision: https://phabricator.services.mozilla.com/D169853
Convert the various result* constants in nsIFilePicker into a proper
enum, and perform validation when passing it across IPC.
Differential Revision: https://phabricator.services.mozilla.com/D169852
IME for ibus may send composition after filtering `GDK_KEY_PRESS` event
asynchronously. In that case, IME or ibus usually synthesize `GDK_KEY_PRESS`
again for letting the application know what's being handled. However, according
to the bug report, IME may send composition without synthesizing the
`GDK_KEY_PRESS` event.
Without this patch, `IMContextWrapper` dispatches only
`eContentCommandInsertText` event. Then, it'll cause only a set of
`beforeinput` and `input` events. Therefore, web apps may fail to do something
if they listen only composition and keyboard events only in Gecko. For avoiding
Gecko only failure in this case, we should make `IMContentWrapper` handle the
composition with `GDK_KEY_PRESS` event in the queue which it has not handled
yet. Then, web apps can work with `keydown` events whose `key` is `"Process"`.
Differential Revision: https://phabricator.services.mozilla.com/D170031
- We want to get window size from compositor widget as it matches window size used by parent RenderCompositorSWGL rendrer.
- For main thread rendering mCompositorWidget is not available so get window size directly from nsWindow.
Depends on D169906
Differential Revision: https://phabricator.services.mozilla.com/D169907
The datetime picker uses `outline-style: auto` (no other piece of chrome
UI does yet, afaict), and it looks real bad on Linux because
outline-style: auto is broken.
It's also slow, since we don't support webrender for it.
On Windows it's a 1px black outline, which is also terrible and can be
achieved in other ways.
On macOS the outline looks nice, but it seems better to make it
consistent across platforms, which allows the front-end to use it (I
don't think there's a use for the non-native outline).
Differential Revision: https://phabricator.services.mozilla.com/D170222
Most usage is a straight replacement but gtk needs extra changes as it transfers plain text in UTF8 natively and needs to be converted into UTF16, and Windows uses single-byte characters for RTF and CF_HTML formats so we preserve this.
Differential Revision: https://phabricator.services.mozilla.com/D158587
Without pointer grabs, it's possible to move the pointer into a popup
element and use it, but if the pointer leaves even for a moment, the
popup will be dismissed. This seems to be a FVWM-specific quirk
(see bug for more info); other WMs with focus-follows-mouse policies
(Openbox, XFWM4) handle focus changes differently and aren't affected.
To avoid that, this patch turns pointer grabbing back on if we detect
FVWM.
Differential Revision: https://phabricator.services.mozilla.com/D168495
KDE uses the GTK text scale factor to implement fractional global
scaling.
While some GTK apps really only use it for text, we interpret it as a
full DPI change (this is configurable via
browser.display.os-zoom-behavior, but that's our default behavior for a
long long time).
We're ignoring the text scale factor right now, but there's no good
reason to it, now that we support fractional scaling. After this patch,
native widgets are consistently scaled with all the other chrome UI
elements. This includes checkbox menuitems, buttons, etc.
The exception here are scrollbars, which are special and still ignore
the text scale factor here:
https://searchfox.org/mozilla-central/rev/8e9b4484408154b80d7ede9e1b035819fda48fd2/widget/ScrollbarDrawing.cpp#28-32
But that's fine because scrollbars are the only widget that ignores full
zoom, and that also matches what Windows does with the text scale
factor, so if we want to change it that's probably worth a separate bug.
(I also have some changes to that code in flight for bug 1812868 so I'd
rather not have gratuituous conflicts).
Depends on D168371
Differential Revision: https://phabricator.services.mozilla.com/D168372
This patch on its own doesn't change behavior (as GetWidgetScaleFactor
is still guaranteed to be an integer for now).
Cairo deals with floats just fine. The only scale factor that needs to
be an integer is the style context scale, which is documented to only
affect image resources, so we can just ceil there to have crisp images.
Differential Revision: https://phabricator.services.mozilla.com/D168371
Most of the code is actually on GDK pixels (CSS pixels). Make the
code reflect that. This allows us to use regular unit conversions
in more places.
Differential Revision: https://phabricator.services.mozilla.com/D168365
This is:
* An easier way for browser code to access it.
* Avoids having a bunch of per-platform implementations.
* We don't need to actually get graphics info for it to work.
So it should be a bit nicer over all.
Differential Revision: https://phabricator.services.mozilla.com/D168373
It works well on KDE and others, so try to enable it unconditionally for
consistency, specially given stuff like the native titlebar context menu
etc works (bug 1771950).
Now that the titlebar setting is a tri-state, the hidden pref doesn't
make particular sense either, browser.tabs.inTitlebar=1 would have the
same effect.
Differential Revision: https://phabricator.services.mozilla.com/D167796
I'm about to extend them for bug 1811486, where I want to force in some
cases the rolled up popups to hide synchronously. These APIs use a ton
of boolean arguments that make them error prone, so refactor them a bit
to use strongly typed enums and flags.
Differential Revision: https://phabricator.services.mozilla.com/D167381
The main issue here is that we roll up the popup on focus out, and wait
for the transition to finish, but we stop compositing / running the
refresh driver when minimized, and thus the transition never ends up
finishing / the popup doesn't end up being hidden until after you
re-open the window...
This is the easy-to-uplift fix, will work on a proper solution for
central.
Differential Revision: https://phabricator.services.mozilla.com/D167379
Move it to the mozilla::widget namespace.
Use enum classes for transparency, popup type, popup level, etc.
Mostly automated with sed, but there were a few manual changes required
as well in windows code because they relied on Atomic<TransparencyMode>
working (which now doesn't because TransparencyMode is 1 byte instead of
4 bytes).
Differential Revision: https://phabricator.services.mozilla.com/D167537
I'm about to extend them for bug 1811486, where I want to force in some
cases the rolled up popups to hide synchronously. These APIs use a ton
of boolean arguments that make them error prone, so refactor them a bit
to use strongly typed enums and flags.
Differential Revision: https://phabricator.services.mozilla.com/D167381
I'm about to extend them for bug 1811486, where I want to force in some
cases the rolled up popups to hide synchronously. These APIs use a ton
of boolean arguments that make them error prone, so refactor them a bit
to use strongly typed enums and flags.
Differential Revision: https://phabricator.services.mozilla.com/D167381
Gfx blocklist doesn't actually use the desktop environment filter so
remove that functionality. We can reintroduce it in the future if we
need it.
Differential Revision: https://phabricator.services.mozilla.com/D166090
- Move DMABufSurfaceYUV::CreateYUVPlane to DMABufSurfaceYUV::CreateLinearYUVPlane. That's used for debugging purposes only and may be removed later.
- Implement ImportPRIMESurfaceDescriptor() which files DMABufSurfaceYUV with data from PRIMESurfaceDescriptor except dmabuf file descriptors.
- Implement DMABufSurfaceYUV::CreateYUVPlane(int aPlane) which creates YUV surface plane according to data imported from PRIMESurfaceDescriptor.
- Implement DMABufSurfaceYUV::MoveYUVDataImpl(). That moves all dmabuf surface data from PRIMESurfaceDescriptor to DMABufSurfaceYUV,
i.e. DMABufSurfaceYUV and PRIMESurfaceDescriptor points to the same GPU memory.
- Implement DMABufSurfaceYUV::CopyYUVDataImpl(). That copies dmabuf surface from PRIMESurfaceDescriptor to DMABufSurfaceYUV,
i.e. DMABufSurfaceYUV and PRIMESurfaceDescriptor points to different GPU memory parts with the same content.
- DMABufSurfaceYUV::UpdateYUVData() now takes extra "copy" param to request dmabuf copy.
Differential Revision: https://phabricator.services.mozilla.com/D166330