Commit Graph
204 Commits
Author SHA1 Message Date
Brian Tsoi bc7adc0b9f Bug 1787382 - Remove resolutionchange events firing r=win-reviewers,cmartin
Differential Revision: https://phabricator.services.mozilla.com/D209883
2024-05-09 14:37:04 +00:00
Edgar Chen 2ef1094419 Bug 1828259 - Close XUL popup when entering/exiting fullscreen; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D209355
2024-05-06 20:47:28 +00:00
Emilio Cobos Álvarez b3d019571d Bug 1893918 - A not-yet-loaded browser window shouldn't stop being an early blank window. r=win-reviewers,rkraesig
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
2024-04-30 08:39:59 +00:00
Emilio Cobos Álvarez 1baa5a1afc Bug 1883287 - Don't wait for the hidden window to be created on Linux to load the native menus. r=smaug
The hidden window is created lazily on Linux, and it's not needed like
on macOS:

  https://searchfox.org/mozilla-central/rev/6b1e306175c2284958fb185bab388021e2890ed0/toolkit/xre/nsAppRunner.cpp#5537-5556

Differential Revision: https://phabricator.services.mozilla.com/D203904
2024-03-07 14:26:32 +00:00
Björn Bidar b61d3af073 Bug 1883184 - Initial pass at unity menubar support r=emilio
This implements the basic infrastructure to use use libdbusmenu to
export the Linux menubar.

For now, this is not integrated with the front-end, and there are some
remaining bugs, so it lands disabled by default behind the
widget.gtk.global-menu.enabled pref.

Differential Revision: https://phabricator.services.mozilla.com/D200259
2024-03-02 11:38:02 +00:00
Greg Tatum 290e0906df Bug 1873772 - Only report XULStore load errors in the parent process; r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D198086
2024-01-17 17:18:47 +00:00
Stephen A Pohl ed01ce1422 Bug 1871527: Fix a crash in headless mode due to the creation of native menu bars for modals. r=mac-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D197197
2023-12-22 18:51:10 +00:00
Emilio Cobos Álvarez 091cf4f804 Bug 1870336 - Remove unused nsIAppWindow.add/removeChildWindow. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D196599
2023-12-16 10:47:01 +00:00
Jonathan Watt 61ff6ba12e Bug 1866011 p2. Rename nsIDocShell.contentViewer. r=emilio,credential-management-reviewers,devtools-reviewers,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D194370
2023-11-24 09:10:52 +00:00
Jonathan Watt efb5a74fbc Bug 1865480. Rename nsIContentViewer to nsIDocumentViewer. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D193987
2023-11-21 12:45:59 +00:00
Magnus Melin 17a23d5ca4 Bug 1819882 - Fix crash in [@ nsBaseWidget::NotifyLiveResizeStarted] via nsWindow::ProcessMessageInternal. r=edgar
Don't allow nullptr into mLiveResizeListeners

Differential Revision: https://phabricator.services.mozilla.com/D193358
2023-11-13 14:03:27 +00:00
Emilio Cobos Álvarez 02fbb2e9d3 Bug 1858977 - Don't throw on screen getters. r=smaug,webidl
The screen lifetime seems like it was a lot more complicated
in the past (looking at the comments in Window.webidl).

But nowadays it seems it can be more similar to the other
objects like VisualViewport etc.

Differential Revision: https://phabricator.services.mozilla.com/D193212
2023-11-10 09:29:14 +00:00
seb e2499ad3af Bug 1107433 - macOS: Add fallback menu bar for early startup modals. r=mac-reviewers,spohl
This adds a native fallback menu for early startup modals (e.g.
ProfileManager/ProfileDowngrade) which consists of a "Quit" menu item only,
allowing users to quit the app in a regular way (cmd+Q).

According to the bug report the "Quit" menu item used to exist but caused a
crash. With this patch crash doesn't repro anymore.

Differential Revision: https://phabricator.services.mozilla.com/D191525
2023-10-26 16:55:11 +00:00
Jan Varga 272327b326 Bug 1855134 - Move existing MOZ_TRY macros to a dedicated header file; r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D189226
2023-09-28 20:46:07 +00:00
Peter Van der Beken c10814e75a Bug 1846277 - Remove nsGlobalWindow.h. r=dom-core,necko-reviewers,jesup,farre
Differential Revision: https://phabricator.services.mozilla.com/D184973
2023-08-02 20:41:48 +00:00
Tom Schuster b46ab613d1 Bug 1838415 - Introduce RFPTarget::RoundWindowSize. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D181239
2023-06-26 07:17:38 +00:00
Brad Werth 77d438b5db Bug 1838330: Make AppWindow::FullscreenWillChange correctly compare window to screen using device scale. r=edgar
The implementation of AppWindow::ForceRoundedDimensions makes clear that
the window size from GetSize` is unscaled. This patch updates the math in
FullscreenWillChange to also consider devices pixels per css pixel.

Differential Revision: https://phabricator.services.mozilla.com/D180886
2023-06-14 18:53:34 +00:00
Tom Schuster 7014e9b592 Bug 1837153 - Make RFPTarget parameter of ShouldResistFingerprinting with justification non-optional. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D180667
2023-06-14 13:34:59 +00:00
Emilio Cobos Álvarez a486d481f3 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
Butkovits Atila 0275f46672 Backed out changeset ff1720f8fc34 (bug 1834042) for causing Android bustages at nsWindow.h. CLOSED TREE 2023-05-23 00:54:10 +03:00
Emilio Cobos Álvarez 602a43dedd Bug 1834042 - Make nsWindow::ConstrainPosition account for decorations. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D178545
2023-05-22 20:36:27 +00:00
Edgar Chen ffa8737e58 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
Edgar Chen 50c8c71676 Bug 1823284 - Avoid waiting for window resizing if it is already at expected dimensions; r=smaug
Depends on D175384

Differential Revision: https://phabricator.services.mozilla.com/D175213
2023-04-23 21:28:43 +00:00
Norisz Fay 4d8a85cafd 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
Edgar Chen 27e887869f 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
Edgar Chen 4b7d37384d Bug 1823284 - Avoid waiting for window resizing if it is already at expected dimensions; r=smaug
Depends on D175384

Differential Revision: https://phabricator.services.mozilla.com/D175213
2023-04-20 08:17:57 +00:00
Brad Werth 7ee093d55c Bug 1826645 Part 2: Make Document hold fullscreen requests while an exit is being processed. r=edgar
This change makes the parent process delay a fullscreen request if there
is a pending fullscreen exit. It also changes the DOMFullscreenParent
actor listener lifecycle. Once it has started handling a fullscreen
request, it will remain a listener to the Document until it receives an
exit event when the manager is out of fullscreen.

Differential Revision: https://phabricator.services.mozilla.com/D175186
2023-04-18 16:10:03 +00:00
filips 86e057515e Bug 1747722 - Allow changing window class hints using attributes. r=emilio,stransky
This patch adds two new attributes to the window's `html` element, `windowclass` and `windowname`, to allow directly controlling the window's class hints on Xorg/Wayland (`res_class` and `res_name`) from the chrome/JS code. When they are set, values are used as class hints for their window. When they are not set, the current behavior of determining `res_class` and `res_name` (using `gdk_get_program_class` for `res_class` and parsing `windowtype` for `res_name`) is preserved.

Changes in `widget/nsIWidget.h` and `widget/nsBaseWidget.h` are only interface changes so that `setWindowClass` can accept three attributes. Although this patch does not affect Windows, `widget/windows/nsWindow.h` and `widget/windows/nsWindow.cpp` have been updated to comply with the new interface. `xpfe/appshell/AppWindow.cpp` has been updated to get the additional attributes and call `setWindowClass` with them. The main changes are in `widget/gtk/nsWindow.h` and `widget/gtk/nsWindow.cpp`.

Differential Revision: https://phabricator.services.mozilla.com/D169720
2023-03-02 16:22:05 +00:00
Matthias Camenzind 67136b820a Bug 1814834 - Maintain client size in SyncAttributesToWidget() depending on the last resize. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D169633
2023-02-13 21:00:02 +00:00
Emilio Cobos Álvarez ee69295619 Bug 1813303 - Tweak order of operations in AppWindow::BeforeStartLayout. r=smaug
Sync the chromemargin attribute to the widget before restoring the
sizes, since the later depend on the former.

This is the same order we use when sizing the shell in OnChromeLoaded,
so it should be more consistent.

Differential Revision: https://phabricator.services.mozilla.com/D168200
2023-01-31 12:53:56 +00:00
Emilio Cobos Álvarez 996101dee3 Bug 1813303 - Clean up nsIWidget::SetNonClientMargins usage. r=spohl
Make it take a const reference and simplify callers.

No behavior change, but noticed while looking through this code.

Differential Revision: https://phabricator.services.mozilla.com/D168199
2023-01-28 21:43:47 +00:00
Matthias Camenzind 46143fbf6f Bug 1803611 - Part 2: Implement AppWindow::Set/GetDimensions. r=emilio
Depends on D166877

Differential Revision: https://phabricator.services.mozilla.com/D166878
2023-01-27 11:33:37 +00:00
Matthias Camenzind 5ac63c4724 Bug 1803611 - Part 1: Use shared code for AppWindow::SetPosition/And/Size. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D166877
2023-01-27 11:33:37 +00:00
Emilio Cobos Álvarez d382e254c1 Bug 1810614 - Simplify AppWindow::SizeShellTo when sizing to the window shell. r=smaug
In this case we can do easier things than going through the shell and
assuming all sizes go through the window.

Depends on D167027

Differential Revision: https://phabricator.services.mozilla.com/D166367
2023-01-26 12:48:22 +00:00
Emilio Cobos Álvarez 7d3fb4136a Bug 1809430 - Clean up ClientToWindowRect. r=cmartin,mstange
Make it return a margin from client area to window area, and add an
explicit function to get the size difference.

No behavior change.

Depends on D166428

Differential Revision: https://phabricator.services.mozilla.com/D166431
2023-01-26 11:19:16 +00:00
Emilio Cobos Álvarez e3921efc1e 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
Emilio Cobos Álvarez cc70813d89 Bug 1569439 - Rollup tooltips on window blur. r=stransky
This ensures that tooltips don't stick around if the window manager
doesn't send correct leave-notify events.

Differential Revision: https://phabricator.services.mozilla.com/D166945
2023-01-19 10:49:56 +00:00
Sandor Molnar 527a1fc91c Backed out changeset 27045cd56940 (bug 1810614) for causing bc failures in browser/base/content/test/popups/browser_popup_resize.js CLOSED TREE 2023-01-17 03:22:58 +02:00
Sandor Molnar 3fba33ca05 Backed out changeset 0f2913c81558 (bug 1809430) for causing multiple failures. 2023-01-17 03:13:06 +02:00
Emilio Cobos Álvarez 4d6260ac18 Bug 1810614 - Simplify AppWindow::SizeShellTo when sizing to the window shell. r=smaug
In this case we can do easier things than going through the shell and
assuming all sizes go through the window.

Differential Revision: https://phabricator.services.mozilla.com/D166367
2023-01-16 23:42:40 +00:00
Emilio Cobos Álvarez 02de9ebb1f Bug 1809430 - Clean up ClientToWindowRect. r=cmartin,mstange
Make it return a margin from client area to window area, and add an
explicit function to get the size difference.

No behavior change.

Depends on D166428

Differential Revision: https://phabricator.services.mozilla.com/D166431
2023-01-16 23:35:34 +00:00
Dave Townsend 4f946cc05d Bug 1777973: Remove MOZ_NEW_XULSTORE implementation. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D166786
2023-01-16 19:21:23 +00:00
Marian-Vasile Laza a6bca42917 Backed out changeset 7f9088d3354d (bug 1807838) for causing bc failures on browser_modal_resize.js. CLOSED TREE 2023-01-10 07:14:04 +02:00
Emilio Cobos Álvarez eae1894748 Bug 1807838 - Simplify AppWindow::SizeShellTo when sizing to the window shell. r=smaug
In this case we can do easier things than going through the shell and
assuming all sizes go through the window.

Differential Revision: https://phabricator.services.mozilla.com/D166367
2023-01-09 23:01:07 +00:00
Emilio Cobos Álvarez 57f7354f4d Bug 1808748 - Add a browsing context flag to force the top level chrome browsing context to remain active. r=nika
This will be useful for bug 1770429.

Differential Revision: https://phabricator.services.mozilla.com/D166105
2023-01-09 16:38:47 +00:00
Edgar Chen 8713fa0dfc Bug 1801391 - Avoid handling multiple widget fullscreen at the same time; r=smaug
We had some protection in https://searchfox.org/mozilla-central/rev/2fc2ccf960c2f7c419262ac7215715c5235948db/dom/base/nsGlobalWindowOuter.cpp#4259-4265,
but it isn't enough, it is still possible that fullscreen state get confused if
there are multiple request happens at a short time.

This patch tries to improve how we handle multiple request, we don't need to
track each request, but need to ensure widget matches with the latest fullscreen
state specified.

Differential Revision: https://phabricator.services.mozilla.com/D163311
2022-12-21 12:49:18 +00:00
Marian-Vasile Laza 674a53bcb7 Backed out changeset 903719ec824e (bug 1801391) for causing wpt failures on element-request-fullscreen-timing.html. 2022-12-21 04:18:53 +02:00
Edgar Chen b8af120506 Bug 1801391 - Avoid handling multiple widget fullscreen at the same time; r=smaug
We had some protection in https://searchfox.org/mozilla-central/rev/2fc2ccf960c2f7c419262ac7215715c5235948db/dom/base/nsGlobalWindowOuter.cpp#4259-4265,
but it isn't enough, it is still possible that fullscreen state get confused if
there are multiple request happens at a short time.

This patch tries to improve how we handle multiple request, we don't need to
track each request, but need to ensure widget matches with the latest fullscreen
state specified.

Differential Revision: https://phabricator.services.mozilla.com/D163311
2022-12-20 20:17:33 +00:00
Matthias Camenzind 90f82e886d Bug 1786048 - Part 4: Remove cross process SizeShellTo. r=emilio
Because the parent process lacks information about the current shell
size, the child has to send both the current and the new shell size to
the parent. The parent then applies the delta to the window size. This
can produce different results for calls with the same arguments,
whenever a previous call did not have enough time to update the child
with its new size.

The implementation is replaced by applying the delta in the child.

Differential Revision: https://phabricator.services.mozilla.com/D160261
2022-12-15 23:13:01 +00:00
Matthias Camenzind d634177ee2 Bug 1786048 - Part 3: Merge nsIEmbeddingSiteWindow into nsIBaseWindow. r=emilio
Implementations of nsIEmbeddingSiteWindow and nsIBaseWindow largely
overlap, and where they don't, the nsIEmbeddingSiteWindow implementation
of the otherwise shared interface is primarily stubbed out with the
exception of Get/SetDimensions().

This patch moves a reimplementation of Get/SetDimensions() from
nsIEmbeddingSiteWindow to nsIBaseWindow. The other methods of
nsIEmbeddingSiteWindow remain covered by nsIBaseWindow.
Get/SetDimensions() can be implemented as part of nsIWebBrowserChrome
where nsIBaseWindow is not necessary. This removes the need for
nsIEmbeddingSiteWindow.

Blur() has also been moved to nsIWebBrowserChrome, as only
nsContentTreeOwner has an actual implementation which we in theory also
want to call from BrowserChild/Parent, but the spec suggests to
"selectively or uniformly ignore calls".

GetVisibility() had an implementation in BrowserChild that pretended to
always be visible. Instead of providing an interface for that,
nsDocShell now handles the not implemented case for tree owners.

nsIEmbeddingSiteWindow::GetSiteWindow() used to call through to
nsIBaseWindow::GetParentNativeWindow().

The Get/SetDimensions() implementation has been replaced with a strongly
typed setter, which is now also used directly from nsGlobalWindowOuter
to avoid problems that come with autodetecting unchanged dimensions,
when the current dimensions are outdated (e.g. immediately reverting a
change can be ignored).

Differential Revision: https://phabricator.services.mozilla.com/D160260
2022-12-15 23:13:00 +00:00