Commit Graph
94 Commits
Author SHA1 Message Date
Sylvestre Ledru 4f6b8b516d Bug 2023419 - Remove Emacs/Vim modelines from widget/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287877
2026-03-16 17:22:02 +00:00
unknown 3cc64b1948 Bug 1354668: Check for valid native HWND before checking for Windows tablet mode change r=win-reviewers,gstoll
This is not confirmed to be the start of the crash but the crashes are at
startup and this could happen if the check came before a window was
registered.

Differential Revision: https://phabricator.services.mozilla.com/D284338
2026-02-24 19:56:21 +00:00
Emilio Cobos Álvarez 741ef7eefc Bug 2002754 - Remove some cruft from WindowsUIUtils.cpp. r=win-reviewers,gstoll
The SDK we build with has long supported everything needed here.

Differential Revision: https://phabricator.services.mozilla.com/D274271
2025-12-01 15:13:15 +00:00
Emilio Cobos Álvarez bb40796bb2 Bug 2002990 - Save some work on startup to associate a native window with the app sdk. r=gstoll,win-reviewers
We only need to grab its AppWindow for that to happen. Save some useless
QI while at it.

I'm pretty sure bug 2002986 would also help here but this seems worth
doing regardless.

Differential Revision: https://phabricator.services.mozilla.com/D274419
2025-11-28 15:30:11 +00:00
Emilio Cobos Álvarez dd44607279 Bug 2002986 - Use IAppWindowTitlebar::ResetToDefault() for non-collapsed titlebar. r=win-reviewers,gstoll
This seems to actually go to the default DWM stuff and is the documented
way of doing so:

https://learn.microsoft.com/en-us/windows/apps/develop/title-bar#reset-the-title-bar

Differential Revision: https://phabricator.services.mozilla.com/D274413
2025-11-28 15:08:53 +00:00
serge-sans-paille 72609da313 Bug 1996641 - Remove unused mfbt inclusion in widget/** r=emilio,necko-reviewers,geckoview-reviewers,win-reviewers,gstoll,ohall,sunil
Differential Revision: https://phabricator.services.mozilla.com/D270216
2025-10-29 13:06:08 +00:00
Sandor Molnar 50c434493d Revert "Bug 1996641 - Remove unused mfbt inclusion in widget/** r=emilio,necko-reviewers,geckoview-reviewers,win-reviewers,gstoll,ohall,sunil" for causing build bustages @ nsHttpChannel.cpp
This reverts commit 66b97f2926.
2025-10-29 11:31:08 +00:00
serge-sans-paille 66b97f2926 Bug 1996641 - Remove unused mfbt inclusion in widget/** r=emilio,necko-reviewers,geckoview-reviewers,win-reviewers,gstoll,ohall,sunil
Differential Revision: https://phabricator.services.mozilla.com/D270216
2025-10-29 11:00:27 +00:00
Greg Stoll e1d080bed3 Bug 1992783 - fix mingw builds by adding Windows App SDK toolchain dependency r=taskgraph-reviewers,win-reviewers,handyman,jmaher
Also turned off using the Windows App SDK in mingw since that seems to
be the pattern we follow for other advanced Windows features.

Also fixex win64-st-autotest build, and fixes another mingw bustage
in TestFile.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D267643
2025-10-06 21:29:13 +00:00
Greg Stoll 2374da507a Bug 1947324 part 6 - avoid using Windows App SDK on opt-talos-xperf runs r=bobowen,perftest-reviewers,kshampur
On opt-talos-xperf, the Windows App SDK fails
calling DCompositionCreateDevice3() with ERROR_ACCESS_DENIED,
and the code assumes it is going to succeed so it proceeds to crash
deferencing null.

We haven't seen this crash anywhere else, and so I suspect this has
something to do with the way Firefox is being run there. So add a pref
to turn off using the Windows App SDK for just this test.

If this turns out to cause crashes in other situations, we should figure
out what the situation is and try to fix it.

Differential Revision: https://phabricator.services.mozilla.com/D267040
2025-10-06 11:21:09 +00:00
Greg Stoll 2fe4ae0730 Bug 1947324 part 3 - use WinRT/Windows App SDK instead of WS_SYSMENU to collapse titlebar r=emilio
This essentially reverts bug 1934040, as that attempted to deal with
the problem of the wrong titlebar height with Mica on by not setting the
WS_SYSMENU style. However, this caused problems like this bug, where
taskbar windows couldn't be right-clicked on.

Now we accomplish the same thing by calling into the Windows App SDK to
set ExtendsContentIntoTitleBar and PreferredHeightOption appropriately.
This is done in WindowsUIUtils::SetIsTitlebarCollapsed(); the rest of this
change is almost entirely the revert of bug 1934040.

Differential Revision: https://phabricator.services.mozilla.com/D263604
2025-10-06 11:20:58 +00:00
iulian moraru 4a2a504787 Revert "Bug 1947324 part 3 - use WinRT/Windows App SDK instead of WS_SYSMENU to collapse titlebar r=emilio" for causing multiple failures.
This reverts commit 032488ff11.

Revert "Bug 1947324 part 2 - make Windows Firefox builds depend on the Windows App SDK r=glandium"

This reverts commit 1ebdc110f2.

Revert "Bug 1947324 part 1 - "build" Windows App SDK on toolchain tasks r=glandium"

This reverts commit 37b6a1f956.
2025-09-19 15:37:04 +00:00
Greg Stoll 032488ff11 Bug 1947324 part 3 - use WinRT/Windows App SDK instead of WS_SYSMENU to collapse titlebar r=emilio
This essentially reverts bug 1934040, as that attempted to deal with
the problem of the wrong titlebar height with Mica on by not setting the
WS_SYSMENU style. However, this caused problems like this bug, where
taskbar windows couldn't be right-clicked on.

Now we accomplish the same thing by calling into the Windows App SDK to
set ExtendsContentIntoTitleBar and PreferredHeightOption appropriately.
This is done in WindowsUIUtils::SetIsTitlebarCollapsed(); the rest of this
change is almost entirely the revert of bug 1934040.

Differential Revision: https://phabricator.services.mozilla.com/D263604
2025-09-19 12:11:49 +00:00
David P 4ec8c8269f Bug 1954281: Check that widget still exists when setting icons r=win-reviewers,gstoll
GetMainWidget can return null.  We don't return an error in that event, since
callers are not expecting this to throw a JS exception and clients wouldn't do
anything in that case anyway.

Differential Revision: https://phabricator.services.mozilla.com/D249002
2025-05-13 04:05:33 +00:00
David P 5871b7c11d Bug 1833131: Move lambda in WindowsUIUtils::Share r=win-reviewers,nrishel
Variable capture means this has to be moved.

Differential Revision: https://phabricator.services.mozilla.com/D246279
2025-04-22 20:37:45 +00:00
Ray Kraesig 484384df12 Bug 1932775 - [1/1] Remove unreliable registry-key check r=win-reviewers,handyman
The registry key in question is known to be unhelpfully present on some
non-tablet-capable devices. Given this, it's never helpful except when
the `SM_CONVERTIBLESLATEMODE` test would already have told us whether
the device is tablet-capable.

Remove the check entirely, except when logging.

Differential Revision: https://phabricator.services.mozilla.com/D229955
2024-11-22 21:12:43 +00:00
Ray Kraesig 60ee4131e1 Bug 1819421 - [2/2] consider Win11 tablet mode for UI density r=win-reviewers,handyman,Gijs
Check for Windows 11 tablet mode when setting the UI density. (In
particular, have the UI-density object listen for the signal change,
rather than filtering it through `TabletModeUpdater`.)

This includes a change to the semantics of "tablet-mode-change": it now
signals Win11 tablet mode as distinct from Win10 tablet mode.

Differential Revision: https://phabricator.services.mozilla.com/D224245
2024-11-04 13:56:20 +00:00
Ray Kraesig 28f8d3d9cf Bug 1819421 - [1/2] create parallel check for Win11 tablet mode r=win-reviewers,Gijs,gsvelto,gstoll
Win11's tablet mode is different from Win10's tablet mode in ways both
subtle and gross. Avoid unifying them implicitly, and make it clear that
they should not be unified _explicitly_ without testing.

Unfortunately, Windows 11's API for checking whether the device is in
tablet mode is broken -- it requires one to know whether the device is a
tablet to interpret the return value, but there is no documented API
providing that information. We use a heuristic partly borrowed from
Chromium and partly based on independent investigation.

As all of the code using WindowsUIUtils effectively only checked for
Win10's tablet mode, this commit technically has no functional
changes.

Differential Revision: https://phabricator.services.mozilla.com/D224244
2024-11-04 13:56:20 +00:00
Butkovits Atila 24b71f7279 Backed out 2 changesets (bug 1819421) for causing linting failures at browser.js. CLOSED TREE
Backed out changeset b4f770bfe94c (bug 1819421)
Backed out changeset b11774655311 (bug 1819421)
2024-11-01 19:43:00 +02:00
Ray Kraesig 048455f466 Bug 1819421 - [2/2] consider Win11 tablet mode for UI density r=win-reviewers,handyman,Gijs
Check for Windows 11 tablet mode when setting the UI density. (In
particular, have the UI-density object listen for the signal change,
rather than filtering it through `TabletModeUpdater`.)

This includes a change to the semantics of "tablet-mode-change": it now
signals Win11 tablet mode as distinct from Win10 tablet mode.

Differential Revision: https://phabricator.services.mozilla.com/D224245
2024-11-01 16:32:09 +00:00
Ray Kraesig 16f10abebe Bug 1819421 - [1/2] create parallel check for Win11 tablet mode r=win-reviewers,Gijs,gsvelto,gstoll
Win11's tablet mode is different from Win10's tablet mode in ways both
subtle and gross. Avoid unifying them implicitly, and make it clear that
they should not be unified _explicitly_ without testing.

Unfortunately, Windows 11's API for checking whether the device is in
tablet mode is broken -- it requires one to know whether the device is a
tablet to interpret the return value, but there is no documented API
providing that information. We use a heuristic partly borrowed from
Chromium and partly based on independent investigation.

As all of the code using WindowsUIUtils effectively only checked for
Win10's tablet mode, this commit technically has no functional
changes.

Differential Revision: https://phabricator.services.mozilla.com/D224244
2024-11-01 16:32:08 +00:00
Dave Townsend 7380f3655a Bug 1920674: Support SVG images in nsWindowGfx::CreateIcon. r=win-reviewers,rkraesig
Also allows passing in CSS context properties.

Differential Revision: https://phabricator.services.mozilla.com/D223579
2024-10-23 08:10:12 +00:00
Sandor Molnar 3f510f53a8 Backed out 4 changesets (bug 1920674, bug 1920468) for causing win crashes. CLOSED TREE
Backed out changeset 67d69fa2dff5 (bug 1920468)
Backed out changeset 5b0f9712258c (bug 1920674)
Backed out changeset 956210b138aa (bug 1920468)
Backed out changeset ad952b2e4b9c (bug 1920674)
2024-10-19 09:29:05 +03:00
Dave Townsend 68783cbcbc Bug 1920674: Support SVG images in nsWindowGfx::CreateIcon. r=win-reviewers,rkraesig
Also allows passing in CSS context properties.

Differential Revision: https://phabricator.services.mozilla.com/D223579
2024-10-18 12:51:58 +00:00
Tamas Szentpeteri 559fcfd527 Backed out 4 changesets (bug 1920674, bug 1920468) for causing bp-nu bustages on TestWindowGfx.cpp. CLOSED TREE
Backed out changeset c1ce04a0b952 (bug 1920468)
Backed out changeset a309456ce958 (bug 1920674)
Backed out changeset 1ba966b0976d (bug 1920468)
Backed out changeset 624f0ded73c2 (bug 1920674)
2024-10-18 13:24:29 +03:00
Dave Townsend 71a29d9a79 Bug 1920674: Support SVG images in nsWindowGfx::CreateIcon. r=win-reviewers,rkraesig
Also allows passing in CSS context properties.

Differential Revision: https://phabricator.services.mozilla.com/D223579
2024-10-18 09:17:46 +00:00
Butkovits Atila 8263786cd1 Backed out 4 changesets (bug 1920468, bug 1920674) for causing gtest failures in TestWindowGfx.CreateIcon_SVG_Context. CLOSED TREE
Backed out changeset 51a61309e309 (bug 1920468)
Backed out changeset bd830a73c821 (bug 1920674)
Backed out changeset 03f5f21e011f (bug 1920468)
Backed out changeset a1dac924abab (bug 1920674)
2024-10-17 12:08:51 +03:00
Dave Townsend 51208244db Bug 1920674: Support SVG images in nsWindowGfx::CreateIcon. r=win-reviewers,rkraesig
Also allows passing in CSS context properties.

Differential Revision: https://phabricator.services.mozilla.com/D223579
2024-10-17 07:48:49 +00:00
Gregory Pappas 0e57f440a0 Bug 1914559 - Remove fallback to hidden window in WindowsUIUtils::UpdateInTabletMode r=win-reviewers,rkraesig
If there aren't any browser windows, we're either very early in startup
or shutting down. In these cases, it's probably fine to not know if
tablet mode is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D219945
2024-08-28 19:30:43 +00:00
Magnus Melin bbd67965e9 Bug 1898709 - Use GetMostRecentBrowserWindow() instead of GetMostRecentWindow(u"navigator:browser") to cater for Thunderbird's main window. r=nalexander
Based on https://github.com/Betterbird/thunderbird-patches/blob/main/115/bugs/1863798-toast-notification-foreground-mail-client-m-c.patch

Fixed cases where general code assume main window is Firefox.
GetMostRecentBrowserWindow is getting "navigator:browser" for Firefox, so there is no change in behavior,
but it means more things will work for Thunderbird.

Differential Revision: https://phabricator.services.mozilla.com/D211520
2024-05-24 17:43:52 +00:00
Masatoshi Kimura 1ffc0764f4 Bug 1852806 - Remove macros for older Windows SDK from widget/windows/. r=handyman
Depends on D188031

Differential Revision: https://phabricator.services.mozilla.com/D188032
2023-09-15 03:19:28 +00:00
Cosmin Sabou eab17df623 Backed out 15 changesets (bug 1852806) for causing mda failures on test_video_low_power_telemetry.html. CLOSED TREE
Backed out changeset faea1f4cb9a9 (bug 1852806)
Backed out changeset 4db93c374f9b (bug 1852806)
Backed out changeset 7e40e0e04921 (bug 1852806)
Backed out changeset b0a66c4269ce (bug 1852806)
Backed out changeset 4ff3545936f9 (bug 1852806)
Backed out changeset 02c0a8eb3fd6 (bug 1852806)
Backed out changeset ae2c7b33acfb (bug 1852806)
Backed out changeset 2b89ba254a1a (bug 1852806)
Backed out changeset dfa4f73fc548 (bug 1852806)
Backed out changeset daffcc4c1877 (bug 1852806)
Backed out changeset 33855bcdf15e (bug 1852806)
Backed out changeset 694f29707f3e (bug 1852806)
Backed out changeset 1891eda22a59 (bug 1852806)
Backed out changeset 1b854941389c (bug 1852806)
Backed out changeset 2f7cfe04be59 (bug 1852806)
2023-09-15 09:48:27 +03:00
Masatoshi Kimura 22c1cfabaa Bug 1852806 - Remove macros for older Windows SDK from widget/windows/. r=handyman
Depends on D188031

Differential Revision: https://phabricator.services.mozilla.com/D188032
2023-09-15 03:19:28 +00:00
Peter Van der Beken 5dc8782829 Bug 1846277 - Untangle nsGlobalWindow*.h includes. r=dom-core,media-playback-reviewers,sessionstore-reviewers,padenot,farre
Differential Revision: https://phabricator.services.mozilla.com/D184978
2023-08-02 20:41:49 +00:00
Masatoshi Kimura a3e419385e Bug 1844908 - Remove pre-Win10-specific codepath from widget/. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D184307
2023-07-26 08:52:54 +00:00
Natalia Csoregi 42e803a2dd Backed out 19 changesets (bug 1844908) for causing win bustage on AvailableMemoryTracker.cpp. CLOSED TREE
Backed out changeset 44c66f2233cf (bug 1844908)
Backed out changeset a8010ff534bf (bug 1844908)
Backed out changeset 225dc3aeb220 (bug 1844908)
Backed out changeset a1414db64e33 (bug 1844908)
Backed out changeset 7f1e0a527839 (bug 1844908)
Backed out changeset 6dc7646d1ffa (bug 1844908)
Backed out changeset 8d715131510f (bug 1844908)
Backed out changeset 4b6fe8a4e7db (bug 1844908)
Backed out changeset 2b419fabf1e8 (bug 1844908)
Backed out changeset af84e701d616 (bug 1844908)
Backed out changeset 2fa203969ec5 (bug 1844908)
Backed out changeset 2b3d2df94db3 (bug 1844908)
Backed out changeset 7eca452f5fd7 (bug 1844908)
Backed out changeset 3d961cf25afe (bug 1844908)
Backed out changeset 3c59143f8dd7 (bug 1844908)
Backed out changeset ab50c6c5425a (bug 1844908)
Backed out changeset b2c5636df673 (bug 1844908)
Backed out changeset e9a0f1c6760c (bug 1844908)
Backed out changeset 945ccbedde0b (bug 1844908)
2023-07-25 19:55:35 +03:00
Masatoshi Kimura 4182954d50 Bug 1844908 - Remove pre-Win10-specific codepath from widget/. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D184307
2023-07-25 14:41:05 +00:00
CanadaHonk 78363430df 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
Emilio Cobos Álvarez 2ecea6f071 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
Emilio Cobos Álvarez e75f1ad698 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
Emilio Cobos Álvarez 7f9951da6c 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 950b711edf Bug 1773342 - Expose Windows' text scale factor to LookAndFeel. r=handyman
Much like we expose overlay scrollbars.

Differential Revision: https://phabricator.services.mozilla.com/D148675
2022-06-09 22:44:28 +00:00
Mike Hommey 67709fcc39 Bug 1766359 - Fix unreachable-code-return warnings in Windows builds. r=emilio,mhowell,nika,rkraesig
dom/system/PathUtils.cpp(77,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
  return false;
         ^~~~~
ipc/chromium/src/chrome/common/ipc_channel_win.cc(479,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
  return true;
         ^~~~
mozglue/misc/PreXULSkeletonUI.cpp(1263,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
  return 0;
         ^
mozglue/tests/TestPEExportSection.cpp(348,12): error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
    return 0;
           ^
security/manager/ssl/OSReauthenticator.cpp(428,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
  return NS_OK;
         ^~~~~
toolkit/components/maintenanceservice/maintenanceservice.cpp(214,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
  return 0;
         ^
widget/windows/WindowsUIUtils.cpp(383,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
  return false;
         ^~~~~

Differential Revision: https://phabricator.services.mozilla.com/D144661
2022-04-26 21:44:54 +00:00
Emilio Cobos Álvarez 0505b039de Bug 1757647 - Implement Windows 11 overlay scrollbars. r=cmartin
Put it behind a pref for nightly and early beta for now.

Differential Revision: https://phabricator.services.mozilla.com/D139987
2022-03-02 12:02:00 +00:00
Emilio Cobos Álvarez 9b50d5f02b Bug 1757647 - Simplify WindowsUIUtils tablet mode stuff. r=saschanaz
No need for it to use so much XPCOM.

Differential Revision: https://phabricator.services.mozilla.com/D139986
2022-03-02 12:02:00 +00:00
Ben Hearsum a43d6f6bf9 Bug 1751010: Use a unique icon for the Private Browsing taskbar pin r=mhowell
This is subject to the same issue as an earlier patch in this series -- the icon will be wrong briefly at first launch, before the code in `BrowserContentHandler.jsm` replaces the default icon with the correct one.

Differential Revision: https://phabricator.services.mozilla.com/D138601
2022-03-01 14:16:48 +00:00
Butkovits Atila 441a1d2141 Backed out 5 changesets (bug 1751010) for causing failures at browser_startup_mainthreadio.js. CLOSED TREE
Backed out changeset af347bb985d4 (bug 1751010)
Backed out changeset 9944e42017ff (bug 1751010)
Backed out changeset 282a5cd52cd0 (bug 1751010)
Backed out changeset 2f54afb16002 (bug 1751010)
Backed out changeset 6ad85a8edf15 (bug 1751010)
2022-02-27 03:40:08 +02:00
Ben Hearsum 6a6d5f22b9 Bug 1751010: Use a unique icon for the Private Browsing taskbar pin r=mhowell
This is subject to the same issue as an earlier patch in this series -- the icon will be wrong briefly at first launch, before the code in `BrowserContentHandler.jsm` replaces the default icon with the correct one.

Differential Revision: https://phabricator.services.mozilla.com/D138601
2022-02-25 18:33:46 +00:00
Marian-Vasile Laza 7824ab98b3 Backed out 4 changesets (bug 1751010) for causing xpcshell failures on test_taskbar_jumplistitems.js. CLOSED TREE
Backed out changeset 1ff3b5528d53 (bug 1751010)
Backed out changeset a21f1d8b6d8b (bug 1751010)
Backed out changeset 11df8f060a35 (bug 1751010)
Backed out changeset b94765877d57 (bug 1751010)
2022-02-23 14:56:22 -08:00
Ben Hearsum 8e1d3e8289 Bug 1751010: Use a unique icon for the Private Browsing taskbar pin r=mhowell
This is subject to the same issue as an earlier patch in this series -- the icon will be wrong briefly at first launch, before the code in `BrowserContentHandler.jsm` replaces the default icon with the correct one.

Differential Revision: https://phabricator.services.mozilla.com/D138601
2022-02-23 13:58:18 +00:00