Commit Graph
1626 Commits
Author SHA1 Message Date
Masayuki Nakano 6388e58841 Bug 2044523 - Make nsPIDOMWindow.h stop including nsPIDOMWindowInlines.h r=dom-core-reviewers,geckoview-reviewers,media-playback-reviewers,webrtc-reviewers,win-reviewers,layout-reviewers,manuel,aosmond,smaug,bwc,gstoll,dholbert,farre,m_kato
This patch does not make some header files stop including the inline
header because fixing them require more changes.

Note that `#include "nsComponentManagerUtils.h"` is fixing a bustage
caused by "use of undeclared identifier 'do_CreateInstance'" error.

Differential Revision: https://phabricator.services.mozilla.com/D304432
2026-06-09 03:49:55 +00:00
Tom Schuster 3fec848f3e Bug 2039903 - Use nsIWidget::NativeModifiers for SynthesizeNativeMouseScrollEvent. r=masayuki,win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D301261
2026-06-01 14:01:36 +00:00
Tom Schuster 5fb4496e9e Bug 2039903 - Use nsIWidget::NativeModifiers for SynthesizeNativeKeyEvent. r=masayuki,win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D301246
2026-06-01 14:01:33 +00:00
Tom Schuster 86424bc2fa Bug 2039903 - Change from nsIWidget::Modifiers to nsIWidget::NativeModifiers. r=masayuki,geckoview-reviewers,win-reviewers,m_kato,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D300802
2026-06-01 14:01:29 +00:00
rperta 700e284d7c Revert "Bug 2039903 - Use nsIWidget::NativeModifiers for SynthesizeNativeMouseScrollEvent. r=masayuki,win-reviewers,gstoll" for causing build bustages
This reverts commit 312ba34b1e.

Revert "Bug 2039903 - Use nsIWidget::NativeModifiers for SynthesizeNativeKeyEvent. r=masayuki,win-reviewers,gstoll"

This reverts commit cdcd922a07.

Revert "Bug 2039903 - Use proper types for PBrowser::SynthesizeNativeMouseEvent. r=masayuki"

This reverts commit 45369938ed.

Revert "Bug 2039903 - Change from nsIWidget::Modifiers to nsIWidget::NativeModifiers. r=masayuki,geckoview-reviewers,win-reviewers,m_kato,gstoll"

This reverts commit 479f174ddb.
2026-06-01 11:32:48 +00:00
Tom Schuster 312ba34b1e Bug 2039903 - Use nsIWidget::NativeModifiers for SynthesizeNativeMouseScrollEvent. r=masayuki,win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D301261
2026-06-01 10:06:07 +00:00
Tom Schuster cdcd922a07 Bug 2039903 - Use nsIWidget::NativeModifiers for SynthesizeNativeKeyEvent. r=masayuki,win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D301246
2026-06-01 10:06:05 +00:00
Tom Schuster 479f174ddb Bug 2039903 - Change from nsIWidget::Modifiers to nsIWidget::NativeModifiers. r=masayuki,geckoview-reviewers,win-reviewers,m_kato,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D300802
2026-06-01 10:06:01 +00:00
Emilio Cobos Álvarez 4075c1f662 Bug 2040926 - Remove Pip window special-case from ShouldAssociateWithWinAppSDK(). r=bobowen,win-reviewers,gstoll
It seems it's no longer needed, and it might cause issues with
third-party software. Since we're at the beginning of the cycle it
probably makes sense to try this.

Differential Revision: https://phabricator.services.mozilla.com/D301499
2026-05-21 15:26:32 +00:00
Edgar Chen d430b3edb1 Bug 2036904 - [Windows] Support locking pointer with unadjustedMovement; r=win-reviewers,nrishel
Differential Revision: https://phabricator.services.mozilla.com/D298444
2026-05-12 05:15:34 +00:00
Alexandru Marc 76d15ef701 Revert "Bug 2036904 - [Windows] Support locking pointer with unadjustedMovement; r=win-reviewers,nrishel" for causing build bustages @ gtest.h
This reverts commit f5b14f99a4.
2026-05-11 10:01:57 +00:00
Edgar Chen f5b14f99a4 Bug 2036904 - [Windows] Support locking pointer with unadjustedMovement; r=win-reviewers,nrishel
Differential Revision: https://phabricator.services.mozilla.com/D298444
2026-05-11 09:47:57 +00:00
Masayuki Nakano 666cc3c5ea Bug 2034686 - Clean up IMMHandler's ongoing composition before destroying the native window handle r=m_kato,gstoll,win-reviewers
First, while `IMMHandler` handles a composition, it should store the
composing window with a strong pointer because it's required to
clean up the resource before its destroyed.

Then, if the window is destroyed during a composition, `IMMHandler`
should clear the strong pointer with canceling the composition.
This should be done during the emulation of `blur` in
`IMEHandler::OnDestroyWindow()`. However, now, it's called after the
window handle is destroyed [1] and fails to clean up some things, e.g.,
in `IMEHandler::SetInputScopeForIMM32()` [2]. Therefore,
`nsWindow::OnDestroy()` and `nsWindow::Destroy()` call
`IMEHandler::OnDestroyWindow()` before destroying the native window.

Finally, to avoid the race condition of the destruction and the focus
move, `IMEHandler::OnDestroyWindow()` notifies `IMMHandler` of that
for ensuring the clean up.

1. https://searchfox.org/firefox-main/rev/f98aa512e7b7d557ec2d57dbf67b0c4285e9cd3a/widget/windows/nsWindow.cpp#1327,1334
2. https://searchfox.org/firefox-main/rev/f98aa512e7b7d557ec2d57dbf67b0c4285e9cd3a/widget/windows/WinIMEHandler.cpp#542-543,561-562

Differential Revision: https://phabricator.services.mozilla.com/D296902
2026-05-11 05:51:04 +00:00
alastor0325 08398efa3a Bug 1870722 - Part 6: Downgrade TIPMessageHandler hook failure from fatal assert to warning. r=win-reviewers,handyman
SetWindowsHookEx(WH_GETMESSAGE) requires an interactive window station.
CI/automation environments (e.g. Windows service accounts, restricted desktop
sessions) may run Firefox without one, causing SetWindowsHookEx to return NULL.

The MOZ_ASSERT(mHook) was added in 2017 when this code was guarded by
interactive-desktop builds where touch input exists. Bug 1330460 (same year)
removed the _M_IX86 guard and broadened the code to all architectures without
revisiting the assert, leaving a latent crash in any non-interactive build.

This latent crash surfaces in the WMFClearKey mochitests added in Part 7 of
this series: Windows CI machines run the test process without an interactive
window station, which causes SetWindowsHookEx to return NULL and trigger the
assert. When the hook fails to register, the TIPHook callback never fires,
so mA11yBlockCount stays 0 and IsA11yBlocked() always returns false. Touch and
tablet a11y blocking is simply inactive, which is harmless in environments
without touch input. The destructor already null-checks mHook before calling
UnhookWindowsHookEx. Downgrading to NS_WARNING_ASSERTION is the correct fix.

Differential Revision: https://phabricator.services.mozilla.com/D293606
2026-05-04 22:58:47 +00:00
Josh Aas 41a61b7db8 Bug 1701109 - Store SizeConstraints in desktop pixels instead of device pixels. r=spohl,win-reviewers,layout-reviewers,emilio,mac-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D295736
2026-05-03 05:22:35 +00:00
Cristian Tuns 053f4fb7a1 Revert "Bug 1701109 - Store SizeConstraints in desktop pixels instead of device pixels. r=spohl,win-reviewers,layout-reviewers,emilio,mac-reviewers,gstoll" for causing build bustages in nsWindow.cpp
This reverts commit 77b2bbe0d9.
2026-05-02 20:53:48 +00:00
Josh Aas 77b2bbe0d9 Bug 1701109 - Store SizeConstraints in desktop pixels instead of device pixels. r=spohl,win-reviewers,layout-reviewers,emilio,mac-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D295736
2026-05-02 19:56:09 +00:00
Masayuki Nakano 6bf3461edc Bug 2023902 - part 7 - Get rid of unused nsWindow::DispatchStandardEvent() of Windows r=win-reviewers,gstoll,smaug
Differential Revision: https://phabricator.services.mozilla.com/D289038
2026-04-24 14:16:09 +00:00
serge-sans-paille d58c18b09a Bug 2030235 - Decouple ServoStyleConsts from nsGkAtoms.h r=emilio,necko-reviewers,geckoview-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,kershaw,m_kato
And remove unused includes of nsGkAtoms.h in the process. The few
dependencies have been moved to ServoStyleConstsInlines.h

The used command to remove the now unused dependency was:

git grep -l nsGkAtoms.h | while read line; do grep -v nsGkAtoms.h $line | grep -q -E '\<nsGkAtoms\>' || sed -i -e '/nsGkAtoms.h/d' $line  ; done

Differential Revision: https://phabricator.services.mozilla.com/D292697
2026-04-09 10:05:25 +00:00
Silaghi 81930b22ee Revert "Bug 2030235 - Decouple ServoStyleConsts from nsGkAtoms.h r=emilio,necko-reviewers,geckoview-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,kershaw,m_kato" for causing build bustages at style/nsStyleUtil
This reverts commit b97e69b590.
2026-04-09 08:09:15 +00:00
serge-sans-paille b97e69b590 Bug 2030235 - Decouple ServoStyleConsts from nsGkAtoms.h r=emilio,necko-reviewers,geckoview-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,kershaw,m_kato
And remove unused includes of nsGkAtoms.h in the process. The few
dependencies have been moved to ServoStyleConstsInlines.h

The used command to remove the now unused dependency was:

git grep -l nsGkAtoms.h | while read line; do grep -v nsGkAtoms.h $line | grep -q -E '\<nsGkAtoms\>' || sed -i -e '/nsGkAtoms.h/d' $line  ; done

Differential Revision: https://phabricator.services.mozilla.com/D292697
2026-04-09 06:41:33 +00:00
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
Edgar Chen 8bae2316d2 Bug 2013990 - Part 1: Use Maybe<> for WidgetPointerHelper::tiltX/tiltY; r=masayuki,win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D282621
2026-02-12 13:30:29 +00:00
Greg Stoll a8dde6df67 Bug 2010949 - suppress white flash in titlebar on launch when in Windows dark mode r=emilio
Even after this fix you can still see a brief flash of the "regular"
titlebar, but it's waaaay less jarring because the colors match.

Differential Revision: https://phabricator.services.mozilla.com/D280074
2026-01-27 17:51:14 +00:00
denyshon fd2c4c7676 Bug 1768757 - Apply MOZ_FORMAT_PRINTF/MOZ_FORMAT_WPRINTF to WinUtils::Log/LogW r=gstoll,win-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D279565
2026-01-21 03:04:21 +00:00
serge-sans-paille 4549b87bea Bug 2011361 - Remove DeprecatedAbs usage in widget/windows/nsWinGesture.cpp r=win-reviewers,gstoll
Update usage of nsWinGesture::UpdatePanFeedback[XY] to take a boolean for
scrollOverflow, removing the need to take absolute value.

Take advantage of GetSystemMetrics(SM_C[XY]DOUBLECLK) returning an
unsigned value to replace usage of DeprecatedAbs by Abs.

Differential Revision: https://phabricator.services.mozilla.com/D279636
2026-01-20 17:03:40 +00:00
Emilio Cobos Álvarez f465bef00d Bug 2006320 - Clean up WindowMoved / WindowResized to use typed units. r=win-reviewers,gstoll
Make sure that we notify of outer position and inner sizes.

Differential Revision: https://phabricator.services.mozilla.com/D276645
2025-12-16 22:27:48 +00:00
Vincent Hilla 8bf1985cc5 Bug 1858562 - Part 3: Platform specific Document Picture-in-Picture adjustments. r=emilio,dom-core,win-reviewers,gstoll,smaug
Differential Revision: https://phabricator.services.mozilla.com/D265291
2025-12-16 19:10:11 +00:00
Vincent Hilla a3047a1c85 Bug 1858562 - Part 2: Replace mIsPIPWindow with a new nsIWidget::mPiPType. r=smaug,win-reviewers,emilio,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D270472
2025-12-16 19:10:07 +00:00
Emilio Cobos Álvarez cccc001d2d Bug 2004597 - Remove unnecessary check in WM_NCLBUTTONDOWN. r=win-reviewers,gstoll
This caught my eye when debugging recent titlebar issues. I agree with
the todo comment.

Differential Revision: https://phabricator.services.mozilla.com/D275374
2025-12-09 22:20:33 +00:00
Chris Peterson bb2804c0b6 Bug 2002864 - Replace MOZ_CONSTINIT with C++20 constinit in Windows code. r=win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D274514
2025-12-09 07:00:13 +00:00
Emilio Cobos Álvarez 8c456fb797 Bug 1994918 - Bypass windows app sdk handling of WM_NCLBUTTONDBLCLK. r=gstoll,win-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D275358
2025-12-08 15:49:49 +00:00
Emilio Cobos Álvarez 25fe7c4271 Bug 2004018 - Allow the Windows App SDK to handle WM_WINDOWPOSCHANGED. r=gstoll,win-reviewers
Otherwise we might end up with a mispositioned child window that it uses
internally to handle non-client events.

Differential Revision: https://phabricator.services.mozilla.com/D275357
2025-12-08 15:49:24 +00:00
Emilio Cobos Álvarez 81a7119f57 Bug 2002998 - Stop calling into Dwm in order to hit test window buttons. r=win-reviewers,gstoll
We don't rely on DWM buttons + custom non-client area in any
configuration nowadays (this used to be the case with windows 7).

Differential Revision: https://phabricator.services.mozilla.com/D274417
2025-11-28 22:24:19 +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 418e274c76 Bug 1993474 - Remove redundant nsWindow::mPIPWindow. r=win-reviewers,gstoll
nsIWidget already has a member for this.

Differential Revision: https://phabricator.services.mozilla.com/D274282
2025-11-27 15:34:03 +00:00
Emilio Cobos Álvarez 433cc82247 Bug 1993474 - Ensure our WNDPROC has precedence over WinAppSDK's. r=gstoll,win-reviewers
See the comment for reasoning. WM_NCCALCSIZE wasn't getting called, and
we rely on that to get the right client area on things like maximized
windows.

Differential Revision: https://phabricator.services.mozilla.com/D274281
2025-11-27 15:31:05 +00:00
Emilio Cobos Álvarez 79e3fdc22a Bug 2000153 - Clean up widget event dispatch. r=masayuki
Make all nsIWidgetListener::HandleEvent go through a single
nsIWidget::DispatchEvent().

Differential Revision: https://phabricator.services.mozilla.com/D272601
2025-11-17 04:28:20 +00:00
Cristina Horotan 40834c6a92 Revert "Bug 1993474 - remove WS_BORDER to fix border issues with Windows App SDK r=win-reviewers,handyman" for causing bc failures on browser_test_fullscreen_size.js
This reverts commit 569ef28746.
2025-11-15 09:07:09 +00:00
Greg Stoll 569ef28746 Bug 1993474 - remove WS_BORDER to fix border issues with Windows App SDK r=win-reviewers,handyman
When a window with WS_BORDER is maximized on a low-ish DPI monitor, an
"extra" border on top shows up. This breaks the workflow of moving your
mouse to the very top of the screen to hover over or select tabs.

(people have reported this with non-Firefox apps so I'm guessing this is
really an OS problem)

But the WS_BORDER style doesn't actually seem necessary for us when tabs
are being shown in the toolbar - removing it still means we can resize
our window, etc.

We do need to handle the case when tabs are not being shown in the toolbar,
so we have to toggle the WS_BORDER style when that changes. I tested on my
system in a number of different configurations and it seems to work fine.

I believe this will fix bug 1994918 and possibly some others.

Differential Revision: https://phabricator.services.mozilla.com/D272653
2025-11-15 02:53:50 +00:00
Daniel 1ca9f9e85c Bug 1895228 - Removed apz.windows.use_direct_manipulation pref. r=win-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D271305
2025-11-15 02:20:30 +00:00
serge-sans-paille b167b659f1 Bug 1999704 - Remove unused STL header inclusions in widget/** r=win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D272277
2025-11-13 10:27:21 +00:00
Emilio Cobos Álvarez 1734b54c10 Bug 1999620 - Remove some dead view-related code now that popups don't use views. r=tnikkel,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D272205
2025-11-12 11:49:55 +00:00
serge-sans-paille 64db550746 Bug 1998397 - Make nsWindow::sCurrentCursor MOZ_CONSTINIT instead of MOZ_RUNINIT r=emilio,win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D271388
2025-11-07 10:17:58 +00:00
Atila Butkovits 444f01bb4c Revert "Bug 1998397 - Make nsWindow::sCurrentCursor MOZ_CONSTINIT instead of MOZ_RUNINIT r=emilio,win-reviewers,gstoll" for causing bustages at nsWindow.cpp.
This reverts commit 8ac9b65425.
2025-11-06 07:42:16 +00:00
serge-sans-paille 8ac9b65425 Bug 1998397 - Make nsWindow::sCurrentCursor MOZ_CONSTINIT instead of MOZ_RUNINIT r=emilio,win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D271388
2025-11-06 07:20:35 +00:00
Masayuki Nakano 2879584787 Bug 1997656 - Fix the typo in the pref name r=edgar,win-reviewers,gstoll
`widnows` -> `windows`

Differential Revision: https://phabricator.services.mozilla.com/D271179
2025-11-04 23:37:48 +00:00
Emilio Cobos Álvarez 256e9aa1ec Bug 1998225 - Remove some unused nsView includes. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D271260
2025-11-04 19:06:23 +00:00
Greg Stoll 0df0bf1333 Bug 1995838 - don't use Windows App SDK on PiP windows r=win-reviewers,handyman
This was making the fullscreened picture-in-picture windows go under the
Windows taskbar.

Differential Revision: https://phabricator.services.mozilla.com/D269673
2025-10-22 21:48:11 +00:00
Emilio Cobos Álvarez 71f243cfd9 Bug 1995498 - Assume per-monitor DPI awareness. r=win-reviewers,gstoll
This should be fine on Win10+ which is all we support.

Differential Revision: https://phabricator.services.mozilla.com/D269342
2025-10-22 11:03:21 +00:00