Also explicitly use titlebar=no on the PIP window, since we really don't
want a titlebar.
This way we don't end up without titlebars in other alwaysontop windows.
Differential Revision: https://phabricator.services.mozilla.com/D172992
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
With this patch the webrtcIndicator is no longer considered a PIP window on GTK.
This makes the webrtcIndicator *not* show a resize cursor over most of its
surface.
Differential Revision: https://phabricator.services.mozilla.com/D169783
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
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
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
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
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
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
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
The getter used to return CSS pixels, while the setter expected layout
device pixels. The nsIDocShellTreeOwner documentation used to suggest that
CSS pixels are used for getters and setters of the primary content and
the root shell size. Only the getter for the primary content size
happend to match that documentation.
Differential Revision: https://phabricator.services.mozilla.com/D161944
Two minor changes that otherwise might go unnoticed in the following
parts:
- AppWindow can't skip SetSize calls that match the current size. On
Linux a previous call might not have changed the size yet. If the
current call is skipped, the previous call can ultimately dictate the
resulting size.
- BrowserParent should not have to call UpdatePosition when receiving
new dimensions from BrowserChild. But HeadlessWidget needs to call
NotifyWindowMoved when moved.
Differential Revision: https://phabricator.services.mozilla.com/D160259
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
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
The getter used to return CSS pixels, while the setter expected layout
device pixels. The nsIDocShellTreeOwner documentation used to suggest that
CSS pixels are used for getters and setters of the primary content and
the root shell size. Only the getter for the primary content size
happend to match that documentation.
Differential Revision: https://phabricator.services.mozilla.com/D161944
Two minor changes that otherwise might go unnoticed in the following
parts:
- AppWindow can't skip SetSize calls that match the current size. On
Linux a previous call might not have changed the size yet. If the
current call is skipped, the previous call can ultimately dictate the
resulting size.
- BrowserParent should not have to call UpdatePosition when receiving
new dimensions from BrowserChild. But HeadlessWidget needs to call
NotifyWindowMoved when moved. HeadlessWidget no longer stays in
"maximized" size mode after being resized or moved.
Differential Revision: https://phabricator.services.mozilla.com/D160259
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
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
The getter used to return CSS pixels, while the setter expected layout
device pixels. The nsIDocShellTreeOwner documentation used to suggest that
CSS pixels are used for getters and setters of the primary content and
the root shell size. Only the getter for the primary content size
happend to match that documentation.
Differential Revision: https://phabricator.services.mozilla.com/D161944
Two minor changes that otherwise might go unnoticed in the following
parts:
- AppWindow can't skip SetSize calls that match the current size. On
Linux a previous call might not have changed the size yet. If the
current call is skipped, the previous call can ultimately dictate the
resulting size.
- BrowserParent should not have to call UpdatePosition when receiving
new dimensions from BrowserChild. But HeadlessWidget needs to call
NotifyWindowMoved when moved. HeadlessWidget no longer stays in
"maximized" size mode after being resized or moved.
Differential Revision: https://phabricator.services.mozilla.com/D160259
Fullscreen state on chrome window might not accurate as it might not be updated
yet, e.g. user clicks the window controls button to switch fullscreen mode on
macOS.
Differential Revision: https://phabricator.services.mozilla.com/D163028
Otherwise we hit the weird HTML-specific lowercasing of attributes,
which make these attributes "screenx" and "screeny", which means we fail
to restore the persisted position.
We should consider adding screen-x/screen-y and migrate screenX/Y to
that probably...
Differential Revision: https://phabricator.services.mozilla.com/D162391