Commit Graph

3269 Commits

Author SHA1 Message Date
Mike Hommey
5af31a8886 Bug 1839762 - Cast scoped enums to their underlying type when printing them. r=media-playback-reviewers,necko-reviewers,application-update-reviewers,geckoview-reviewers,handyman,emilio,valentin,bytesized,owlish,karlt
There is no implicit conversion for scoped enums, so using them without
an explicit conversion in varargs functions is undefined behavior. GCC
has had a warning about this for a long while, but clang only gained
this a few days ago on trunk.

Differential Revision: https://phabricator.services.mozilla.com/D181723
2023-06-24 20:14:31 +00:00
Tom Schuster
c6275439e2 Bug 1837153 - Make RFPTarget parameter of ShouldResistFingerprinting with nsIChannel non-optional. r=tjr,cookie-reviewers,timhuang,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D180199
2023-06-13 19:32:17 +00:00
Botond Ballo
bcbcd41ab6 Bug 1837679 - Fix include-what-you-use errors in widget/android/nsWindow.cpp. r=ohall
Differential Revision: https://phabricator.services.mozilla.com/D180484
2023-06-09 20:17:36 +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
Kershaw Chang
5149a41b0e Bug 1543990 - Simplify nsISpeculativeConnect API, r=necko-reviewers,geckoview-reviewers,search-reviewers,valentin,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D179066
2023-06-01 09:46:12 +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
Masayuki Nakano
1fb277421c Bug 1832726 - part 1: Make Android widget always dispatch keyboard events during composition r=m_kato,geckoview-reviewers
I think that we don't need the prefs to disable the behavior because the
behavior conforms to UI Events definition and we've shipped the behavior in
2018.  Therefore, nobody shouldn't require to disable the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D177999
2023-05-16 22:42:59 +00:00
Hiroyuki Ikezoe
04ba6da88c Bug 1817330 - Inform a reasonable APZHandledResult to GeckoView even if the APZ's result is nsEventStatus_eConsumeNoDefault. r=botond,geckoview-reviewers,owlish
Note that for touch events there are two possibilities where
InputQueue::ReceiveInputEvent() returns nsEventStatus_eConsumeNoDefault, a) the
touch input block is in a state of fast fling or b) the touch input block is in
a state of internal slop.

In the case of b) the nsEventStatus_eConsumeNoDefault status will never be used
since
 1) In cases of delayed results we just use the APZHandledResult we don't refer
    the nsEventStatus at all [1]
 2) In cases of non-delayed results even if the initial touch-start event gets
    into slop, TouchBlockState::UpdateSlopState returns false [2], thus APZ
    immediately reports one of the other nsEventStatuses and any subsequent
    statuses will never be used [3]

In the case of a) nsEventStatus_eConsumeNoDefault means the event doesn't need
to be sent to content, it doesn't mean any APZC didn't scroll by the event.

Also note that there's an automated test exercising the scenario a). It was
flaky before (bug 1687842), but now it appears to be stable.

[1] https://searchfox.org/mozilla-central/rev/32c74afbb24dce4b5dd6b33be71197e615631d71/gfx/layers/apz/src/InputQueue.cpp#986
[2] https://searchfox.org/mozilla-central/rev/32c74afbb24dce4b5dd6b33be71197e615631d71/gfx/layers/apz/src/InputBlockState.cpp#774-784
[3] https://searchfox.org/mozilla-mobile/rev/9fd115db1da9958a32c2cb2943fef79c1a0cac4a/firefox-android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/NestedGeckoView.kt#85,122-132

Differential Revision: https://phabricator.services.mozilla.com/D177456
2023-05-15 23:21:54 +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
Emilio Cobos Álvarez
3a99b7feb9 Bug 1831136 - Plumb android text scale via nsLookAndFeel. r=geckoview-reviewers,dholbert,owlish
That's how we do it for all other platforms. Do this rather than via a
custom mostly-untested pref, which allows us to simplify text zoom
handling.

Differential Revision: https://phabricator.services.mozilla.com/D177062
2023-05-11 19:01:19 +00:00
Ray Kraesig
bde5814318 Bug 1832168 - [3/3] Remove nsIWidget::SetNativeData() r=emilio,geckoview-reviewers,m_kato
Remove `nsIWidget::SetNativeData()` and all implementations thereof, as
none of them have had any functionality or use since bug 1338172.

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D177568
2023-05-11 01:13:06 +00:00
Jamie Nicol
ba52b0e1e3 Bug 1824083 - Request new Surface from application when resuming compositor fails on Android. r=gfx-reviewers,geckoview-reviewers,nical,m_kato
We see a fair number of crashes caused by failing to create an EGL
surface when resuming the compositor on Android. We believe that in
the vast majority of these cases the Surface we have been provided by
the OS is in an invalid state, and therefore we will never succeed in
creating an EGL surface from it.

Currently when creating the EGL surface fails we raise a NEW_SURFACE
webrender error. This causes us to fall back through webrender
configurations, reinitialize the compositors, and eventually crash
when we are still unable to resume. None of this will help when the
Android Surface we have been provided is in this invalid state.

This patch therefore avoids raising the webrender error initially, and
instead gives the widget an opportunity to handle the failure. The
widget uses the new GeckoView API added in the previous patch in this
series to request a new Surface from the application. This will cause
another resume event immediately afterwards with a new - and hopefully
valid - surface, allowing the EGL surface to be created and the
compositor to be successfully resumed. If we are still unable to
create an EGL surface after this, then we will raise the webrender
error as before, likely eventually resulting in a crash.

Differential Revision: https://phabricator.services.mozilla.com/D176721
2023-05-10 15:50:22 +00:00
Jamie Nicol
26e6758aea Bug 1824083 - Remove previous attempts to detect and work around invalid Surface bug. r=gfx-reviewers,geckoview-reviewers,nical,m_kato
The detection is inadequate and the workaround does not work on all
versions of Android. Later patches in this series will replace this
with something better.

Differential Revision: https://phabricator.services.mozilla.com/D176719
2023-05-10 15:50:21 +00:00
Sandor Molnar
84e52573e7 Backed out 4 changesets (bug 1824083) for causing build bustages in include/mozilla/webrender/RenderCompositorOGLSWGL.h CLOSED TREE
Backed out changeset 7c1be037e345 (bug 1824083)
Backed out changeset bf5c5929ef7b (bug 1824083)
Backed out changeset 6fad491b84be (bug 1824083)
Backed out changeset 57ae9c87c467 (bug 1824083)
2023-05-10 18:01:13 +03:00
Jamie Nicol
d3fb4b5d33 Bug 1824083 - Request new Surface from application when resuming compositor fails on Android. r=gfx-reviewers,geckoview-reviewers,nical,m_kato
We see a fair number of crashes caused by failing to create an EGL
surface when resuming the compositor on Android. We believe that in
the vast majority of these cases the Surface we have been provided by
the OS is in an invalid state, and therefore we will never succeed in
creating an EGL surface from it.

Currently when creating the EGL surface fails we raise a NEW_SURFACE
webrender error. This causes us to fall back through webrender
configurations, reinitialize the compositors, and eventually crash
when we are still unable to resume. None of this will help when the
Android Surface we have been provided is in this invalid state.

This patch therefore avoids raising the webrender error initially, and
instead gives the widget an opportunity to handle the failure. The
widget uses the new GeckoView API added in the previous patch in this
series to request a new Surface from the application. This will cause
another resume event immediately afterwards with a new - and hopefully
valid - surface, allowing the EGL surface to be created and the
compositor to be successfully resumed. If we are still unable to
create an EGL surface after this, then we will raise the webrender
error as before, likely eventually resulting in a crash.

Differential Revision: https://phabricator.services.mozilla.com/D176721
2023-05-10 14:44:50 +00:00
Jamie Nicol
c958bba972 Bug 1824083 - Remove previous attempts to detect and work around invalid Surface bug. r=gfx-reviewers,geckoview-reviewers,nical,m_kato
The detection is inadequate and the workaround does not work on all
versions of Android. Later patches in this series will replace this
with something better.

Differential Revision: https://phabricator.services.mozilla.com/D176719
2023-05-10 14:44:50 +00:00
Makoto Kato
198101a072 Bug 1827386 - Part 2. Don't re-attach SessionAccessibility until Detach is completely finished. r=geckoview-reviewers,owlish
Although `GeckoViewSupport::Transfer` will re-attach `SessionAccessibility`,
it doesn't wait for previous `SessionAccessibility` is disposed completely
since `SessionAccessibility::OnWeakNonIntrusiveDetach` makes tasks only.

When worst case,

1. Create a task for calling SessionAccessilibity::SetAttached(false) on Android UI thread.
2. Create a task for calling SessionAccessilibity::SetAttached(true) on Android UI thread.
3. Attach new JNI object to SeessionAccessibility
4. Run 1's task on Android UI thread, then create a task for disposing JNI object on Gecko thread.
5. Run 2's task on Android UI thread.
6. Run 4's task on Gecko thread. JNI object is detached incorrectly if JNI object is recycled.

If reattaching same JNI object, we detach new object unfortunately. Since I add
MozPromise By Part 1, we can wait for it to use this API.

Depends on D175335

Differential Revision: https://phabricator.services.mozilla.com/D175336
2023-05-09 05:13:32 +00:00
Makoto Kato
b67709d926 Bug 1827386 - Part 1. NativeWeakPtr::Detach returns MozPromise to detect whether dispoer is finished. r=geckoview-reviewers,owlish
Actually, `NativeWeakPtr::Detach` may not release JNI ojbect immediately because
it depends on JNI object's `OnWeakNonIntrusiveDetach`i implementation.
`SessionAccessibility`'s `OnWeakNonIntrusiveDetach` implementation uses the
runnable to run on Android UI thread then disposer runs on main thread, so
if Detach is finished, JNI object isn't detached yet.

If calling `NativeWeakPtrHolder::Attach` immediately with same/recycled Java
object after `NettiveWeakPtr::Detach`, it is possible to run disposer for JNI
object by `OnWeakNonIntrusiveDetach` after Attach is finished. So it may
release newer attached object unfortunately.

So I would like to add a way to waiting for detach JNI object using
`MozPromise`.

Also, `MozPromise.h` includes `Natives.h` header (for `GeckoResult` support).
So I cannot modify inline method to use `MozPromise` due to recursive. So I
split implementation with `NativesInlines.h` as workaround.

Differential Revision: https://phabricator.services.mozilla.com/D175335
2023-05-09 05:13:32 +00:00
Olivia Hall
23e5c337c2 Bug 1823082 - GeckoView PDF Stream Adjustment r=geckoview-reviewers,jonalmeida,amejiamarmol
If an issue occurs when generating the PDF stream, we should be able to
send an error. The prior function (SendError()) was for stream readers
to use. The error state here can occur during writing.

Created a WriteError() option to set an error state that will cause
an IOException when reading to indicate the stream is in an inconclusive
state and to stop reading from it.

Differential Revision: https://phabricator.services.mozilla.com/D175918
2023-04-24 13:15:30 +00: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
Dan Robertson
3e22d70394 Bug 1774875 - Immediately fire click events for non-scrollable elements. r=botond,geckoview-reviewers,m_kato
Non-scrollable elements are immediately activated on touch-start, so it
is not necessary to delay firing the synthesized mouse and click events.

Differential Revision: https://phabricator.services.mozilla.com/D169727
2023-04-20 13:26:25 +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
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
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
Andi-Bogdan Postelnicu
bf2bb59367 Bug 1277372 - Move away from "mozilla/TypeTraits.h". r=geckoview-reviewers,sergesanspaille,m_kato
std::is_pod has been deprecated in C++20, see https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0767r1.html.
This is equivalent with std::is_trivial_v && std::is_standard_layout.

Differential Revision: https://phabricator.services.mozilla.com/D174128
2023-04-17 13:50:11 +00:00
Valentin Gosu
401d933a4f Bug 1827504 - Remove last files of netwerk/cache/ r=sunil,geckoview-reviewers,zeid,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D175177
2023-04-13 09:04:24 +00:00
Alexandre Lissy
32a6eaf06f Bug 1819311 - Collect errors on process launch r=nika,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D171226
2023-04-13 08:35:24 +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
Makoto Kato
785a9d72ef Bug 1826027 - Check whether window is destroyed during starting touch event. r=geckoview-reviewers,calu
`HandleMotionEvent` have a race condition of destroying `nsWindow` (in Gecko
main thread) and dispatching touch event (Android UI thread). When destroying
the window, it can accept motion event.

So we should check whether window is destroyed.

Differential Revision: https://phabricator.services.mozilla.com/D174390
2023-04-04 04:00:09 +00:00
serge-sans-paille
13e51277df Bug 1825324 - Make widget/* buildable outside of a unified build environment r=andi,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D173969
2023-04-01 08:31:12 +00:00
Cristian Tuns
8e06a7a853 Backed out 12 changesets (bug 1825325, bug 1825336, bug 1825333, bug 1825332, bug 1825324, bug 1824557, bug 1825328, bug 1825335, bug 1825330, bug 1825329, bug 1825327, bug 1825331) for causing build bustages in nsClipboard.cpp CLOSED TREE
Backed out changeset 9de3ed24d3a0 (bug 1825336)
Backed out changeset aef787728f19 (bug 1825335)
Backed out changeset a04c341244c1 (bug 1825333)
Backed out changeset e3ad15f762ba (bug 1825332)
Backed out changeset eed23da92a27 (bug 1825331)
Backed out changeset 8213bb54376e (bug 1825330)
Backed out changeset 747ec5ac4994 (bug 1825329)
Backed out changeset e91ff431f92d (bug 1825328)
Backed out changeset 59c18d13768b (bug 1825327)
Backed out changeset 538096d99e49 (bug 1825325)
Backed out changeset c76eb9d9b095 (bug 1825324)
Backed out changeset 8b81410eb686 (bug 1824557)
2023-03-31 12:58:53 -04:00
serge-sans-paille
0702cdc836 Bug 1825324 - Make widget/* buildable outside of a unified build environment r=andi,geckoview-reviewers,m_kato
Depends on D173637

Differential Revision: https://phabricator.services.mozilla.com/D173969
2023-03-31 13:29:44 +00:00
Nika Layzell
d57c9498f6 Bug 1825360 - Remove the NS_DISPATCH_SYNC flag, r=necko-reviewers,geckoview-reviewers,media-playback-reviewers,karlt,jesup,m_kato,emilio
This flag is not supported by most event targets and can have unexpected
side effects (namely spinning a nested event loop). All consumers have
been replaced with a new function which is more explicit about this side
effect.

Differential Revision: https://phabricator.services.mozilla.com/D173985
2023-03-30 16:53:51 +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
Makoto Kato
56258a05fc Bug 1822175 - Clean up dynamic refresh rate support on GeckoView. r=geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D172782
2023-03-22 15:35:16 +00:00
Sandor Molnar
79329846cc Backed out changeset a1261c0eb985 (bug 1822175) for causing xpc failures in widget/headless/tests/test_headless.js 2023-03-22 20:38:42 +02:00
Makoto Kato
7791ea4730 Bug 1822175 - Clean up dynamic refresh rate support on GeckoView. r=geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D172782
2023-03-22 15:35:16 +00:00
Olivia Hall
41785a703d Bug 1659818 - Android window.print Implemented for Nightly r=emilio,m_kato,geckoview-reviewers
This bug implements and opens window.print() for Android in Nightly.
Adds "GeckoView:DotPrintRequest" and "GeckoView:DotPrintFinish" events.
GeckoView:DotPrintRequest requests a PDF of the current window.print
page for Android to print. GeckoView:DotPrintFinish releases the static
browser clone created by window.print. PDF generation was additionally
adjusted to get the expected canonical browser context when printing
iframes.

Differential Revision: https://phabricator.services.mozilla.com/D171159
2023-03-15 21:23:12 +00:00
Nika Layzell
3b40268cc1 Bug 1818305 - Part 2: Add a streamStatus method to nsIInputStream, r=xpcom-reviewers,necko-reviewers,geckoview-reviewers,valentin,jesup,m_kato,mccr8
This is semantically similar to the existing available() method, however will
not block, and doesn't need to do the work to actually determine the number of
available bytes.

As part of this patch, I also fixed one available() implementation which was
incorrectly throwing NS_BASE_STREAM_WOULD_BLOCK.

Differential Revision: https://phabricator.services.mozilla.com/D170697
2023-03-15 19:52:34 +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
Makoto Kato
051c921a72 Bug 1813573 - Part 2. Restart vsync when refresh rate is changed. r=geckoview-reviewers,owlish
When refresh rate is changed, `DisplayListener` is called. So we restart vsync
when refresh rate may be changed.

Differential Revision: https://phabricator.services.mozilla.com/D168666
2023-03-01 03:12:32 +00:00
Makoto Kato
9aca857df0 Bug 1813573 - Part 1. Clean up AndroidVsyncSource to get current refresh rate when enabling vsync. r=geckoview-reviewers,owlish
Newer Android supports multiple refresh rate that is dynamically changed.
Actually, GeckoView will always pass the refresh rate value to vsync when
getting it first time.

So this fix changes that GeckoView gets the refresh rate when vsync is started.

Differential Revision: https://phabricator.services.mozilla.com/D168665
2023-03-01 03:12:31 +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
Calixte
41eb47c48a Bug 1810761 - Add API to save a pdf file opened in pdf.js r=pdfjs-reviewers,geckoview-reviewers,marco,ohall,calu
Differential Revision: https://phabricator.services.mozilla.com/D168413
2023-02-03 10:01:34 +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
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
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
Florian Quèze
d7356251cd Bug 1768920 - Avoid polling every 5 seconds in nsUserIdleService, r=dthayer,geckoview-reviewers,owlish.
This changes the behavior in a few ways:
- the 'active' notification is now only fired when a new user event has been received by Firefox, rather than by any application on the entire system.
- the 'active' notification will fire immediately when Firefox receives a new event. Before the patch is was fired within 5s of the user returning on some plateforms (eg. Mac) and immediately on some other platforms that already called ResetIdleTimeout (windows, gtk, android). I'm not sure if these existing calls to ResetIdleTimeout are really needed, nor if they add significant overhead.
- when an idle observer has been notified of 'idle', it won't be notified again until Firefox receives events. Before the patch, if the user used other applications while Firefox was in the background, we would keep sending active and idle notifications to our idle observers. This behavior was probably initially intended when the nsUserIdleService was introduced to support the use case of instant messaging clients, but doesn't seem to match the expectations of the existing consumers of the service.

Differential Revision: https://phabricator.services.mozilla.com/D166306
2023-01-16 19:53:33 +00:00