Граф коммитов

4269 Коммитов

Автор SHA1 Сообщение Дата
Karl Tomlinson 99e48aed98 Bug 1824634 disconnect from GtkIMContext OnDestroyWindow r=masayuki
which will allow a GtkIMContext to outlive the IMContextWrapper.

Differential Revision: https://phabricator.services.mozilla.com/D182865
2023-07-12 21:38:19 +00:00
Jonathan Watt 07bafd2423 Bug 1833244 p1. Create infrastructure to pass page dimensions to PrintTarget::BeginPage. r=dholbert,geckoview-reviewers,jonalmeida
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
2023-07-10 14:26:12 +00:00
Razvan Cojocaru 51f6032d4d Bug 1840485 - Change the type of BaseMargin::{top,right,bottom,left} to Coord. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D182328
2023-07-01 02:23:21 +00:00
stransky 4c07252d96 Bug 1840272 [Linux] Don't break *BSD builds if eventfd is missing r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D181998
2023-06-28 08:36:08 +00:00
Sandor Molnar 7f2bd0df31 Backed out changeset 15d494dac453 (bug 1840272) for causing build bustages in system_wrappers/sys/ioccom.h. 2023-06-28 10:50:49 +03:00
stransky 5fa0e7fea7 Bug 1840272 [Linux] Don't break *BSD builds if eventfd is missing r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D181998
2023-06-28 06:59:46 +00:00
Hiroyuki Ikezoe b976eb1152 Bug 1839198 - Move mIsPIPWindow into nsBaseWidget. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D181417
2023-06-27 21:20:08 +00:00
David Turner ea012bcbbf Bug 1833354 - Quieten V4L2 support warnings. r=rmader
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
2023-06-26 09:56:27 +00:00
Natalia Csoregi d39daca2ad Backed out 2 changesets (bug 1839198) for causing failures on browser_disableSwipeGestures.js. CLOSED TREE
Backed out changeset 7571cac8dc05 (bug 1839198)
Backed out changeset 7a7eaa3f754d (bug 1839198)
2023-06-23 03:31:03 +03:00
Hiroyuki Ikezoe c2df274d5e Bug 1839198 - Move mIsPIPWindow into nsBaseWidget. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D181417
2023-06-22 20:53:18 +00:00
stransky 9a25de0567 Bug 1833855 [Linux] Update widget/gtk for wayland/x11 exclusive builds r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178644
2023-06-22 13:42:39 +00:00
stransky 6f2d44b5f8 Bug 1833855 [Linux] Update GtkCompositorWidget to work on X11 only builds r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178643
2023-06-22 13:42:39 +00:00
stransky c185d02a75 Bug 1833855 [Linux] Build and run vaapitest on X11 only builds r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178642
2023-06-22 13:42:39 +00:00
stransky 0236a019ea Bug 1833855 [Linux] Update DMABufSurface to build on X11 only r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178641
2023-06-22 13:42:39 +00:00
stransky 6ebe2da782 Bug 1833855 [Linux] Update DMABufLibWrapper for X11 r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178640
2023-06-22 13:42:39 +00:00
Cristian Tuns ac8a8744d7 Backed out 14 changesets (bug 1833855) for causing build bustages in DMABufSurface.cpp CLOSED TREE
Backed out changeset b8daeb03b670 (bug 1833855)
Backed out changeset cc17af8bae3d (bug 1833855)
Backed out changeset 2d4f6b8ad5d3 (bug 1833855)
Backed out changeset 3b75e59357bb (bug 1833855)
Backed out changeset 86948033f163 (bug 1833855)
Backed out changeset 3e6387b95e39 (bug 1833855)
Backed out changeset 7f22e082786c (bug 1833855)
Backed out changeset 9d5ae056d3c8 (bug 1833855)
Backed out changeset b0a7ca2dfbd6 (bug 1833855)
Backed out changeset ac0947e6e601 (bug 1833855)
Backed out changeset a058367a436a (bug 1833855)
Backed out changeset 7b4da292159c (bug 1833855)
Backed out changeset d50ae530998d (bug 1833855)
Backed out changeset 895b93846598 (bug 1833855)
2023-06-22 08:05:40 -04:00
stransky 712ac91a5c Bug 1833855 [Linux] Update widget/gtk for wayland/x11 exclusive builds r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178644
2023-06-22 11:17:24 +00:00
stransky 04e6588749 Bug 1833855 [Linux] Update GtkCompositorWidget to work on X11 only builds r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178643
2023-06-22 11:17:24 +00:00
stransky f7c73d6168 Bug 1833855 [Linux] Build and run vaapitest on X11 only builds r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178642
2023-06-22 11:17:24 +00:00
stransky d057a86f10 Bug 1833855 [Linux] Update DMABufSurface to build on X11 only r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178641
2023-06-22 11:17:24 +00:00
stransky db9a02b80d Bug 1833855 [Linux] Update DMABufLibWrapper for X11 r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178640
2023-06-22 11:17:23 +00:00
Cristian Tuns 684fec2fef Backed out 14 changesets (bug 1833855) for causing build bustages in SharedSurface.cpp CLOSED TREE
Backed out changeset c3f7d1963902 (bug 1833855)
Backed out changeset 347c47f5542a (bug 1833855)
Backed out changeset 2c0807d0b39a (bug 1833855)
Backed out changeset 013d1d16194d (bug 1833855)
Backed out changeset 2e49d43a627c (bug 1833855)
Backed out changeset ea21e90a71dd (bug 1833855)
Backed out changeset 8d5d0690668c (bug 1833855)
Backed out changeset 4eb11068275d (bug 1833855)
Backed out changeset 15120d9c5b24 (bug 1833855)
Backed out changeset b75750bb7596 (bug 1833855)
Backed out changeset 6f94e3f002ed (bug 1833855)
Backed out changeset 3235825211f9 (bug 1833855)
Backed out changeset 47a6e9ed8828 (bug 1833855)
Backed out changeset b8013c43aa20 (bug 1833855)
2023-06-22 05:29:12 -04:00
stransky dc9e855379 Bug 1833855 [Linux] Update widget/gtk for wayland/x11 exclusive builds r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178644
2023-06-22 08:35:58 +00:00
stransky 092eae938e Bug 1833855 [Linux] Update GtkCompositorWidget to work on X11 only builds r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178643
2023-06-22 08:35:57 +00:00
stransky 526a88c8c9 Bug 1833855 [Linux] Build and run vaapitest on X11 only builds r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178642
2023-06-22 08:35:57 +00:00
stransky d67ff2eb87 Bug 1833855 [Linux] Update DMABufSurface to build on X11 only r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178641
2023-06-22 08:35:57 +00:00
stransky e6d44f3279 Bug 1833855 [Linux] Update DMABufLibWrapper for X11 r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178640
2023-06-22 08:35:57 +00:00
stransky 13b00af243 Bug 1837138 [Linux] Enable AMD VA-API zero copy playback on Mesa >= 23.1.1 r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D180187
2023-06-20 20:39:02 +00:00
stransky 90ebdbf5c4 Bug 1836021 [Linux] Probe VA-API devices if HW acceleration is force enabled r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D180177
2023-06-19 12:57:02 +00:00
Brad Werth 50b102dff8 Bug 1815481: Disable hardware WebRender on Mesa drivers in Virtual Machines. r=rmader
We classify anything with 'mesa/vmgfx' as a Virtual Machine driver and
block it for Linux.

Differential Revision: https://phabricator.services.mozilla.com/D179864
2023-06-16 20:45:22 +00:00
David Turner b8752c00b1 Bug 1833354 - Add V4L2 hw decode probing to GfxInfo. r=media-playback-reviewers,stransky
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
2023-06-15 12:59:59 +00:00
Emilio Cobos Álvarez 92cede474d Bug 1838468 - Remove noisy warning. r=mccr8
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
2023-06-14 16:33:27 +00:00
Nicolas Avrutin 276d06cb60 Bug 1838322 - add NOP listener for wl_keyboard repeat_info. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D180883
2023-06-13 22:31:33 +00:00
Sandor Molnar 0b7a002739 Backed out changeset 236a3de9726e (bug 1836021) for causing build bustages in widget/gtk/GfxInfo.cpp CLOSED TREE 2023-06-08 12:35:53 +03:00
stransky 79ad1960b7 Bug 1836021 [Linux] Probe VA-API devices if HW acceleration is force enabled r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D180177
2023-06-08 08:39:39 +00:00
Jens Stutte b8cb45e0e0 Bug 1836980 - Move the check for late instantiation to UserIdleService[type] specializations. r=kmag,xpcom-reviewers,geckoview-reviewers,m_kato
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
2023-06-07 06:27:52 +00:00
Stanca Serban c75ef6f238 Backed out 3 changesets (bug 1833244) for causing multiple failures.
Backed out changeset 7bc8c25b2935 (bug 1833244)
Backed out changeset 4576af83a4ec (bug 1833244)
Backed out changeset 90a5bbba7b9c (bug 1833244)
2023-06-03 18:36:21 +03:00
Jonathan Watt 597c1a2778 Bug 1833244 p2. Create infrastructure to pass page dimensions to PrintTarget::BeginPage. r=dholbert
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
2023-06-03 14:21:37 +00:00
Emilio Cobos Álvarez 20b915489a Bug 1804657 - Remove dead code related to having native theme in content on Linux. r=stransky
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
2023-06-01 07:37:33 +00:00
Iulian Moraru 3cfea4753c Backed out changeset 9fce1abd1c50 (bug 1833244) for causing build bustages on nsDeviceContextAndroid.h. CLOSED TREE 2023-05-31 16:31:53 +03:00
Jonathan Watt d4e8510ca6 Bug 1833244 p1. Create infrastructure to pass page dimensions to PrintTarget::BeginPage. r=dholbert
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
2023-05-31 13:02:26 +00:00
stransky 63d3ba0ce4 Bug 1835797 [Linux] Don't launch vaapitest on software backends r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D179529
2023-05-31 09:52:53 +00:00
David Turner 8ab689c9e9 Bug 1833354 - Add build options for VAAPI and V4L2. r=media-playback-reviewers,glandium,stransky
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
2023-05-31 06:13:29 +00:00
Brad Werth eea7eafab2 Bug 1821892: Block R600 hardware with Mesa drivers in all channels. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D179155
2023-05-30 14:42:53 +00:00
Emilio Cobos Álvarez 34bff4f0ed Bug 1574291 - Render restore button, not just icon, when drawing titlebar. r=stransky
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
2023-05-30 11:34:37 +00:00
Emilio Cobos Álvarez 7b9a90e89c Bug 1834042 - Expose screen edge slop to chrome code. r=stransky,webidl,smaug
To be used by session restore.

Differential Revision: https://phabricator.services.mozilla.com/D179110
2023-05-30 09:43:59 +00:00
stransky d938e937bf Bug 1777430 [Linux] Enable VA-API HW video decoding for Intel devices r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D178760
2023-05-26 20:45:30 +00:00
stransky 7bc2921054 Bug 1825181 [Linux] Use base::SharedMemory as backend for wl_shm pool r=jld
Differential Revision: https://phabricator.services.mozilla.com/D178767
2023-05-26 07:04:26 +00:00
Martin Stransky fdbe79306e Bug 1826778 [Linux] Lock cursor type set by widget code r=emilio
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
2023-05-26 06:58:35 +00:00
Emilio Cobos Álvarez 825b7b76e5 Bug 1833403 - Simplify some appearance code. r=stransky,mac-reviewers,handyman,devtools-reviewers,mstange
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
2023-05-24 11:13:58 +00:00
Iulian Moraru 729b189a97 Backed out changeset f020820671c4 (bug 1833403) for causing reftest failures on resizer-bottomend.xhtml. CLOSED TREE 2023-05-24 01:48:48 +03:00
Emilio Cobos Álvarez 6a17b5fdf8 Bug 1833403 - Simplify some appearance code. r=stransky,mac-reviewers,handyman,devtools-reviewers,mstange
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
2023-05-23 15:43:45 +00:00
Emilio Cobos Álvarez 1937b308ec Bug 1834042 - Make nsWindow::ConstrainPosition account for decorations. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D178545
2023-05-23 10:30:05 +00:00
Norisz Fay 52188d9733 Backed out changeset e2d6154400a7 (bug 1833403) for causing reftest failures on resizer-bottomend.xhtml 2023-05-23 01:03:26 +03:00
Butkovits Atila 2fc1fdfb88 Backed out changeset ff1720f8fc34 (bug 1834042) for causing Android bustages at nsWindow.h. CLOSED TREE 2023-05-23 00:54:10 +03:00
Emilio Cobos Álvarez 05b4470d2d Bug 1833403 - Simplify some appearance code. r=stransky,mac-reviewers,handyman,devtools-reviewers,mstange
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
2023-05-22 20:39:11 +00:00
Emilio Cobos Álvarez 56a0e2aa64 Bug 1834042 - Make nsWindow::ConstrainPosition account for decorations. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D178545
2023-05-22 20:36:27 +00:00
stransky 262ab63a40 Bug 1833354 [Linux] Add surface dump and YUV plane clear debug code to DMABufSurfaceYUV r=emilio DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D178623
2023-05-22 18:00:19 +00:00
stransky 081833d34c Bug 1829542 [Linux] Remove GlobalRefRelease() from GlobalRefCountDelete() r=emilio
- 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
2023-05-22 07:53:25 +00:00
stransky 75033b7344 Bug 1829542 [Linux] Disable copy of DMABufSurface class r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178282
2023-05-22 07:53:25 +00:00
Emilio Cobos Álvarez 96ec01bce7 Bug 1651463 - Add CSD offset in MoveResize as needed. r=stransky
gtk_window_move undoes that...

Differential Revision: https://phabricator.services.mozilla.com/D178385
2023-05-18 13:37:25 +00:00
Drew Willcoxon 929e1e4d77 Bug 1831760 - Use a native popup menu for positioned popups on Mac. r=dao,mstange
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
2023-05-18 05:51:19 +00:00
David Turner 970c239ded Bug 1833354 - Fix chroma subsampling in DMABufSurface. r=media-playback-reviewers,padenot,stransky
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
2023-05-17 07:51:31 +00:00
stransky 77d21548c5 Bug 1833207 [Wayland] Request to load dmabuf modifiers on main thread for parent process only r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178163
2023-05-16 10:44:33 +00:00
Daniel Holbert 60148a98d8 Bug 1832692: Remove support for MOZ_DEBUG_PAINTS environmental variable. r=stransky
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
2023-05-15 20:16:57 +00:00
nicklas boman 5e31225558 Bug 1724649 - Followup to remove #include plstr.h r=necko-reviewers,xpcom-reviewers,valentin,nika
Differential Revision: https://phabricator.services.mozilla.com/D177690
2023-05-15 14:53:02 +00:00
Edgar Chen 8a1d360c1a Bug 1712122 - Part 3: Cancel pending write request when a new write request is made; r=nika,geckoview-reviewers,m_kato
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
2023-05-14 21:02:08 +00:00
Otto Länd bfd4e4756f Bug 1830162: apply code formatting via Lando
# ignore-this-changeset
2023-05-11 10:02:34 +00:00
Emilio Cobos Álvarez 86f1a48882 Bug 1830162 - Add array support to gfxVars, and use it for the DMABuf modifiers. r=stransky,gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D177376
2023-05-11 09:59:53 +00:00
stransky 8dabb90364 Bug 1830162 [Wayland] Get dmabuf modifiers from Wayland and export them to child processes as gfxVar r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D176952
2023-05-11 09:59:53 +00:00
stransky ad70535914 Bug 1831038 [Linux] Init FEATURE_*_HW_DECODE features according to VA-API test results r=emilio
Depends on D177021

Differential Revision: https://phabricator.services.mozilla.com/D177022
2023-05-11 09:58:21 +00:00
Emilio Cobos Álvarez 924c311c4b Bug 1831841 - Remove dead GTK menu styling code. r=dao,stransky
Differential Revision: https://phabricator.services.mozilla.com/D177369
2023-05-11 08:57:11 +00:00
stransky 1e42fec5f4 Bug 1829414 [Wayland] Don't crash if we're getting EGL window for hidden GtkWindow on Wayland r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D177689
2023-05-11 07:36:08 +00:00
stransky e6bb782a12 Bug 1831541 [Linux] Don't assert on mIsVAAPISupported if MOZ_WAYLAND is missing r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D177620
2023-05-10 11:49:05 +00:00
Jed Davis 3f901abe2f Bug 1820542 - Use gdk_pointer_grab instead of gdk_device_grab to avoid bug with nested menus. r=emilio
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
2023-05-02 18:36:12 +00:00
stransky f7b14d8b80 Bug 1830271 [Linux] Disable logging for vaapi test by default r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D176638
2023-04-27 11:39:36 +00:00
stransky 5fe2a0b46b Bug 1829871 [Linux] glxtest/vaapi test: recover from EAGAIN/EINTR errors r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D176587
2023-04-27 06:41:37 +00:00
stransky c9a9883e77 Bug 1829303 [Wayland] Remove thread specific wayland display objects r=emilio
- 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
2023-04-26 20:57:17 +00:00
stransky 851dc88347 Bug 1828071 [Linux] Rename nsDMABufDevice to DMABufDevice and nsGbmLib to GbmLib r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D176508
2023-04-26 12:52:09 +00:00
kk@kk 898724926e Bug 1828071 [Linux] Don't share drm file descriptor for VA-API display and DRM device used to create textures r=emilio
- 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
2023-04-26 12:52:09 +00:00
stransky 9e813895f1 Bug 1828071 [Linux] Update DMABuf setup r=emilio
- 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
2023-04-26 12:52:09 +00:00
stransky 3f14d27047 Bug 1829461 [Linux] Use timeout to wait until gxltest/vaapi test is finished r=emilio
Depends on D176456

Differential Revision: https://phabricator.services.mozilla.com/D176457
2023-04-26 09:25:52 +00:00
stransky ef7e9adfcf Bug 1829461 [Linux] glxtest/vaapi test: use pid 0 for missing (waiting) test results and pid < 0 for finished test r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D176456
2023-04-26 09:25:52 +00:00
kk@kk 95a02539ce Bug 1829541 [Linux] VAAPI test - Don't close render device before libdrm r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D176276
2023-04-25 06:03:14 +00:00
Emilio Cobos Álvarez 49aea6eb43 Bug 1829493 - [wayland] Misc WaylandVsyncSource clean-ups. r=rmader
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
2023-04-24 12:31:01 +00:00
Emilio Cobos Álvarez b2637ab513 Bug 1829493 - [wayland] Don't keep firing vsync at idle rate once idle. r=rmader
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
2023-04-24 12:31:01 +00:00
Cristina Horotan 91e7aee4b8 Backed out 6 changesets (bug 1829303, bug 1828071) for causing causing Linux crashes (bug 1829462) a=backout
Backed out changeset 90256c29ed1f (bug 1829303)
Backed out changeset 9c6ea77a90eb (bug 1828071)
Backed out changeset b71c46d9b101 (bug 1828071)
Backed out changeset c333d6127dfe (bug 1828071)
Backed out changeset c2c5841b88e0 (bug 1828071)
Backed out changeset 0b2180c4f9a5 (bug 1828071)
2023-04-24 12:50:04 +03:00
Edgar Chen 58bec5645b Bug 1823284 - Use `SizeModeChanged` notification to handle fullscreen change; r=geckoview-reviewers,rkraesig,stransky,bradwerth,smaug,m_kato
Depends on D175213

Differential Revision: https://phabricator.services.mozilla.com/D175215
2023-04-23 21:28:43 +00:00
stransky 3aefdbee32 Bug 1829303 [Wayland] Remove thread specific wayland display objects r=emilio
- 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
2023-04-22 06:08:08 +00:00
stransky 1ee07431a8 Bug 1828071 [Linux] Init DMABufLibWrapper in class declaration r=emilio
Depends on D176115

Differential Revision: https://phabricator.services.mozilla.com/D176116
2023-04-21 10:25:37 +00:00
stransky f9ded2a63b Bug 1828071 [Linux] Use plain string to keep dmabuf failure error r=emilio
Depends on D175469

Differential Revision: https://phabricator.services.mozilla.com/D176115
2023-04-21 10:25:37 +00:00
stransky 769c1d4630 Bug 1828071 [Linux] Use static preferences in nsDMABufDevice r=emilio
There's no need to create nsDMABufDevice just to get/set dmabuf config.

Differential Revision: https://phabricator.services.mozilla.com/D175469
2023-04-21 10:25:37 +00:00
stransky cfac00270a Bug 1828071 [Linux] Always configure nsDMABufDevice and remove GetAndConfigureDMABufDevice() for child processes r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175468
2023-04-21 10:25:37 +00:00
stransky 4a4f644aa8 Bug 1828071 [Wayland] Move wl_registry from DMABufLibWrapper to nsWaylandDisplay r=emilio
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
2023-04-21 10:25:37 +00:00
Norisz Fay e14b74864b Backed out 2 changesets (bug 1823284) for causing failures on element-request-fullscreen-timing.html, test_fullscreen-api.html CLOSED TREE
Backed out changeset 54bce7b5d558 (bug 1823284)
Backed out changeset 65747f283949 (bug 1823284)
2023-04-20 17:14:12 +03:00
Emilio Cobos Álvarez fa37578f52 Bug 1828413 - Use more non-native rendering of menus. r=stransky
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
2023-04-20 11:42:44 +00:00
stransky f8f1de6603 Bug 1828192 [Linux] Run glxtest directly from GfxInfo::GetData() in case we're missing glx test data r=emilio
- 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
2023-04-20 08:54:17 +00:00
stransky 1551b41014 Bug 1828192 [Linux] Remove c style hacks to run glxtest and use FireTestProcess() for it r=emilio
- 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
2023-04-20 08:54:17 +00:00
stransky 2f37fa4403 Bug 1828192 [Linux] Implement GfxInfo::FireTestProcess() and use it to run VA-API testing r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175866
2023-04-20 08:54:17 +00:00
stransky 5c134bc785 Bug 1828192 [Linux] Implement and use ManageChildProcess() to run and get data from child test process in GfxInfo r=emilio
- 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
2023-04-20 08:54:16 +00:00
stransky 15cdc86860 Bug 1828192 [Linux] Make vaapitest to use GfxInfoUtils.h routines r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175807
2023-04-20 08:54:16 +00:00
stransky 585e25ef4c Bug 1828192 [Linux] Implement common glx/vaapi test routines in GfxInfoUtils.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175805
2023-04-20 08:54:16 +00:00
Edgar Chen b665ebfef0 Bug 1823284 - Use `SizeModeChanged` notification to handle fullscreen change; r=geckoview-reviewers,rkraesig,stransky,bradwerth,smaug,m_kato
Depends on D175213

Differential Revision: https://phabricator.services.mozilla.com/D175215
2023-04-20 08:17:57 +00:00
Emilio Cobos Álvarez 534aba218e Bug 1828772 - Don't use move-to-rect if layout has flipped our popup. r=stransky
As move-to-rect wouldn't account for those constraints.

Differential Revision: https://phabricator.services.mozilla.com/D175861
2023-04-19 13:00:16 +00:00
stransky cd93cf2006 Bug 1828756 [Wayland] Don't access KeymapWrapper instance in KeymapWrapper::ResetKeyboard() without check r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175800
2023-04-19 12:59:33 +00:00
Cristina Horotan 8b53b2373f Backed out changeset c099d64b17e6 (bug 1828413) for causing multiple Menu related failures. CLOSED TREE 2023-04-19 14:51:33 +03:00
stransky 831503ccc9 Bug 1828623 [Linux] Don't use std::min in vaapitest r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175801
2023-04-19 10:58:26 +00:00
Emilio Cobos Álvarez a71dc7a55b Bug 1828413 - Use more non-native rendering of menus. r=stransky
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
2023-04-19 10:08:30 +00:00
Natalia Csoregi 06077d4459 Backed out 3 changesets (bug 1828071) for causing leaks. CLOSED TREE
Backed out changeset 1e49ad06cd44 (bug 1828071)
Backed out changeset 12d28dd0b9e2 (bug 1828071)
Backed out changeset 328ba92c5afe (bug 1828071)
2023-04-19 01:22:06 +03:00
stransky 1132652264 Bug 1828071 [Linux] Use static preferences in nsDMABufDevice r=emilio
There's no need to create nsDMABufDevice just to get/set dmabuf config.

Differential Revision: https://phabricator.services.mozilla.com/D175469
2023-04-18 20:53:44 +00:00
stransky 5c4d553c19 Bug 1828071 [Linux] Always configure nsDMABufDevice and remove GetAndConfigureDMABufDevice() for child processes r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175468
2023-04-18 20:53:44 +00:00
stransky 4829ebf5f0 Bug 1828071 [Wayland] Move wl_registry from DMABufLibWrapper to nsWaylandDisplay r=emilio
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
2023-04-18 20:53:44 +00:00
stransky 162cfdc993 Bug 1828070 [Wayland] Add logging to WidgetUtilsGtk / XDG token code r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175466
2023-04-17 08:23:17 +00:00
stransky 6a937b9474 Bug 1828070 [Wayland] Don't proceed in RequestWaylandFocusPromise() when wl_seat is missing r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175465
2023-04-17 08:23:16 +00:00
stransky 068285e189 Bug 1828067 [Wayland] Migrate nsGtkKeyUtils wl_registry to nsWaylandDisplay r=emilio
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
2023-04-14 20:48:07 +00:00
stransky aa94035b7c Bug 1787182 [Linux] Build and run VA-API test on MOZ_WAYLAND builds only r=emilio
Depends on D175236

Differential Revision: https://phabricator.services.mozilla.com/D175323
2023-04-13 09:49:59 +00:00
stransky a46255fb5e Bug 1787182 [Linux] Implement glxtest test as binary r=emilio
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
2023-04-13 09:49:57 +00:00
stransky 301aad30ac Bug 1787182 [Linux] Run VA-API tests on supported hardware only r=emilio,gfx-reviewers,jgilbert
- 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
2023-04-13 09:49:57 +00:00
stransky dc06eacaa7 Bug 1787182 [Linux] Implement VA-API test as vaapitest binary r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171994
2023-04-13 09:49:57 +00:00
Norisz Fay 228a824c6b Backed out changeset 8e7588542175 (bug 1818517) as requested by dev for causing Bug 1827446 CLOSED TREE 2023-04-12 13:30:47 +03:00
stransky ab8022577e Bug 1827429 [Wayland] Call NotifyOcclusionState(OcclusionState::VISIBLE) from nsWindow::OnExposeEvent() as we know the window is visible r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175138
2023-04-12 09:17:10 +00:00
stransky c22b452bc3 Bug 1826583 [Wayland] Don't crash on Wayland log handler r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D174920
2023-04-12 09:07:56 +00:00
CanadaHonk 2d520652e0 Bug 1794628 - Implement inverted-colors media feature r=geckoview-reviewers,morgan,emilio,m_kato,cmartin
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
2023-04-11 13:34:00 +00:00
Emilio Cobos Álvarez 141fa8957a Bug 1827137 - Allow overriding CSD support with GTK_CSD=0, so that gtk3-nocsd keeps working. r=stransky
I don't think there's a particularly nicer/easier way of doing this,
wdyt?

Differential Revision: https://phabricator.services.mozilla.com/D175061
2023-04-11 10:43:44 +00:00
Narcis Beleuzu 1615701d47 Backed out 5 changesets (bug 1787182) for bustages on vaapitest.cpp . CLOSED TREE
Backed out changeset f40c90d3ed12 (bug 1787182)
Backed out changeset 0771c006513a (bug 1787182)
Backed out changeset 21e692c2f871 (bug 1787182)
Backed out changeset e084be47c307 (bug 1787182)
Backed out changeset 6a1b9e363c54 (bug 1787182)
2023-04-07 18:11:21 +03:00
stransky b9d3c8c94e Bug 1787182 [Linux] Implement glxtest test as binary r=emilio
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
2023-04-07 11:51:54 +00:00
stransky 9a6e65770c Bug 1787182 [Linux] Run VA-API tests on supported hardware only r=emilio,gfx-reviewers,jgilbert
- 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
2023-04-07 11:51:53 +00:00
stransky 9e0c094c88 Bug 1787182 [Linux] Implement VA-API test as vaapitest binary r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171994
2023-04-07 11:51:53 +00:00
stransky b10d18f470 Bug 1821256 [Linux] Don't throttle webrender transactions on unmapped windows r=emilio
Based on patch by Emilio Cobos Álvarez (D172786)

Differential Revision: https://phabricator.services.mozilla.com/D173846
2023-04-05 08:26:30 +00:00
Norisz Fay 3d82e172c0 Backed out 5 changesets (bug 1787182) for causing bustage on glxtest.cpp and xpcshell failure on test_gfxBlacklist_Device.js
Backed out changeset 74758d7ccf41 (bug 1787182)
Backed out changeset 6267b0d60a1f (bug 1787182)
Backed out changeset 0fe756b5d74d (bug 1787182)
Backed out changeset e9a220ba6f47 (bug 1787182)
Backed out changeset be1774f1cceb (bug 1787182)
2023-04-05 11:34:32 +03:00
stransky 21ea86344c Bug 1787182 [Linux] Implement glxtest test as binary r=emilio
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
2023-04-05 06:14:14 +00:00
stransky aa36e08377 Bug 1787182 [Linux] Run VA-API tests on supported hardware only r=emilio,gfx-reviewers,jgilbert
- 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
2023-04-05 06:14:14 +00:00
stransky 3a433bcd09 Bug 1787182 [Linux] Implement VA-API test as vaapitest binary r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171994
2023-04-05 06:14:14 +00:00
Cristian Tuns 0e24a2ef8a Backed out changeset 0846d258566e (bug 1821256) for causing mochitest failures in /test_group_keyboard.html CLOSED TREE 2023-04-03 10:21:04 -04:00
stransky 89dd65ae1e Bug 1821256 [Linux] Don't throttle webrender transactions on unmapped windows r=emilio
Based on patch by Emilio Cobos Álvarez (D172786)

Differential Revision: https://phabricator.services.mozilla.com/D173846
2023-04-03 11:20:38 +00:00
Emilio Cobos Álvarez cd0d1c9898 Bug 1822911 - Ignore bogus leave-notify on pekwm. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D174368
2023-04-03 09:03:11 +00:00
stransky c7acbaf043 Bug 1803016 [Wayland] Don't commit wl_buffer if buffer scale doesn't match its size r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D173814
2023-03-30 11:49:53 +00:00
Emilio Cobos Álvarez 35becb740f Bug 1825170 - [wayland] Improve access to nsWaylandDisplay. r=stransky
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
2023-03-30 09:36:31 +00:00
Iulian Moraru c3d101c26c Backed out changeset 67a0b67ad8bb (bug 1821256) for causing mochitest-plain failures on test_group_keyboard.html. 2023-03-29 20:52:14 +03:00
stransky f6f208a6c2 Bug 1821256 [Linux] Don't throttle webrender transactions on unmapped windows r=emilio
Based on patch by Emilio Cobos Álvarez (D172786)

Differential Revision: https://phabricator.services.mozilla.com/D173846
2023-03-29 10:21:52 +00:00
stransky 578781f2a3 Bug 1825010 Remove NS_NATIVE_DISPLAY as it's not used r=emilio,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D173841
2023-03-29 06:32:21 +00:00
Emilio Cobos Álvarez 5c72f63af1 Bug 1822764 - Only do the extra resizer pixel on KDE. r=stransky
It doesn't match the native GNOME behavior, so keep it in that DE only.

Differential Revision: https://phabricator.services.mozilla.com/D173676
2023-03-28 08:21:14 +00:00
Emilio Cobos Álvarez 42747dfd31 Bug 1824304 - Fix PiP window type hint after bug 1823350. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D173677
2023-03-28 08:20:09 +00:00
Andrew Osmond 82828dba9e Bug 1824778 - Block threadsafe GL and DMABUF blocklist on all NVIDIA binary drivers. r=gfx-reviewers,jrmuizel
We can unblock when we have an actual driver version that works.

Differential Revision: https://phabricator.services.mozilla.com/D173741
2023-03-27 17:07:00 +00:00
Cristina Horotan 3de280b975 Backed out 5 changesets (bug 1787182) for causing leaks on linux asan. CLOSED TREE
Backed out changeset c5518abf189e (bug 1787182)
Backed out changeset ade3e3a9ec67 (bug 1787182)
Backed out changeset 10299b2e3a6a (bug 1787182)
Backed out changeset d11d31ec4d81 (bug 1787182)
Backed out changeset bde24058d87c (bug 1787182)
2023-03-27 18:09:38 +03:00
stransky e8643079fd Bug 1787182 [Linux] Implement glxtest test as binary r=emilio
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
2023-03-27 13:47:21 +00:00
stransky 755cfff2a7 Bug 1787182 [Linux] Run VA-API tests on supported hardware only r=emilio,gfx-reviewers,jgilbert
- 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
2023-03-27 13:47:21 +00:00
stransky bdd226ef05 Bug 1787182 [Linux] Implement VA-API test as vaapitest binary r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171994
2023-03-27 13:47:20 +00:00
stransky 70e16f1549 Bug 1824307 [VAAPI] Disable HW video decoding on AMD R600 r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D173665
2023-03-27 13:00:19 +00:00
Iulian Moraru 5234db201c Backed out 5 changesets (bug 1787182) for causing leaks on linux asan. CLOSED TREE
Backed out changeset 34056df4e1d5 (bug 1787182)
Backed out changeset fea9dc3de652 (bug 1787182)
Backed out changeset 7e710b6500f0 (bug 1787182)
Backed out changeset fe70bf105370 (bug 1787182)
Backed out changeset 70439dbc72fd (bug 1787182)
2023-03-27 14:18:06 +03:00
stransky facf3ee2b4 Bug 1787182 [Linux] Implement glxtest test as binary r=emilio
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
2023-03-27 10:16:46 +00:00
stransky 08c92637d2 Bug 1787182 [Linux] Run VA-API tests on supported hardware only r=emilio,gfx-reviewers,jgilbert
- 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
2023-03-27 10:16:46 +00:00
stransky ce2bf1947c Bug 1787182 [Linux] Implement VA-API test as vaapitest binary r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171994
2023-03-27 10:16:45 +00:00
stransky 579b6fd6ed Bug 1823333 [VAAPI] Fix FEATURE_HW_DECODED_VIDEO_ZERO_COPY handling as it's allowlisted feature r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D173573
2023-03-27 07:37:20 +00:00
Cristina Horotan 6d2f4d1811 Backed out 5 changesets (bug 1787182) for causing build bustage at pangofc-font.h CLOSED TREE
Backed out changeset 2fc6b3fd4365 (bug 1787182)
Backed out changeset 0d097f0f6228 (bug 1787182)
Backed out changeset 6a359af2ce38 (bug 1787182)
Backed out changeset 3cd483e237a1 (bug 1787182)
Backed out changeset cb7d83d2253b (bug 1787182)
2023-03-24 15:26:38 +02:00
stransky 845150be4f Bug 1787182 [Linux] Implement glxtest test as binary r=emilio
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
2023-03-24 12:58:53 +00:00
stransky 7e30c8793d Bug 1787182 [Linux] Run VA-API tests on supported hardware only r=emilio,gfx-reviewers,jgilbert
- 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
2023-03-24 12:58:53 +00:00
stransky ed4d9becf7 Bug 1787182 [Linux] Implement VA-API test as vaapitest binary r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171994
2023-03-24 12:58:52 +00:00
Emilio Cobos Álvarez e40e19b677 Bug 1820203 - Don't consider dialogs with BorderStyle::{Default,All} as undecorated. r=stransky
Bug 1794577 made this visible but the bug was really introduced in
bug 1816436.

Differential Revision: https://phabricator.services.mozilla.com/D173428
2023-03-23 13:07:29 +00:00
stransky f68d52be59 Bug 1817660 [Linux] Sanity cases where GetWidget() returns empty widget r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D173426
2023-03-23 12:51:03 +00:00
Iulian Moraru f98405beb0 Backed out 4 changesets (bug 1787182) for causing multiple failures. CLOSED TREE
Backed out changeset 8e5214ecc91d (bug 1787182)
Backed out changeset 41e45dcc215a (bug 1787182)
Backed out changeset 63710cc6fda4 (bug 1787182)
Backed out changeset e75ee46f3a6f (bug 1787182)
2023-03-22 14:34:34 +02:00
stransky 6c1fdb761e Bug 1787182 [Linux] Run VA-API tests on supported hardware only r=emilio,gfx-reviewers,jgilbert
- 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
2023-03-22 08:36:20 +00:00
stransky 60270358dd Bug 1787182 [Linux] Implement VA-API test as vaapitest binary r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171994
2023-03-22 08:36:19 +00:00
Emilio Cobos Álvarez eb1c40734b Bug 1823336 - [wayland] For unanchored popups don't read anchor / popup gravity. r=stransky
This matches the nsMenuPopupFrame code.

There are a few places where we want to fix our position, and I unified
how we do this in the regressing bug.

ShouldFollowAnchor() = false popups like this used to just not be repositioned directly:

  https://hg.mozilla.org/mozilla-central/rev/c15f0fb1c92375ea751b3916a4c25a34403f21b2#l9.274

IsNoAutoHide() popups fixed their position once:

  https://hg.mozilla.org/mozilla-central/rev/c15f0fb1c92375ea751b3916a4c25a34403f21b2#l9.867

I unified in the noautohide behavior but in a better place here:

  https://hg.mozilla.org/mozilla-central/rev/c15f0fb1c92375ea751b3916a4c25a34403f21b2#l9.1182

But this trips this Wayland code which wasn't treating AnchorType_Point
popups properly.

The fact that this popup doesn't follow the anchor feels wrong, but is
pre-existing.

Differential Revision: https://phabricator.services.mozilla.com/D173004
2023-03-21 12:32:02 +00:00
Emilio Cobos Álvarez c2a9cc3dc2 Bug 1818517 - Ignore crossing-due-to-grab-start events. r=stransky
An alternative for this could be to just ignore leave-notify during a
drag, but that seemed a bit more hackish.

Differential Revision: https://phabricator.services.mozilla.com/D172914
2023-03-21 11:51:17 +00:00
Emilio Cobos Álvarez 6c885e916b Bug 1820405 - Ignore bogus enter-leave by default in lg3d/qtile. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D172656
2023-03-16 14:49:08 +00:00
Emilio Cobos Álvarez 341583af94 Bug 1822315 - Ignore empty env vars in desktop environment detection. r=stransky
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
2023-03-16 14:48:39 +00:00
CanadaHonk 3bbca01da2 Bug 1736914 - Implement prefers-reduced-transparency media query r=geckoview-reviewers,emilio,jonalmeida,ohall
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
2023-03-13 21:30:17 +00:00
stransky a69939c237 Bug 1802844 [Linux] Disable HW_DECODED_VIDEO_ZERO_COPY on AMD hardware r=aosmond
Depends on D171554

Differential Revision: https://phabricator.services.mozilla.com/D171555
2023-03-09 08:57:42 +00:00
Brad Werth b208a0eb8b Bug 1798360: Once again allow WebRender on Wayland R600 devices with new-enough drivers. r=aosmond
Upstream driver fixes noted in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822 imply
that the root cause has been fixed. Bug 1673939 has been closed and it's
not clear we should keep these drivers on the blacklist.

Differential Revision: https://phabricator.services.mozilla.com/D169789
2023-03-08 19:47:16 +00:00
Andrew Osmond d91c1383f9 Bug 1820267 - Unship EGL on Linux for older NVIDIA binary drivers. r=gfx-reviewers,lsalzman
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
2023-03-07 23:05:04 +00:00
Emilio Cobos Álvarez f66702754b Bug 1820204 - Simplify some wayland vsync code. r=rmader
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
2023-03-03 20:47:51 +00:00
Andrew Osmond 0e9a5d22fd Bug 1820181 - Update threadsafe GL and DMABUF blocklist to include NVIDIA 530.30.02. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D171567
2023-03-03 15:31:31 +00:00
Andrew Osmond 9e362622bf Bug 1820055 - Block threadsafe GL and DMABUF on NVIDIA binary drivers older than 530.0. r=gfx-reviewers,gw
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
2023-03-03 01:25:23 +00:00
filips 20d7c9c0d8 Bug 1747722 - Allow changing window class hints using attributes. r=emilio,stransky
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
2023-03-02 16:22:05 +00:00
Andrew Osmond bf1c2d1d90 Bug 1819466 - Ship X11 EGL to NVIDIA 340.108+ users on Linux to early beta and nightly. r=gfx-reviewers,lsalzman
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
2023-02-28 22:51:07 +00:00
Emilio Cobos Álvarez 18cac670c1 Bug 1794577 - Enable aspect-ratio locking on KDE too. r=stransky
Seems to work nicely.

Differential Revision: https://phabricator.services.mozilla.com/D171077
2023-02-28 14:20:39 +00:00
Emilio Cobos Álvarez 799cf59ddb Bug 1794577 - Set dummy titlebar for always-undecorated windows. r=stransky
This prevents the system titlebar from showing up in Plasma+Wayland.

Differential Revision: https://phabricator.services.mozilla.com/D171076
2023-02-28 14:20:39 +00:00
Emilio Cobos Álvarez 0989a7f163 Bug 1794577 - Clear decorations from PiP window earlier during creation. r=stransky
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
2023-02-28 14:20:39 +00:00
Emilio Cobos Álvarez c548fc1e68 Bug 1794577 - Minor clean-up to CSD code. r=stransky
No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D171074
2023-02-28 14:20:38 +00:00
Emilio Cobos Álvarez 35d0536284 Bug 1819034 - Reset LookAndFeel only if color scheme is really changed r=stransky
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
2023-02-28 14:08:37 +00:00
Andrew Osmond 14eac2383e Bug 1818992 - Ship X11 EGL on Mesa 17+ to match WebRender. r=webdriver-reviewers,gfx-reviewers,whimboo,lsalzman
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
2023-02-27 21:33:24 +00:00
stransky 186789dac5 Bug 1809026 [Linux] Reference DMABufSurface when it's created/imported r=emilio
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
2023-02-27 11:20:33 +00:00
Csoregi Natalia 43261efa2b Backed out 2 changesets (bug 1777849) for causing webgl crashes. CLOSED TREE
Backed out changeset af3c076c00d6 (bug 1777849)
Backed out changeset 536f32f1cf47 (bug 1777849)
2023-02-25 15:29:32 +02:00
Lee Salzman 0621e7027b Bug 1777849 - Disable FEATURE_THREADSAFE_GL on libX11 < 1.7. r=gfx-reviewers,ahale
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
2023-02-25 07:27:31 +00:00
stransky c0e0c3d0ea Bug 1813407 [Linux] Remove unused nsWindow::GetMozContainerSize() r=emilio
Depends on D169907

Differential Revision: https://phabricator.services.mozilla.com/D169908
2023-02-23 10:52:15 +00:00
stransky ba4ca0b344 Bug 1813407 [Linux] Get window size from compositor widget if possible in WindowSurfaceWaylandMultiBuffer backend r=emilio
- 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
2023-02-23 10:52:15 +00:00
stransky e86924571a Bug 1813407 [Linux] Allow to initialize WindowSurfaceProvider with GtkCompositorWidget for OMTC rendering r=emilio
Depends on D169905

Differential Revision: https://phabricator.services.mozilla.com/D169906
2023-02-23 10:52:14 +00:00
Ray Kraesig fa4832237d Bug 1816740 [4/6] - convert nsIFilePicker::mode* into a proper enum r=ipc-reviewers,karlt,mstange,handyman,nika
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
2023-02-22 21:05:24 +00:00
Ray Kraesig 8ff42fa236 Bug 1816740 [3/6] - convert nsIFilePicker::result* into a proper enum r=ipc-reviewers,karlt,mstange,handyman,nika
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
2023-02-22 21:05:23 +00:00
Masayuki Nakano 0dfc1d00f9 Bug 1810406 - Handle asynchronous composition without synthesized `GDK_KEY_PRESS` event r=m_kato
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
2023-02-21 22:51:43 +00:00
Stanca Serban 200dca5cfb Backed out 4 changesets (bug 1813407) for causing Linux bp-hybrid bustages in WindowSurfaceProvider.h. CLOSED TREE
Backed out changeset 897b95c7fdad (bug 1813407)
Backed out changeset aba3e370a587 (bug 1813407)
Backed out changeset 61c79624c2ab (bug 1813407)
Backed out changeset f99d85efb04c (bug 1813407)
2023-02-21 12:54:32 +02:00
stransky b2f02e0367 Bug 1813407 [Linux] Remove unused nsWindow::GetMozContainerSize() r=emilio
Depends on D169907

Differential Revision: https://phabricator.services.mozilla.com/D169908
2023-02-21 09:30:12 +00:00
stransky d170405210 Bug 1813407 [Linux] Get window size from compositor widget if possible in WindowSurfaceWaylandMultiBuffer backend r=emilio
- 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
2023-02-21 09:30:11 +00:00
stransky 1b56bde4d2 Bug 1813407 [Linux] Allow to initialize WindowSurfaceProvider with GtkCompositorWidget for OMTC rendering r=emilio
Depends on D169905

Differential Revision: https://phabricator.services.mozilla.com/D169906
2023-02-21 09:30:10 +00:00
Jonathan Kew 5b9588f1aa Bug 1815404 - Eliminate gfxContext::CreatePreservingTransformOrNull, and replace callers with stack-allocated gfxContext. r=gfx-reviewers,lsalzman
Depends on D170369

Differential Revision: https://phabricator.services.mozilla.com/D170370
2023-02-21 07:28:24 +00:00
Jonathan Kew 1b3e69f8aa Bug 1815404 - Remove refcounting from gfxContext. r=gfx-reviewers,lsalzman
Depends on D170367

Differential Revision: https://phabricator.services.mozilla.com/D170369
2023-02-21 07:28:24 +00:00
Emilio Cobos Álvarez c096b29240 Bug 1817396 - Try to draw the native GTK tooltip a bit harder. r=stransky
If we know that the light and dark foreground colors are the same we can
probably get away with it.

Differential Revision: https://phabricator.services.mozilla.com/D170247
2023-02-20 16:18:26 +00:00
stransky bfffdac75d Bug 1811637 [Linux] Detach accessible from moz_container before it's deleted r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D169197
2023-02-20 12:29:05 +00:00
Emilio Cobos Álvarez 9906d6868c Bug 1817451 - Make auto-style outline always non-native. r=cmartin,stransky,mac-reviewers,bradwerth
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
2023-02-20 11:58:38 +00:00
Andreas Pehrson c3c322ea16 Bug 1816436 - On GTK allow window manager menu on all always-on-top windows. r=stransky
This enables the menu so a user can choose to keep also the global webrtc
indicator on top of all workspaces.

Differential Revision: https://phabricator.services.mozilla.com/D169785
2023-02-16 14:50:24 +00:00
Andreas Pehrson 0b16ff8d4f Bug 1816436 - On GTK set decoration when no titlebar and resize handles requested. r=stransky
This avoids drawing border and shadow of a hidden titlebar for the global
webrtc indicator.

Differential Revision: https://phabricator.services.mozilla.com/D169784
2023-02-16 14:50:24 +00:00
stransky c813e487bc Bug 1815712 [Linux] Remove ATK maiRedundantObjectFactory as it's not used any more r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D169206
2023-02-16 10:05:17 +00:00
Gabriel Bustamante add0179a08 Bug 1799503 - Update Firefox via APT (not balrog) in our .deb packages r=bytesized
Differential Revision: https://phabricator.services.mozilla.com/D168324
2023-02-15 16:40:29 +00:00
stransky 498077e020 Bug 1807942 [Linux] Don't use dmabuf surface if ExportDMABUFImageMESA() fails to export dmabuf file descriptors r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D169315
2023-02-10 08:04:13 +00:00
stransky ea17a88f1e Bug 1807942 [Linux] Don't crash when mGbmBufferObject is missing in DMABufSurfaceRGBA r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D169314
2023-02-10 08:04:12 +00:00
stransky e2f197467f Bug 1811878 [Linux] If we fail to create YUV dmabuf plane with modifiers, try without it r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D168044
2023-02-09 12:40:37 +00:00
Stanca Serban 03d5025b0b Backed out 2 changesets (bug 1811878) for causing bustages in FFmpegVideoFramePool.cpp. CLOSED TREE
Backed out changeset e37ee30891ca (bug 1811878)
Backed out changeset 601c39a76573 (bug 1811878)
2023-02-09 12:54:11 +02:00
stransky bdb4dc8b05 Bug 1811878 [Linux] If we fail to create YUV dmabuf plane with modifiers, try without it r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D168044
2023-02-09 09:43:02 +00:00
stransky ccdefe634b Bug 1812290 [Linux] Check if dmabuf surface copy works and don't use it on broken systems r=alwu,emilio,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D167917
2023-02-08 13:35:08 +00:00
Makoto Kato a81830ccdb Bug 1812938 - Part 1. GetWidgetScreen returns Screen instead of nsIScreen. r=emilio,geckoview-reviewers,owlish
`nsIWidget` isn't scriptable, so it is unnecessary to return `nsIScreen` for
`GetWidgetScreen`.

Differential Revision: https://phabricator.services.mozilla.com/D168029
2023-02-06 04:51:26 +00:00
Stephen A Pohl 1058fb4fa4 Bug 1763990: Don't order popups in front of native context menus on macOS. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D168625
2023-02-02 22:13:54 +00:00
welpy-cw 93f3096b21 Bug 1813498 - Make popup modal also on X11. r=emilio,stransky
Differential Revision: https://phabricator.services.mozilla.com/D168599
2023-02-02 09:22:06 +00:00
Neil Deakin 9c2e7458ba Bug 1776879, replace text/unicode for clipboard and drag and drop and use text/plain directly, r=edgar,mak,stransky,geckoview-reviewers,extension-reviewers,zombie,m_kato
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
2023-02-01 23:30:55 +00:00
stransky 6a3725cf27 Bug 1813500 [Linux] Don't hang Firefox when glxtest process hangs r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D168385
2023-02-01 20:09:36 +00:00
Jed Davis 1e34d39292 Bug 1814291 - Grab the pointer for popups under FVWM. r=emilio
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
2023-02-01 18:35:27 +00:00
Emilio Cobos Álvarez 3155509beb Bug 1813697 - Honor full CSS-to-device scale for native GTK widgets. r=stransky
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
2023-02-01 14:06:04 +00:00
Emilio Cobos Álvarez f50650c700 Bug 1813697 - Add support for drawing native widgets with fractional scales. r=stransky
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
2023-02-01 13:52:35 +00:00
Emilio Cobos Álvarez c9cfd3c18a Bug 1814015 - Cleanup gtk native theme unit usage. r=stransky
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
2023-02-01 13:44:16 +00:00
Emilio Cobos Álvarez abe966a366 Bug 1814015 - Remove unnecessary GetExtraSizeForWidget call. r=stransky
The nsRect already accounts for it it shouldn't be needed:

  https://searchfox.org/mozilla-central/rev/8e9b4484408154b80d7ede9e1b035819fda48fd2/layout/painting/nsDisplayList.cpp#3742-3746

Differential Revision: https://phabricator.services.mozilla.com/D168364
2023-02-01 13:33:34 +00:00
Emilio Cobos Álvarez a244b83d39 Bug 1814015 - Remove dead chunk of theming code. r=stransky
We're doing work but then returning false (and thus doing nothing with it), so
just remove this code.

Differential Revision: https://phabricator.services.mozilla.com/D168363
2023-02-01 13:33:33 +00:00
Emilio Cobos Álvarez 42c1d07a59 Bug 1813554 - Add one pixel of artificial resize margin to the top of the window when drawing to the titlebar. r=stransky
This allows resizing tiled windows easily on KDE which is not possible
otherwise.

Differential Revision: https://phabricator.services.mozilla.com/D168283
2023-02-01 13:31:37 +00:00
Emilio Cobos Álvarez 3a46916749 Bug 1812698 - Expose desktopEnvironment via nsIXULRuntime rather than nsIGfxInfo. r=stransky
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
2023-02-01 13:14:50 +00:00
Marian-Vasile Laza 4500d9fd5a Backed out changeset c37e07978bca (bug 1813500) for causing bustages on GfxInfo.cpp. CLOSED TREE 2023-02-01 15:24:30 +02:00
stransky 2e29775776 Bug 1813500 [Linux] Don't hang Firefox when glxtest process hangs r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D168385
2023-02-01 12:53:09 +00:00
Emilio Cobos Álvarez 2e09707d8a Bug 1813554 - Make resize cursors match GTK ones. r=stransky
Depends on D168283

Differential Revision: https://phabricator.services.mozilla.com/D168284
2023-01-31 10:43:05 +00:00
Emilio Cobos Álvarez 3fb7ea6a20 Bug 1813554 - Clean-up CheckResizerEdge. r=stransky
No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D168282
2023-01-31 10:41:29 +00:00
Emilio Cobos Álvarez 33660d726e Bug 1813070 - Partially back out bug 1811486 for causing this bug.
MANUAL PUSH: Trivial backout CLOSED TREE
2023-01-30 16:44:06 +01:00
Emilio Cobos Álvarez e7fa71f013 Bug 1813303 - Clean up nsIWidget::SetNonClientMargins usage. r=spohl
Make it take a const reference and simplify callers.

No behavior change, but noticed while looking through this code.

Differential Revision: https://phabricator.services.mozilla.com/D168199
2023-01-28 21:43:47 +00:00
Emilio Cobos Álvarez c997602a07 Bug 1812289 - Enable CSD titlebar more by default. r=stransky
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
2023-01-25 16:52:59 +00:00
Emilio Cobos Álvarez dceff5d8b7 Bug 1811486 - Re-enable panel animations on KDE. r=stransky
Depends on D167413

Differential Revision: https://phabricator.services.mozilla.com/D167414
2023-01-25 12:28:02 +00:00
Emilio Cobos Álvarez cbf38338a3 Bug 1811486 - Don't animate popups rolled-up on minimized windows. r=stransky
Depends on D167381

Differential Revision: https://phabricator.services.mozilla.com/D167413
2023-01-25 11:37:46 +00:00
Robert Mader 083c166b77 Bug 1812102 - Webrender Nvidia baseline driver version mixed up, r=gfx-reviewers,lsalzman
In D160120 `460.32.03` and `470.82.0` got mixed up to `460.82.0`.

Differential Revision: https://phabricator.services.mozilla.com/D167695
2023-01-24 20:26:55 +00:00
Emilio Cobos Álvarez 46dd8a0d40 Bug 1811487 - Clean-up popup hide / rollup APIs. r=cmartin,stransky
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
2023-01-24 15:43:49 +00:00
Emilio Cobos Álvarez 4fa60b3b58 Bug 1798697 - Use outside rather than closest pixels for popup sizes, and don't clamp translucent popups. r=tnikkel
Both are needed to make this look ok.

Differential Revision: https://phabricator.services.mozilla.com/D167494
2023-01-24 11:24:48 +00:00
Emilio Cobos Álvarez aa08972ea1 Bug 1810797 - Disable panel animations on KDE/x11 for now. r=stransky
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
2023-01-24 11:09:40 +00:00
Emilio Cobos Álvarez 9e530f224a Bug 1811834 - Clean up nsWidgetInitData. r=cmartin,geckoview-reviewers,calu
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
2023-01-23 23:58:41 +00:00
Iulian Moraru a713f3dd73 Backed out changeset f9a25f51a254 (bug 1811487) for causing bc failures related to PanelMultiView. CLOSED TREE 2023-01-23 21:11:43 +02:00
Emilio Cobos Álvarez e8d9ad8d88 Bug 1811487 - Clean-up popup hide / rollup APIs. r=cmartin
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
2023-01-23 16:15:00 +00:00
Butkovits Atila 8ee1c95687 Backed out 2 changesets (bug 1811487) for causing failures at browser_PanelMultiView_keyboard.js. CLOSED TREE
Backed out changeset 88c5316c2183 (bug 1811487)
Backed out changeset 6350911c1c8d (bug 1811487)
2023-01-23 16:18:50 +02:00
Emilio Cobos Álvarez 5c3fc07c2e Bug 1811487 - Clean-up popup hide / rollup APIs. r=cmartin
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
2023-01-23 11:58:25 +00:00
Emilio Cobos Álvarez 621ecbc13a Bug 1811475 - Fix a pre-existing x11-only build issue.
No review, trivial change.

Differential Revision: https://phabricator.services.mozilla.com/D167383
2023-01-20 14:47:32 +00:00
Emilio Cobos Álvarez e12d86562b Bug 1805939 - Ignore bogus leave-notify events on known-broken environments. r=stransky,jld
Depends on D166090

Differential Revision: https://phabricator.services.mozilla.com/D166091
2023-01-20 11:26:11 +00:00
Emilio Cobos Álvarez 46df319668 Bug 1805939 - Have a central source of truth for desktop environment detection. r=stransky,jld
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
2023-01-20 11:26:11 +00:00
Emilio Cobos Álvarez 20d4fcf500 Bug 1791442 - Explicitly check for SNAP_NAME of MOZ_APP_NAME to detect Snap. r=mkaply,jmaher,xpcom-reviewers,nika
Make snap xpcshell tests run with the right environment variables
instead of tweaking them at runtime.

Differential Revision: https://phabricator.services.mozilla.com/D166523
2023-01-19 10:52:41 +00:00
Emilio Cobos Álvarez fb2c879af9 Bug 1569439 - Rollup tooltips on window blur. r=stransky
This ensures that tooltips don't stick around if the window manager
doesn't send correct leave-notify events.

Differential Revision: https://phabricator.services.mozilla.com/D166945
2023-01-19 10:49:56 +00:00
stransky dfddf18569 Bug 1809162 [Linux] Implement dmabuf YUV surface copy r=emilio
- 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
2023-01-19 10:44:44 +00:00
stransky bade222e47 Bug 1809162 [Linux] Fixed ClaimSnapshotGLContext() logs r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D166329
2023-01-19 10:44:43 +00:00
stransky 0cfbaddb9d Bug 1809162 [Linux] Implement GetAndConfigureDMABufDevice() to configure dmabuf backend without gfxPlatform on RDD process r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D166328
2023-01-19 10:44:43 +00:00
Iulian Moraru 48c1ab021b Backed out changeset 60cda7d831ca (bug 1791442) for causing bc failures on browser_ua_snap_ubuntu.js. 2023-01-19 07:56:39 +02:00