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

4586 Коммитов

Автор SHA1 Сообщение Дата
Butkovits Atila 2d3fe7f943 Backed out 2 changesets (bug 1774082) for causing failure at test_windows_alert_service.js. CLOSED TREE
Backed out changeset a9553786b2ee (bug 1774082)
Backed out changeset da2ad41a6d10 (bug 1774082)
2022-08-01 01:40:13 +03:00
Nicholas Rishel 4f7f512a84 Bug 1774082 - Add AUMID handling for Windows toast notifications. r=nalexander
For MSIX packages, the package AUMID is used.

For NSIS/MSI installs, AUMID is retrieve from HKCR.

For portable builds, the registry is updated at runtime to populate icons, display name, and the COM server.

The COM server has been registered as will be implemented using DllSurrogate; this allows us to offload managing the eventloop and lifetime of the COM server to dllhost.exe, and minimizes the added code complexity.

The COM server is loaded as a separate executable from the sending process to prevent issues that would occur when multiple instances of the sending process (e.g. profiles running in parallel) try to stand up parallel COM servers. The separated COM executable also allows for multiple applications to share a common COM server.

Bonus: fixes Bug 1500054, Bug 1766095, and Bug 1743424.

Differential Revision: https://phabricator.services.mozilla.com/D151739
2022-07-31 21:59:30 +00:00
Nika Layzell c15823d075 Bug 1772006 - Part 5: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret
The biggest set of APIs from ns[T]StringObsolete which are still heavily used
are the string searching APIs. It appears the intention was for these to be
replaced by the `FindInReadable` APIs, however that doesn't appear to have
happened.

In addition, the APIs have some quirks around their handling of mixed character
widths. These APIs generally supported both narrow strings and the native
string type, probably because char16_t string literals weren't available until
c++11. Finally they also used easy-to-confuse unlabeled boolean and integer
optional arguments to control behaviour.

These patches do the following major changes to the searching APIs:

1. The ASCII case-insensitive search method was split out as
   LowerCaseFindASCII, rather than using a boolean. This should be less
   error-prone and more explicit, and allows the method to continue to use
   narrow string literals for all string types (as only ASCII is supported).
2. The other [R]Find methods were restricted to only support arguments with
   matching character types. I considered adding a FindASCII method which would
   use narrow string literals for both wide and narrow strings but it would've
   been the same amount of work as changing all of the literals to unicode
   literals.
   This ends up being the bulk of the changes in the patch.
3. All find methods were re-implemented using std::basic_string_view's find
   algorithm or stl algorithms to reduce code complexity, and avoid the need to
   carry around the logic from nsStringObsolete.cpp.
4. The implementations were moved to nsTStringRepr.cpp.
5. An overload of Find was added to try to catch callers which previously
   called `Find(..., false)` or `Find(..., true)` to set case-sensitivity, due
   to booleans normally implicitly coercing to `index_type`. This should
   probably be removed at some point, but may be useful during the transition.

Differential Revision: https://phabricator.services.mozilla.com/D148300
2022-07-30 00:12:48 +00:00
David Parks 666630a9f4 Bug 1755700: Serialize IAudioSessionControl destruction/re-creation r=cmartin
Destroying the IAudioSessionControl has concurrency issues with audio playback that require it to be done on the main thread.  We have been trying to create a new AudioSessionControl on a background thread while this happens but some AudioSessionControl internals/dependencies are not thread safe.  In order to avoid concurrency crashes, we destroy the old IAudioSessionControl on the main thread, then dispatch the restart to a background (MTA) thread asynchronously.

Differential Revision: https://phabricator.services.mozilla.com/D152302
2022-07-29 19:32:15 +00:00
David Parks 75d0f3b74f Bug 1755700: Use AgileReference for cross-apartment AudioSessionControl use r=Jamie
A deadlock issue with our main thread audio playback handling arises when we try to destroy the AudioSessionControl from the MTA, despite it being an MTA object.  We therefore dispatch its destruction to the main thread (STA) so the deadlock is impossible.  In order to use it from the STA, we should wrap it in an AgileReference.

Differential Revision: https://phabricator.services.mozilla.com/D152301
2022-07-29 19:32:14 +00:00
David Parks 38ae048304 Bug 1755700: Simplify ownership of AudioSession r=cmartin
Concurrent operations in the MTA make the required lifetime of the AudioSession complex.  In particular, it cannot be known when/if any methods are currently queued or being executed (in particular, Start).  In order to make this safe, we keep the AudioSession at least as long as XPCOM is running background threads.

This patch also removes a long-defunct state machine and does some basic code cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D152300
2022-07-29 19:32:14 +00:00
David Parks 6e2dd315e2 Bug 1755700: Use StartAudioSession and StopAudioSession symmetrically r=cmartin
Moves StopAudioSession earlier -- to nsAppShell::Run -- where we call StartAudioSession.

Differential Revision: https://phabricator.services.mozilla.com/D152299
2022-07-29 19:32:14 +00:00
Emilio Cobos Álvarez e847b456c5 Bug 1781747 - Don't use shadow class for non-menupopup popup windows. r=Jamie,handyman
These don't get styles early enough to make a shadow decision before Show().
This also matches the previous behavior (nothing would set
nsWidgetInitData::mDropShadow for these windows), so this is the less risky
fix.

It seems somewhat sketchy to use a popup window for these to begin with (Linux
for example maps them to a toplevel Window, at least on Wayland...), but let's
not change too much right now.

The hbrBackground change is a no-op because we can't have a brush before
Create() is called, we update it in SetBackgroundColor().

Differential Revision: https://phabricator.services.mozilla.com/D153095
2022-07-29 12:47:48 +00:00
Florian Queze 5ff0428973 Bug 1782096 - Add profiler markers for window messages sent to WindowProc, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D153101
2022-07-29 10:55:42 +00:00
Nicholas Rishel afcea90d2f Bug 1780666 - Part 2: Condense litany of Windows toast notification error cases with NS_ENSURE_* macros. r=nalexander,mhowell.
Differential Revision: https://phabricator.services.mozilla.com/D151743
2022-07-26 20:29:43 +00:00
Nicholas Rishel e1973ec9bd Bug 1780666 - Part 1: Manage Windows toast notifcation HSTRING handles lifetime with HString and HStringReference wrappers. r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D151742
2022-07-26 20:29:43 +00:00
Nicholas Rishel ce1de4107d Bug 1604883 - Use background thread pool for Windows toast notifications. r=nalexander,KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D142357
2022-07-26 20:29:42 +00:00
James Teh 0333dc5fb2 Bug 1780318: Handle keyboard activation in Windows SystemStatusBar. r=mconley
When the user wishes to open the window with the mouse, the shell sends NIN_SELECT.
We could continue to use WM_LBUTTONUP there, but the semantic notification is probably better.
When the user presses the space/enter key to open the window, the shell sends NIN_KEYSELECT.
When the user activates the context menu either with the mouse or the keyboard (applications/shift+f10 key), the shell sends WM_CONTEXTMENU.

Differential Revision: https://phabricator.services.mozilla.com/D152234
2022-07-25 22:01:35 +00:00
Daniel Q 4b82c0121a Bug 1772087 - Removed obsolete "FILE_BUFFER_SIZE" from nsFilePicker.cpp r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D150922
2022-07-21 17:28:42 +00:00
sotaro 1192eae300 Bug 1780334 - Add EVENT_SYSTEM_CAPTUREEND event watching in WindowOcclusionCalculator r=jrmuizel,gfx-reviewers
From Bug 1774869, current events watching by WindowOcclusionCalculator is not enough. EVENT_SYSTEM_CAPTUREEND event is added like chromium.

Differential Revision: https://phabricator.services.mozilla.com/D152250
2022-07-21 15:09:06 +00:00
Emilio Cobos Álvarez 6716667434 Bug 1776498 - Use popup class with all popups. r=Jamie,handyman
Manage their shadow style per-window instead. It is a bit unfortunate, but
alas, seems to work, and we had existing code for various workarounds, so it's
not too gross.

The menulist special-case isn't needed anymore, menulists always have
eTransparencyTransparent nowadays on Windows.

Differential Revision: https://phabricator.services.mozilla.com/D151994
2022-07-20 09:45:04 +00:00
sotaro 1af3966f37 Bug 1780138 - Let zero copy hardware decoded video to release on all GPUs on Windows r=jrmuizel,gfx-reviewers
A bug is not reported related to "zero copy hardware decoded video" on Windows. Zero video frame copy needs "reuse decoder device ". And it is already enabled on Nightly / Early Beta by Bug 1773714.

RadeonBlockNoVideoCopy is renamed to RadeonBlockZeroVideoCopy

Differential Revision: https://phabricator.services.mozilla.com/D152139
2022-07-20 03:53:30 +00:00
Nick Alexander 81d66e3c24 Bug 1775136 - Part 2: Support `requireInteraction` and `actions` in alert service and native Windows notifications. r=mhowell,smaug
1.  `requireInteraction` already existed, but it doesn't do anything.
    This patch makes it mean `scenario="reminder"` in the Windows
    Toast notification schema: see
    https://docs.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-toast.

2.  `actions` is intended to eventually support the Chrome-only
    extension to the Web Notifications API: see
    https://developer.mozilla.org/en-US/docs/Web/API/Notification/actions.

3.  We run into an `xpconnect` limit on the number of supported
    parameters.  Rather than bump the limit, which has global
    consequence, I added a second `init*` method.  The existing
    abstraction is horrible, but I can't rework it within my
    timelines.  Should we choose to invest, we might migrate to WebIDL
    so that we can sensibly use options objects.

Differential Revision: https://phabricator.services.mozilla.com/D150667
2022-07-12 03:18:42 +00:00
Nick Alexander f8bca9ddeb Bug 1775136 - Part 1: Add `nsIWindowsAlertService` to enable testing. r=mhowell
This also provides an entry point for Windows-specific styling of
alerts, should specific consumers want one: e.g.,
`nsIWindowsAlertsService.showWindowsAlert(...)` allowing to configure
the toast template, for example.

Differential Revision: https://phabricator.services.mozilla.com/D151187
2022-07-12 03:18:41 +00:00
Butkovits Atila bf8e6bd398 Backed out 2 changesets (bug 1775136) for causing failures at test_windows_alert_service.js
Backed out changeset bfa523daaf13 (bug 1775136)
Backed out changeset 5e75e93d9ba3 (bug 1775136)
2022-07-12 04:35:51 +03:00
Kelsey Gilbert 925ea31507 Bug 1778855 - Use e.g. gfxEnv::MOZ_GL_DEBUG() instead of gfxEnv::GlDebug(). r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D151547
2022-07-11 23:59:53 +00:00
Nick Alexander ef2284fee4 Bug 1775136 - Part 2: Support `requireInteraction` and `actions` in alert service and native Windows notifications. r=mhowell,smaug
1.  `requireInteraction` already existed, but it doesn't do anything.
    This patch makes it mean `scenario="reminder"` in the Windows
    Toast notification schema: see
    https://docs.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-toast.

2.  `actions` is intended to eventually support the Chrome-only
    extension to the Web Notifications API: see
    https://developer.mozilla.org/en-US/docs/Web/API/Notification/actions.

3.  We run into an `xpconnect` limit on the number of supported
    parameters.  Rather than bump the limit, which has global
    consequence, I added a second `init*` method.  The existing
    abstraction is horrible, but I can't rework it within my
    timelines.  Should we choose to invest, we might migrate to WebIDL
    so that we can sensibly use options objects.

Differential Revision: https://phabricator.services.mozilla.com/D150667
2022-07-11 23:23:53 +00:00
Nick Alexander 986e5f08fe Bug 1775136 - Part 1: Add `nsIWindowsAlertService` to enable testing. r=mhowell
This also provides an entry point for Windows-specific styling of
alerts, should specific consumers want one: e.g.,
`nsIWindowsAlertsService.showWindowsAlert(...)` allowing to configure
the toast template, for example.

Differential Revision: https://phabricator.services.mozilla.com/D151187
2022-07-11 23:23:53 +00:00
Emilio Cobos Álvarez a4a6aa18d7 Bug 1778444 - Clear UISettings on shutdown. r=kaie
This should be the right fix.

Differential Revision: https://phabricator.services.mozilla.com/D151311
2022-07-07 21:17:36 +00:00
Ben Hearsum e6cd000e4a Bug 1778182: put private browsing taskbar pinning & window separation behind a distinct pref r=nalexander
`browser.privacySegmentation.enabled` is going to be set when users opt into Felt Privacy. When I originally wrote some of this code I naively used it to pref things on, on the assumption that there would never be a situation where it would be `true` before 106 (when we remove the pref-off for this work).

However, we want to run an experiment with pinning private browsing to the taskbar ahead of 106. To avoid any possibility of accidentally opting users into Felt Privacy without their consent, let's use a distinct pref for turning these features off for now. This pref will disappear in the 106 cycle, as none of this code needs to be behind one at that point - so I don't _think_ this needs to go in `firefox.js`.

Differential Revision: https://phabricator.services.mozilla.com/D151065
2022-07-06 13:15:46 +00:00
Kris Maglione 0a4ce6199e Bug 1773770: Part 9 - Migrate widget component content proxies to static registration. r=mccr8
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.

This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.

Differential Revision: https://phabricator.services.mozilla.com/D149436
2022-06-30 09:12:18 +00:00
sotaro b15ea105d5 Bug 1776800 - Let zero copy hardware decoded video to release on intel GPU on Windows r=jrmuizel,gfx-reviewers
Reuse decoder device also to release on intel GPU on Windows, since it is also necessary for zero copy hardware decoded video.
Reuse decoder device handling is also updated as aligned to FEATURE_HW_DECODED_VIDEO_ZERO_COPY.

Differential Revision: https://phabricator.services.mozilla.com/D150448
2022-06-28 21:54:36 +00:00
Emilio Cobos Álvarez 2e0d7c56fd Bug 1776556 - Restore Windows' accent-color / system-color behavior for now. r=mstange
This basically pref-gates some of the accent-color changes that landed before
the soft-freeze to match current release behavior, at least for now.

In the future we might want to reconsider turning these on, but at the very
least we should figure out a good story for the grey-ish accent colors, see the
comments in the pref definitions.

The only tricky bit is the use-theme-accent pref handling. I made it specific
to the non-native-theme again so that AccentColor and NNT kept behaving
consistently, but AccentColor in the browser chrome used the real accent color.

Differential Revision: https://phabricator.services.mozilla.com/D150339
2022-06-28 18:55:27 +00:00
Noemi Erli ff26b8a5d0 Backed out 11 changesets (bug 1773770) because shouldn't have been landed during a soft freeze CLOSED TREE
Backed out changeset ede55d570d1e (bug 1773770)
Backed out changeset d5374ef362c2 (bug 1773770)
Backed out changeset 26e47956508b (bug 1773770)
Backed out changeset c78f0c4c8f3f (bug 1773770)
Backed out changeset 9089a97bcb26 (bug 1773770)
Backed out changeset 17894f5b3b41 (bug 1773770)
Backed out changeset 986a64a9e6b4 (bug 1773770)
Backed out changeset 7a63d8676bf0 (bug 1773770)
Backed out changeset 38e7b99ffbed (bug 1773770)
Backed out changeset e9ad07c96ab2 (bug 1773770)
Backed out changeset 2a8f65417b66 (bug 1773770)
2022-06-24 20:03:43 +03:00
Kris Maglione d1688d3ec7 Bug 1773770: Part 9 - Migrate widget component content proxies to static registration. r=mccr8
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.

This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.

Differential Revision: https://phabricator.services.mozilla.com/D149436
2022-06-24 07:10:18 +00:00
criss 6abc242b8d Backed out 11 changesets (bug 1773770) for causing mochitest failures on test_bug466599.xhtml. CLOSED TREE
Backed out changeset d35762c3242d (bug 1773770)
Backed out changeset 0501c85d3f58 (bug 1773770)
Backed out changeset cdd28e0e3434 (bug 1773770)
Backed out changeset a48829529dd0 (bug 1773770)
Backed out changeset c3fcdd7e88e5 (bug 1773770)
Backed out changeset 8f334c5dc0cd (bug 1773770)
Backed out changeset 337e76b67647 (bug 1773770)
Backed out changeset 71f539b482ba (bug 1773770)
Backed out changeset b996cbbbc2f5 (bug 1773770)
Backed out changeset a6ddc3cdc9ba (bug 1773770)
Backed out changeset c8d7da3cf2ac (bug 1773770)
2022-06-24 08:12:40 +03:00
Kris Maglione b973622a94 Bug 1773770: Part 9 - Migrate widget component content proxies to static registration. r=mccr8
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.

This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.

Differential Revision: https://phabricator.services.mozilla.com/D149436
2022-06-24 00:47:45 +00:00
Marian-Vasile Laza 7dd26a3f65 Backed out 11 changesets (bug 1773770) for causing bc failures on browser_xpcom_graph_wait.js. CLOSED TREE
Backed out changeset 72ace9ee39ae (bug 1773770)
Backed out changeset e8a3a040b4c4 (bug 1773770)
Backed out changeset 4ff5f4f0f5d1 (bug 1773770)
Backed out changeset f96e9664168d (bug 1773770)
Backed out changeset b6a696897ca8 (bug 1773770)
Backed out changeset 1b8ad6be2dce (bug 1773770)
Backed out changeset 7e3a1a32a88d (bug 1773770)
Backed out changeset 6dbe5fa1ad4f (bug 1773770)
Backed out changeset 86e09dcdadde (bug 1773770)
Backed out changeset 1ee8d852d9d5 (bug 1773770)
Backed out changeset c99e93023059 (bug 1773770)
2022-06-24 03:25:34 +03:00
Kris Maglione fe9734c5db Bug 1773770: Part 9 - Migrate widget component content proxies to static registration. r=mccr8
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.

This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.

Differential Revision: https://phabricator.services.mozilla.com/D149436
2022-06-23 23:05:36 +00:00
Marian-Vasile Laza 969bcd8dfe Backed out 11 changesets (bug 1773770) for causing bustages on nsComponentManager.obj.
Backed out changeset 3538e99dd668 (bug 1773770)
Backed out changeset 0862b3275742 (bug 1773770)
Backed out changeset 45dbd95d94bb (bug 1773770)
Backed out changeset 1d079a6ae89c (bug 1773770)
Backed out changeset ac4c4a143ff7 (bug 1773770)
Backed out changeset 0e3233868101 (bug 1773770)
Backed out changeset ac727812fd06 (bug 1773770)
Backed out changeset fe46df06e31a (bug 1773770)
Backed out changeset 51b89b344d7f (bug 1773770)
Backed out changeset 62e49ca3f288 (bug 1773770)
Backed out changeset 6df39588ec9a (bug 1773770)
2022-06-24 01:16:58 +03:00
Kris Maglione 38b1250f24 Bug 1773770: Part 9 - Migrate widget component content proxies to static registration. r=mccr8
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.

This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.

Differential Revision: https://phabricator.services.mozilla.com/D149436
2022-06-23 20:13:10 +00:00
David Parks 96409faec1 Bug 1774694: Function, browser, media and volume keys should not hide cursor on Windows r=cmartin
Also includes the Fn key, which isn't documented to map to a special virtual key code but maps to 0xff, an undefined code, on tested machines.

Differential Revision: https://phabricator.services.mozilla.com/D149928
2022-06-22 22:37:27 +00:00
Emilio Cobos Álvarez fc56cb5d2d Bug 1775320 - WinContentSystemParameters is not needed. r=cmartin
It was needed before we had remote lookandfeel and non-native theme, but now we
no longer call any of the APIs in child processes.

Differential Revision: https://phabricator.services.mozilla.com/D149907
2022-06-22 18:03:01 +00:00
Gabriele Svelto 1cc62be3ff Bug 1775117 - Fix Windows builds when using version 10.0.22621.0 of the Windows SDK r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D149868
2022-06-22 10:07:43 +00:00
Emilio Cobos Álvarez 5f68dd7dd3 Bug 1775310 - Add some accent-color-based dark mode system colors on Windows. r=handyman
This matches UWP apps like Settings on Windows 11, and what we do for other
desktop platforms too.

The system colors match the ones from Win32 otherwise, but using UIUtils we can
access the accent color pallete from UWP apps.

Add a pref just to be safe in any case.

Differential Revision: https://phabricator.services.mozilla.com/D149905
2022-06-22 09:47:27 +00:00
Emilio Cobos Álvarez 4c5f20179e Bug 1775247 - Implement AccentColor/AccentColorText and remove -moz-prefixed version of the color. r=mstange
As per https://github.com/w3c/csswg-drafts/issues/7347.

Mostly renaming, doesn't change behavior other than exposing the new
color keywords (tested in wpt).

Differential Revision: https://phabricator.services.mozilla.com/D149876
2022-06-22 09:45:06 +00:00
Neil Deakin b17459dd7a Bug 1774683, use ValidateFilenameForSaving to validate dropped links on Windows, r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D149746
2022-06-22 08:27:07 +00:00
Emilio Cobos Álvarez 76053503cf Bug 1774821 - Add a missing include in Windows.
MANUAL PUSH: Trivial bustage fix CLOSED TREE
2022-06-17 19:33:39 +02:00
David Parks 9a86df3ec4 Bug 1773513: Ignore Alt-key sequences when hiding the cursor on Windows r=cmartin
On Windows 11, Alt-Space was opening a system context menu while also hiding the mouse cursor.

Differential Revision: https://phabricator.services.mozilla.com/D148841
2022-06-15 21:59:40 +00:00
Sean Burke ad375a2527 Bug 1343826 - Return updated timezone on system timezone change. r=smaug,mstange,stransky,handyman
Differential Revision: https://phabricator.services.mozilla.com/D146725
2022-06-14 19:41:30 +00:00
Emilio Cobos Álvarez ee23efc9b5 Bug 1773813 - Incorporate OS zoom factor in window sizing calculations. r=tnikkel
In bug 1773342 I made OS text scale factor behave like a full zoom
factor which applies to all pages (including the browser chrome). That's
generally straight forward but it makes some callsites that use unzoomed
CSS coordinates misbehave (or behave correctly accidentally actually in
some other cases).

The main fix here is making
nsIBaseWindow::UnscaledDevicePixelsPerCSSPixel() and
nsIScreen::GetDefaultCSSScaleFactor() account for OS zoom as necessary.
However, I also went through the relevant code and cleaned it up to use
typed units and operations when possible.

The setup means:

 * nsIWidget::GetDefaultScale() doesn't account for OS full zoom.
 * nsIBaseWindow and nsIScreen does.

These are the places where this should matter and stuff can get
confused, but this works surprisingly well for all callers (except one
nsDeviceContext one which we use only for PuppetWidget and we can
remove by falling back to 1.0 like all other widgets until the update
comes).

Differential Revision: https://phabricator.services.mozilla.com/D149033
2022-06-14 15:01:52 +00:00
Marian-Vasile Laza 0f414837ae Backed out 2 changesets (bug 642851) for causing wpt failures on modal-dialog-blocks-mouse-events.html. CLOSED TREE
Backed out changeset 9b36e5d3771e (bug 642851)
Backed out changeset 4db736ca2ba8 (bug 642851)
2022-06-14 04:56:20 +03:00
David Parks fbad88b510 Bug 642851: Clear autohidden taskbar region on Windows 10+ if drawing NC region r=cmartin
The unpainted non-client region leaves a white bar at the bottom of the window when maximized on Win11 with auto-hidden taskbar.  This region is where a user can mouse-over to expose the taskbar.  Painting it black eliminates the row of white pixels and fixes problems with exposing the hidden taskbar.  Windows 10 usually (correctly) paints a sliver of the taskbar in this region with or without this patch.  However, it also has similar (but more complex) failing edge cases discussed in the bug.

Additionally, bug 758280 used 1px for the autohidden region size but the real size is 2px so we switch to that here.

Differential Revision: https://phabricator.services.mozilla.com/D148834
2022-06-14 00:49:09 +00:00
David Parks d80cab7260 Bug 642851: Allow identification of correct taskbar window for our screen on Windows r=cmartin
Since Windows 8, ABM_GETAUTOHIDEBAREX has provided a way to identify if/where the system taskbar is hidden, even in multi-monitor setups.  This adds a function to easily fetch that information.

Differential Revision: https://phabricator.services.mozilla.com/D148833
2022-06-14 00:49:09 +00:00
Emilio Cobos Álvarez 9fc2aa47fc Bug 1773558 - Move fixed-point font types to Rust. r=layout-reviewers,jfkthame
Now that cbindgen and rust support const generics, it seems more simple.

This centralizes all the relevant font constants etc in rust and avoids
conversions when going from rust to C++ and vice versa.

Differential Revision: https://phabricator.services.mozilla.com/D148847
2022-06-13 00:59:23 +00:00