This prevents dialog windows created with no borders etc from ending up
with a border anyways, for example, which is relevant for things like
the non-native notifications.
Before this patch, for the non-native notifications case, this was
papered due to the fact window transparency implied HideWindowChrome(),
which unset these bits anyways. But that was pretty
action-at-a-distance...
Differential Revision: https://phabricator.services.mozilla.com/D209502
This is completely obsolete according to MSDN, and it's better
not having to think about it. Doesn't seem needed for regular
dialogs.
Differential Revision: https://phabricator.services.mozilla.com/D209501
Otherwise we start painting the window too early, which after
bug 1891063 causes the non-client area to be filled, but we don't paint
anything on top.
Differential Revision: https://phabricator.services.mozilla.com/D208898
This makes sure that the transparent area is cleared properly.
We move the clear to a point where Gecko has already informed us of
the opaque region for simplicity.
Differential Revision: https://phabricator.services.mozilla.com/D207302
Again, dead code for now because the windows are always opaque,
but will be useful later on since this allows restricting the
region that needs to have transparency.
Differential Revision: https://phabricator.services.mozilla.com/D207301
All the comments on this function are for platforms we don't support.
Right now we don't have any of these top-level transparent windows, but
we want to use DWM and Webrender for these just like for regular windows.
Differential Revision: https://phabricator.services.mozilla.com/D207299
This was needed to get the right border status to paint (bug 586228).
That was a long time ago and nowadays all our windows don't have the
thick themed borders that we used to have.
There are two exceptions here where we draw OS-provided borders on Win
10+:
* High Contrast Mode.
* Accent color settings on windows to show the accent color on window
borders and titlebar.
Both of them look good from here (though I only tested win 11).
Differential Revision: https://phabricator.services.mozilla.com/D207327
All the comments on this function are for platforms we don't support.
Right now we don't have any of these top-level transparent windows, but
we want to use DWM and Webrender for these just like for regular windows.
Depends on D207298
Differential Revision: https://phabricator.services.mozilla.com/D207299
Right now, we don't use top level transparent windows (they're
completely unused).
This removes some code that causes trouble when reintroducing them.
Depends on D207297
Differential Revision: https://phabricator.services.mozilla.com/D207298
No behavior change intended. I plan to use this to hide the titlebar
buttons when drawing to the titlebar (we currently draw on top of them).
But seems worth factoring out regardless.
Differential Revision: https://phabricator.services.mozilla.com/D207297
When stripping and restoring window chrome, don't modify or retain any
style-flags other than window-chrome flags.
This also lets us remove, without further consideration, a tiny bit of
thirteen-year-old special-case logic (dating back to bug 629860) which
tried to fix up the then-improperly-cached `WS_VISIBLE` flag.
Differential Revision: https://phabricator.services.mozilla.com/D206081
I did consider the pref in my patches in bug 1886371.
nsWindow does a QI to IRawElementProviderSimple, which will deliberately fail if the UIA pref is disabled.
Unfortunately, i neglected to realise that it's already too late by that stage because we've already called nsWindow::GetAccessible, which instantiates the a11y engine.
Now, we check the UIA pref before we call GetAccessible.
Differential Revision: https://phabricator.services.mozilla.com/D205559
1. Respond to WM_GETOBJECT with our IRawElementProviderSimple implementation for the root Accessible of the HWND.
2. Don't allow QueryInterface to UIA interfaces if the UIA pref is disabled. This stops WM_GETOBJECT from returning our UIA implementation in this case.
3. Specify the appropriate provider options.
Differential Revision: https://phabricator.services.mozilla.com/D205179
I think we should start off with this. Other platforms can implement
this too, but exposing this to content seems like quite the rabbit hole.
Differential Revision: https://phabricator.services.mozilla.com/D203405
I think we should start off with this. Other platforms can implement
this too, but exposing this to content seems like quite the rabbit hole.
Differential Revision: https://phabricator.services.mozilla.com/D203405
Firefox never uses this. TB could use the same approach Firefox uses,
but for now on macOS the sheets become regular modal dialogs, which is
the same as on Windows and Linux.
See bug 1755330 and bug 1737489 for more context.
Differential Revision: https://phabricator.services.mozilla.com/D204209
We disable the root window when a picker opens.
When the picker closes, our window will get focus, but it will still be disabled.
This confuses the focus system.
Therefore, we ignore this focus and explicitly notify the focus system once we re-enable the window.
Since Windows picker dialogs have regressed accessibility several times now, I also added a Windows accessibility test.
Differential Revision: https://phabricator.services.mozilla.com/D203717
These two features are totally unused and poorly supported.
Both were added in bug 552982, and Wayland doesn't support (nor have a
way of supporting) any of them.
Differential Revision: https://phabricator.services.mozilla.com/D204222
This might be useful for apps to find out the maximize button position
without having to enable UIAutomation. Though it seems Windows doesn't
use this, at least.
Co-authored-by: James Teh <[email protected]>
Differential Revision: https://phabricator.services.mozilla.com/D203422
This is not ideal, because they fall back to position the popup under
the cursor, but it's probably better.
The right thing to do would be for Windows to use the TITLEBARINFOEX
message. We should probably still land that code just so they can
eventually use it, seems worth doing anyways.
Differential Revision: https://phabricator.services.mozilla.com/D203423
Eliminate a possible race-condition wherein multiple file-dialogs fight
over disabling the root window, possibly reenabling it early.
Differential Revision: https://phabricator.services.mozilla.com/D201775
This is to be landed after the merge. I think this is better / more
consistent, and avoids relying on mis-documented window style flags in
MSDN.
Differential Revision: https://phabricator.services.mozilla.com/D201894
We no longer have non-transparent popups nor set the window region to
get clipping, instead rendering our own shadows and decorations, so this
code is just not needed anymore.
Depends on D200508
Differential Revision: https://phabricator.services.mozilla.com/D200612
Bug 1870512 removed top level windows with WindowType::Popup, instead
replacing it with an "alert" feature for the only use of them that we
had.
Turns out that on Windows they need a bit more special handling than I
thought, so this patch uses the alert boolean to fix two regressions
(that alerts now create taskbar icons, and that they steal focus).
Remove mIsForMenuPopupFrame since that is now a synonym with
WindowType::Popup.
Remove also the dialog vs. toplevel difference of using
WS_EX_DLGMODALFRAME, since that doesn't seem to have an effect at all on
windows 10+.
Differential Revision: https://phabricator.services.mozilla.com/D200508
Eliminate `WindowEnabler` by folding it into `nsWindow::PickerOpen()`
and `nsWindow::PickerClosed()`. This avoids the implicit assumption that
multiple instances are created and destroyed in LIFO order.
Differential Revision: https://phabricator.services.mozilla.com/D200742
Remove an unnecessary member function from AutoWidgetPickerState.
Additionally, use a safer method of getting the underlying nsWindow than
`static_cast`, and add some thread-safety assertions in
nsWindow::Picker{Open,Closed}().
No functional changes on the happy path.
Differential Revision: https://phabricator.services.mozilla.com/D200741
As far as I've tested on Win 11, we can put it off to load it when first needed
of the keyboard layout data. `ToUnicodeEx` API changes the dead key state and
it's called a lot in `KeyboardLayout::LoadLayout`, however, this patch does
not newly call `LoadLayout` after `TranslateMessage` API at least while handling
a key message. Therefore, this should be safe but regressions of this change
could be serious, so this makes it enabled only in early beta and earlier for
now.
Differential Revision: https://phabricator.services.mozilla.com/D200600
As far as I've tested on Win 11, we can put it off to load it when first needed
of the keyboard layout data. `ToUnicodeEx` API changes the dead key state and
it's called a lot in `KeyboardLayout::LoadLayout`, however, this patch does
not newly call `LoadLayout` after `TranslateMessage` API at least while handling
a key message. Therefore, this should be safe but regressions of this change
could be serious, so this makes it enabled only in early beta and earlier for
now.
Differential Revision: https://phabricator.services.mozilla.com/D200600