Usually we update mBounds from OnSizeAllocate() which is called
by Gtk when mContainer changes its actual size.
However we need to set mBounds in advance at Resize() as JS
code expect immediate window size change. When Resize() is called between
SetSizeMode() calls (which maximize/unmaximize the window) we can miss
OnSizeAllocate() Gtk call as actual mContainer size may not change
from Gtk perspective and we end up with incorrect mBounds.
To compensate it call OnSizeAllocate() explicitly also
from OnConfigureEvent().
Differential Revision: https://phabricator.services.mozilla.com/D55941
--HG--
extra : moz-landing-system : lando
Create a general interface for getting platform-specific media keys event source in order to remove platform specific code from non-platform related folder `dom/media`.
Differential Revision: https://phabricator.services.mozilla.com/D55892
--HG--
rename : dom/media/mediacontrol/MediaHardwareKeysEventSourceMac.h => widget/cocoa/MediaHardwareKeysEventSourceMac.h
rename : dom/media/mediacontrol/MediaHardwareKeysEventSourceMac.mm => widget/cocoa/MediaHardwareKeysEventSourceMac.mm
extra : moz-landing-system : lando
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.
find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
if [ -n "$interfaces" ]; then
if [[ "$interfaces" == *$'\n'* ]]; then
regexp="\("
for i in $interfaces; do regexp="$regexp$i\|"; done
regexp="${regexp%%\\\|}\)"
else
regexp="$interfaces"
fi
interface=$(basename "$path")
rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
if [ $hits -eq 0 ]; then
echo "Removing ${interface} from ${path2}"
grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
mv -f "$path2".tmp "$path2"
fi
done
fi
done
Differential Revision: https://phabricator.services.mozilla.com/D55444
--HG--
extra : moz-landing-system : lando
Otherwise open flags are not defined in some build configurations (or in
non-unified builds, for that matter).
Differential Revision: https://phabricator.services.mozilla.com/D55363
--HG--
extra : moz-landing-system : lando
Lets Wayland sessions run vsync off wayland surface frame callbacks by creating
an interface for widgets to return a local VsyncSource, if applicable.
This interface is currently used for the compositor, and for refresh drivers
in the parent process. It is not yet used for vsync in content processes.
Differential Revision: https://phabricator.services.mozilla.com/D28430
--HG--
extra : moz-landing-system : lando
Items in overflow-widget which belongs to addons cannot have
the overflow-widget panel set as a popup parent because the
overflow-widget is replaced by them.
We also need to close the addon panel before we return back
to overflow-widget to avoid simillar problem.
Differential Revision: https://phabricator.services.mozilla.com/D53011
--HG--
extra : moz-landing-system : lando
Items in overflow-widget which belongs to addons cannot have
the overflow-widget panel set as a popup parent because the
overflow-widget is replaced by them.
We also need to close the addon panel before we return back
to overflow-widget to avoid simillar problem.
Differential Revision: https://phabricator.services.mozilla.com/D53011
--HG--
extra : moz-landing-system : lando
The absolute position of the window under Wayland is unknown
and using monitor offset to adjust popups position shown
on content (like <select) is therefore broken on Wayland.
Differential Revision: https://phabricator.services.mozilla.com/D53965
--HG--
extra : moz-landing-system : lando
These are single-fd polls of the X server socket, which in practice will
be much smaller than FD_SETSIZE, but it's cleaner to just not have the
fixed-size array in the first place.
Differential Revision: https://phabricator.services.mozilla.com/D52744
--HG--
extra : moz-landing-system : lando
These identifiers can be compared with messages from logging from nsWindow.
Also clarify that this log is not intended to indicate each draw.
Differential Revision: https://phabricator.services.mozilla.com/D53387
--HG--
extra : moz-landing-system : lando
This stores the clipboard even if it was set in a GTK dialog.
Depends on D50764
Differential Revision: https://phabricator.services.mozilla.com/D50765
--HG--
extra : moz-landing-system : lando
The formatting change presumably happens because clang-format treats
include guards differently.
Differential Revision: https://phabricator.services.mozilla.com/D52698
--HG--
extra : moz-landing-system : lando
This notifies GTK that the data is no longer available for clipboard_get_cb(),
so that GTK will no longer advertise nor attempt to store the data.
The clipboard is not cleared immediately before it is set in case that might
trigger a system clipboard manager to take ownership of the selection, which
could lead to gtk_clipboard_set_with_data() failing to take ownership back due
to an older timestamp.
This also fixes a GtkTargetList leak.
Differential Revision: https://phabricator.services.mozilla.com/D50764
--HG--
extra : moz-landing-system : lando
The reason of the crash is, the window may have already been destroyed and
`PuppetWidget::mBrowserChild` was set to `nullptr` when synthesizing key event.
This patch makes `PuppetWidget::GetEditCommands()` check whether it's `nullptr`
and returns whether it's succeeded or not. Therefore, `TextInputProcessor`
can throw exception in such case.
Differential Revision: https://phabricator.services.mozilla.com/D52308
--HG--
extra : moz-landing-system : lando
WebRender does not call moz_container_get_wl_egl_window() before each frame so mozcontainer
is not positioned properly here.
As a fix position mozcontainer directly at moz_container_move() if there are resources
for it.
Also always call moz_container_get_wl_surface() at moz_container_get_wl_egl_window()
to make sure an underlying mozcontainer surface is properly positioned.
Differential Revision: https://phabricator.services.mozilla.com/D52362
--HG--
extra : moz-landing-system : lando
Also rename surface_position_update to surface_position_needs_update to make it more clear.
Differential Revision: https://phabricator.services.mozilla.com/D52171
--HG--
extra : moz-landing-system : lando
This patch fixes activation of the :-moz-window-inactive pseudoclass in client side decoration during drag operations. It depends on and complements the fixes provided in support of Bug 1491808.
Obsoletes D50445
Differential Revision: https://phabricator.services.mozilla.com/D51307
--HG--
extra : moz-landing-system : lando
Remove moz_container_get_scale() and use only nsWindow::GdkScaleFactor() to get scale factor for wl_surface and wl_egl_window.
Always set the scale factor when wl_surface / wl_egl_window is queued for rendering.
Differential Revision: https://phabricator.services.mozilla.com/D51252
--HG--
extra : moz-landing-system : lando
Split off of Bug 1590894
Rename these to support unprefixed version
Also add alias to keep compatibility
Differential Revision: https://phabricator.services.mozilla.com/D50989
--HG--
extra : moz-landing-system : lando
Add IsDMABufBuffer identification to WindowBackBuffer
Use two sets of wayland buffers (shm and dmabuf) and use dmabuf for fullscreen updates only
when dmabuf is enabled.
Split GetWaylandBufferToDraw() to GetWaylandBufferRecent() and GetWaylandBufferWithSwitch()
to better reflect actual function.
Add CreateWaylandBuffer() to create and store Wayland buffer and use it at SetNewWaylandBuffer()
to change an active wayland buffer or create a new one.
When CACHE_MISSING image cache is selected we draw directly to wayland buffer if it's available
and cache drawing when wayland buffer is missing only. That produces flickering when small buffer parts are
sent to compositor early and the buffer is blocked for further rendering.
This patch enables direct rendering of bigger screen parts only (like page scrolling) to eliminate small
buffer updates.
Differential Revision: https://phabricator.services.mozilla.com/D50055
--HG--
extra : moz-landing-system : lando
This stores the clipboard even if it was set in a GTK dialog.
Depends on D50764
Differential Revision: https://phabricator.services.mozilla.com/D50765
--HG--
extra : moz-landing-system : lando
This notifies GTK that the data is no longer available for clipboard_get_cb(),
so that GTK will no longer advertise nor attempt to store the data.
Differential Revision: https://phabricator.services.mozilla.com/D50764
--HG--
extra : moz-landing-system : lando
Split off of Bug 1590894
Rename these to support unprefixed version
Also add alias to keep compatibility
Differential Revision: https://phabricator.services.mozilla.com/D50989
--HG--
extra : moz-landing-system : lando
I discovered this while improving `ScrollFrameHelper::IsPhysicalLTR()`
in Part 1. Our code base needs a notion of physical direction. Let's add
it to WritingMode.
Differential Revision: https://phabricator.services.mozilla.com/D49818
--HG--
extra : moz-landing-system : lando
By getting the right screen size we can shrink the popup menus which overflows
the screen size under Wayland. The ScreenManager does not help us, because we
can't get absolute window position, but we can use gdk_display_get_monitor_at_window
and gdk_monitor_get_workarea to get the correct screen rectangle.
Differential Revision: https://phabricator.services.mozilla.com/D49289
--HG--
extra : moz-landing-system : lando
By getting the right screen size we can shrink the popup menus which overflows
the screen size under Wayland. The ScreenManager does not help us, because we
can't get absolute window position, but we can use gdk_display_get_monitor_at_window
and gdk_monitor_get_workarea to get the correct screen rectangle.
Differential Revision: https://phabricator.services.mozilla.com/D49289
--HG--
extra : moz-landing-system : lando
We can't set wl_egl_window from widget code as it must match GL rendering pipeline,
so let compositor to set the egl window size.
Depends on D49136
Differential Revision: https://phabricator.services.mozilla.com/D49137
--HG--
extra : moz-landing-system : lando
wl_egl_window size must exactly march GL rendering pipeline setting.
Compositor and widget can have different window sizes during window resize when widget
is resized faster than layout can render. Firefox window is rendered misplaced then
and it's "jumping" as layout size is behind toolkit size.
Differential Revision: https://phabricator.services.mozilla.com/D49136
--HG--
extra : moz-landing-system : lando
We can't set wl_egl_window from widget code as it must match GL rendering pipeline,
so let compositor to set the egl window size.
Depends on D49136
Differential Revision: https://phabricator.services.mozilla.com/D49137
--HG--
extra : moz-landing-system : lando
wl_egl_window size must exactly march GL rendering pipeline setting.
Compositor and widget can have different window sizes during window resize when widget
is resized faster than layout can render. Firefox window is rendered misplaced then
and it's "jumping" as layout size is behind toolkit size.
Differential Revision: https://phabricator.services.mozilla.com/D49136
--HG--
extra : moz-landing-system : lando
Chrome and old Edge at least seem to have this behavior, and this way the testcase on the bug doesn't trigger click anymore since
we enter dnd mode and get dragleave etc. events.
Manually tested on linux and Windows, and annyg tested on Mac
Update test_dragstart.html's draggable=true test to follow the pattern used by other tests
Differential Revision: https://phabricator.services.mozilla.com/D48208
--HG--
extra : moz-landing-system : lando
Chrome and old Edge at least seem to have this behavior, and this way the testcase on the bug doesn't trigger click anymore since
we enter dnd mode and get dragleave etc. events.
Manually tested on linux and Windows, and annyg tested on Mac
Differential Revision: https://phabricator.services.mozilla.com/D48208
--HG--
extra : moz-landing-system : lando
Under Wayland it is possible to add only one popup window
to a parent window. If we try to attach another popup to the window,
the GTK refuses to do that. This can happen when the previous popup
has not yet been hidden while the new popup is showing (in some cases
the nsWindow::Show(false) for the previous popup is not called before
nsWindow::Show(true) for the new one).
We deal with it by hiding wayland popups which are no longer in the
XULPopupManager (PM) before showing a new one. We only do that for
the main menu popups or context (sub)menus. We cannot use PM to check
for the panel popup content like Folder dropdown in Edit Bookmark panel
or WebRTC microphone/video source dropdown. In that case we simply use
the last shown popup as a transient for the new one or the toplevel window.
Differential Revision: https://phabricator.services.mozilla.com/D47610
--HG--
extra : moz-landing-system : lando
Under Wayland it is possible to add only one popup window
to a parent window. If we try to attach another popup to the window,
the GTK refuses to do that. This can happen when the previous popup
has not yet been hidden while the new popup is showing (in some cases
the nsWindow::Show(false) for the previous popup is not called before
nsWindow::Show(true) for the new one).
We deal with it by hiding wayland popups which are no longer in the
XULPopupManager (PM) before showing a new one. We only do that for
the main menu popups or context (sub)menus. We cannot use PM to check
for the panel popup content like Folder dropdown in Edit Bookmark panel
or WebRTC microphone/video source dropdown. In that case we simply use
the last shown popup as a transient for the new one or the toplevel window.
Differential Revision: https://phabricator.services.mozilla.com/D47610
--HG--
extra : moz-landing-system : lando
- Don't store whole buffer update information at mWholeWindowBufferDamage but use damage region instead.
- Check and remove overlapped images when they are stored at image cache.
- Remove CanDrawToWaylandBufferDirectly() as it's not very useful.
This commit depends on Bug 1580152 which needs to land first.
Differential Revision: https://phabricator.services.mozilla.com/D46140
--HG--
extra : moz-landing-system : lando
- Recently we're missing some drawings as we disabled flushing cached images in frame callback. Let's enable it again and make sure we don't flush the drawings between Lock()/Commit() compositor calls which is controlled by mBufferCommitAllowed.
- When we draw directly to wl_buffer, flush all cached drawings we have or clear them if there's fullscreen update. It prevents potential rendering of cached images over unrelevant buffer content.
- Flush cached images when wl_buffer is detached by wayland compositor. It allows to paint delayed drawings and ensures they won't stay in the queue infinitely.
- Use mBufferPendingCommit to indicate that the WaylandBuffer contains updates from gecko which has not been submitted to wayland compositor yet. Allows delated commit handlers (frame callback, delayed commit and when wl_buffer is detached) to send WaylandBuffer content to wayland compositor.
- Record time of last finished commit to mLastCommitTime and throws warning when wayland compositor does not release wl_buffer in 200ms.
- Use wl_display_sync() to synchronize wl_display events. Wait for events from wl_display until all pending events are processed before we start drawing at WindowSurfaceWayland::Lock(). There may wl_buffer release event waiting which releases wl_buffer for rendering.
- Don't use XMost()/YMost() to get drawing area size.
- Remove mDisplayThreadMessageLoop as it's no longer used.
Differential Revision: https://phabricator.services.mozilla.com/D45661
--HG--
extra : moz-landing-system : lando
Rounding in layout pixels is very close to snapping in raster pixels if
there are no transforms involved. This is why it worked most of the time
and fell flat in many edge cases. In future parts of this series, we
will trust scene building and frame building to do the heavy lifting for
snapping purposes.
Differential Revision: https://phabricator.services.mozilla.com/D45058
--HG--
extra : moz-landing-system : lando
Rounding in layout pixels is very close to snapping in raster pixels if
there are no transforms involved. This is why it worked most of the time
and fell flat in many edge cases. In future parts of this series, we
will trust scene building and frame building to do the heavy lifting for
snapping purposes.
Differential Revision: https://phabricator.services.mozilla.com/D45058
--HG--
extra : moz-landing-system : lando
Rounding in layout pixels is very close to snapping in raster pixels if
there are no transforms involved. This is why it worked most of the time
and fell flat in many edge cases. In future parts of this series, we
will trust scene building and frame building to do the heavy lifting for
snapping purposes.
Differential Revision: https://phabricator.services.mozilla.com/D45058
--HG--
extra : moz-landing-system : lando
For popup windows with parent we need to get scale factor of the parent
window. Because when the windows are hidden they're not receiving updates
about changing scaling factor. So when moving from normal dpi to
the hidpi monitor the newly opened popup windows will have the same scale.
Differential Revision: https://phabricator.services.mozilla.com/D45649
--HG--
extra : moz-landing-system : lando
Rounding in layout pixels is very close to snapping in raster pixels if
there are no transforms involved. This is why it worked most of the time
and fell flat in many edge cases. In future parts of this series, we
will trust scene building and frame building to do the heavy lifting for
snapping purposes.
Differential Revision: https://phabricator.services.mozilla.com/D45058
--HG--
extra : moz-landing-system : lando
Under Wayland where there's a strict popup window hierarchy, using toplevel window
for the submenus in popupnotification cause the popupnotification to hide
when opening them and this breaks user to Allow/Don't allow the action.
We have to use last opened popup window as a parent for these submenus.
Differential Revision: https://phabricator.services.mozilla.com/D45343
--HG--
extra : moz-landing-system : lando
- When widget.wayland_cache_mode=1 use direct rendering to wl_buffer only when there isn't any
cached rendering pending and we're updating one big piece of screen (video playback/scrolling etc..)
- Disable frame callback commits between WindowSurfaceWayland::Lock and WindowSurfaceWayland::Commit
as the buffer can be updated by gecko compositor
Differential Revision: https://phabricator.services.mozilla.com/D45184
--HG--
extra : moz-landing-system : lando
Recently direct wl_buffer rendering is kept enabled until we have wl_buffer available which
produces rendering artifacts when screen damage rects overlaps.
Let's enable/disable it explicitly at every rendering cycle start to avoid
screen flickering.
Depends on D45166
Differential Revision: https://phabricator.services.mozilla.com/D45167
--HG--
extra : moz-landing-system : lando
Use wl_surface_damage_buffer() to propagate wl_buffer damage to avoid rounding errors and
rendering artifacts for HiDPI wl_buffers.
Depends on D45165
Differential Revision: https://phabricator.services.mozilla.com/D45166
--HG--
extra : moz-landing-system : lando
Most of things will likely be no real change because they ask for the exact frame they want immediately before.
Differential Revision: https://phabricator.services.mozilla.com/D44359
--HG--
extra : moz-landing-system : lando
This was fixed upstream, so we can eventually remove this.
Having the issue number makes it much nicer to figure out when is the right time
to remove it.
Differential Revision: https://phabricator.services.mozilla.com/D44624
--HG--
extra : moz-landing-system : lando
- Allow to create WaylandDMABufSurface with wl_buffer or EGLImage on top of it
- Disable dmabuf modifiers as they slow down the data upload
- Add ability to export/import WaylandDMABufSurface via. file descriptors
Differential Revision: https://phabricator.services.mozilla.com/D43609
--HG--
extra : moz-landing-system : lando
Image cache mode can be set by widget.wayland_cache_mode.
- widget.wayland_cache_mode = 0 (or missing):
Cache and clip all drawings, default. It's slowest
but also without any rendered artifacts.
- widget.wayland_cache_mode = 1:
Cache drawing only when back buffer is missing. May produce
some rendering artifacts and flickering when partial screen update
is rendered.
- widget.wayland_cache_mode = 2:
Don't cache anything, draw only when back buffer is available.
Suitable for fullscreen content only like fullscreen video playback and
may work well with dmabuf backend.
Differential Revision: https://phabricator.services.mozilla.com/D43681
- Use former ReparentNativeWidgetInternal() code in nsWindow::SetParent().
Also update mToplevelParentWindow for Wayland to hold default toplevel window.
- Make nsWindow::ReparentNativeWidget() to work on toplevel windows only and use only gtk_window_set_transient_for() to reparent
a toplevel window. Also update mToplevelParentWindow for Wayland.
Differential Revision: https://phabricator.services.mozilla.com/D43600
--HG--
extra : moz-landing-system : lando
For popup windows with parent we need to get scale factor of the parent
window. Because when the windows are hidden they're not receiving updates
about changing scaling factor. So when moving from normal dpi to
the hidpi monitor the newly opened popup windows will have the same scale
Differential Revision: https://phabricator.services.mozilla.com/D41947
--HG--
extra : moz-landing-system : lando
Recently window resize on Wayland produces flickering/rendering artifacts because
window background is randomly cleared due to actual window size changes.
We recently query widget size and do clear/fullscreen update when the size changes.
To avoid that, get widget size once at WindowSurfaceWayland::Lock() and use it
until next WindowSurfaceWayland::Lock(). Also don't to switch wayland back buffers
until there's really fullscreen update from compositor.
This patch:
- Use mLockedScreenRect to store window size at WindowSurfaceWayland::Lock(). It's used
to detect widget resize, when it happens throw away all cached painting and wait for
full screen update.
- Use mBufferScreenRect to store size of wayland back buffer and pass it
instead of actual widget size we used before this patch. This ensures all our
drawing matches the buffer size.
- Rename aFullScreenUpdate to aCanSwitchBuffer at LockWaylandBuffer() to stress
actual meaning - we can/can't switch back buffers for partial drawing and we need to
wait until recent back buffer is released by compositor.
Differential Revision: https://phabricator.services.mozilla.com/D43263
--HG--
extra : moz-landing-system : lando
Converts ui.context_menus.after_mouseup varcache pref to a static pref and removes its associated function.
Differential Revision: https://phabricator.services.mozilla.com/D43519
--HG--
extra : moz-landing-system : lando
Converts layout.css.devPixelsPerPx to a static pref. This one was one of the slightly odd ones; some values were expecting an atomic float, so instead of defining a regular type float it is defined in StaticPrefList.yaml as an AtomicFloat. I am assuming this was the intent of the pref value all along.
Differential Revision: https://phabricator.services.mozilla.com/D42396
--HG--
extra : moz-landing-system : lando
Bug 1278282 removed Gtk2 support, so MOZ_WIDGET_TOOLKIT is always "gtk3"
for Gtk builds, and never "gtk", which makes the current check never
match.
Differential Revision: https://phabricator.services.mozilla.com/D42761
--HG--
extra : moz-landing-system : lando
For popup windows with parent we need to get scale factor of the parent
window. Because when the windows are hidden they're not receiving updates
about changing scaling factor. So when moving from normal dpi to
the hidpi monitor the newly opened popup windows will have the same scale
Differential Revision: https://phabricator.services.mozilla.com/D41947
--HG--
extra : moz-landing-system : lando
Under Wayland the GTK does not send the correct window state event change
when the window is iconified. We need to add a workaround for that to avoid
unresponsive UI after restoring the window.
Differential Revision: https://phabricator.services.mozilla.com/D41219
--HG--
extra : moz-landing-system : lando
Converts mozilla.widget.disable-native-theme varcache pref to a static pref and updates uses of its associated global variable with the pref. This also renames the pref to widget.disable-native-theme to group with other widget prefs.
Differential Revision: https://phabricator.services.mozilla.com/D40721
--HG--
extra : moz-landing-system : lando
The early return for non-popup windows was to workaround
https://bugzilla.mozilla.org/show_bug.cgi?id=1344839 which involved problems
with CleanLayerManagerRecursive(). In cases where layer manager configuration
does not change, there is no need to clean the layer manager and so no need to
return early.
Differential Revision: https://phabricator.services.mozilla.com/D40145
--HG--
extra : moz-landing-system : lando
If the popup is a regular menu but GetParentMenuWidget() returns
nullptr, it's connected non-menu parent (bookmark toolbar for instance).
In this case use a parent given at nsWindow::Create() and don't attach it
to latest active popup as it has a real parent.
Depends on D39347
Differential Revision: https://phabricator.services.mozilla.com/D39348
--HG--
extra : moz-landing-system : lando
- gtk_window_get_transient_for() fails to return correct toplevel window as the toplevel window changes
when popup is moved in popup hierarchy. So store the toplevel given at nsWindow::Create() and
use it instead.
- Remove some redundat NS_WARNING() from wayland code
- Attach "moved-to-rect" signal handler to GdkWindow only once a update
NativeMoveResizeWaylandPopupCallback() loging.
- Add more logging to Wayland popup related code.
Differential Revision: https://phabricator.services.mozilla.com/D39347
--HG--
extra : moz-landing-system : lando
If the popup is a regular menu but GetParentMenuWidget() returns
nullptr, it's connected non-menu parent (bookmark toolbar for instance).
In this case use a parent given at nsWindow::Create() and don't attach it
to latest active popup as it has a real parent.
Depends on D39347
Differential Revision: https://phabricator.services.mozilla.com/D39348
--HG--
extra : moz-landing-system : lando
- gtk_window_get_transient_for() fails to return correct toplevel window as the toplevel window changes
when popup is moved in popup hierarchy. So store the toplevel given at nsWindow::Create() and
use it instead.
- Remove some redundat NS_WARNING() from wayland code
- Attach "moved-to-rect" signal handler to GdkWindow only once a update
NativeMoveResizeWaylandPopupCallback() loging.
- Add more logging to Wayland popup related code.
Differential Revision: https://phabricator.services.mozilla.com/D39347
--HG--
extra : moz-landing-system : lando
When the popup is without parent it mess up with the Wayland popup hierarchy.
Then any other popup cannot be shown, for example when webrtc ui
shows up the user is unable to allow sharing screen during that.
Differential Revision: https://phabricator.services.mozilla.com/D38507
--HG--
extra : moz-landing-system : lando
This requires replacing inclusions of it with inclusions of more specific prefs
files.
The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.
Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.
Differential Revision: https://phabricator.services.mozilla.com/D39138
--HG--
extra : moz-landing-system : lando
CompositorInitiallyPaused() uses mNeedsUpdatingEGLSurface. But it is not good. mNeedsUpdatingEGLSurface is set to true in moz_container_set_initial_draw_callback(). If compositor is created before moz_container_set_initial_draw_callback(), compositor is not initially paused. It happens sometimes with popup window.
Differential Revision: https://phabricator.services.mozilla.com/D38200
--HG--
extra : moz-landing-system : lando
Adds GeckoChildProcessHost::GetAll() and use it in ChromeUtils::GetProcInfo()
Differential Revision: https://phabricator.services.mozilla.com/D33920
--HG--
extra : moz-landing-system : lando
Adds GeckoChildProcessHost::GetAll() and use it in ChromeUtils::GetProcInfo()
Differential Revision: https://phabricator.services.mozilla.com/D33920
--HG--
extra : moz-landing-system : lando
Adds GeckoChildProcessHost::GetAll() and use it in ChromeUtils::GetProcInfo()
Differential Revision: https://phabricator.services.mozilla.com/D33920
--HG--
extra : moz-landing-system : lando
- Don't block all drawing until whole screen was painted, clear the screen and
allow partial drawing instead.
- Detect window resize and allow partial drawing directly to wayland buffer in this case.
- Remove backbuffer copy - wait to buffer release instead.
Depends on D33910
Differential Revision: https://phabricator.services.mozilla.com/D33911
--HG--
extra : moz-landing-system : lando
- Add widget.wayland_dmabuf_backend.enabled
- Expose it to Wayland backend by WaylandDisplay object
- Add more logging to Wayland DMABuf backend
Differential Revision: https://phabricator.services.mozilla.com/D33919
--HG--
extra : moz-landing-system : lando
To run task_for_pid() on child processes, we need the child task port for
security reasons. This port can be obtained via a Mach IPC exchange.
This is what GeckoChildProcessHost::GetChildTask() provides, so we use it
in cocoa's version of GetProcInfo()
Differential Revision: https://phabricator.services.mozilla.com/D25927
--HG--
extra : moz-landing-system : lando
- Add widget.wayland_dmabuf_backend.enabled
- Expose it to Wayland backend by WaylandDisplay object
- Add more logging to Wayland DMABuf backend
Differential Revision: https://phabricator.services.mozilla.com/D33919
--HG--
extra : moz-landing-system : lando
- Don't block all drawing until whole screen was painted, clear the screen and
allow partial drawing instead.
- Detect window resize and allow partial drawing directly to wayland buffer in this case.
- Remove backbuffer copy - wait to buffer release instead.
Depends on D33910
Differential Revision: https://phabricator.services.mozilla.com/D33911
--HG--
extra : moz-landing-system : lando
To run task_for_pid() on child processes, we need the child task port for
security reasons. This port can be obtained via a Mach IPC exchange.
This is what GeckoChildProcessHost::GetChildTask() provides, so we use it
in cocoa's version of GetProcInfo()
Differential Revision: https://phabricator.services.mozilla.com/D25927
--HG--
extra : moz-landing-system : lando
Because of the way the canvas 2D implementation juggles between path builders and paths, we have to keep track of current and first points in the path, in case a builder is created out of it.
Differential Revision: https://phabricator.services.mozilla.com/D33757
--HG--
extra : source : c79b3af2395894b449731fccdd9eb006b4d0189e
gfxPlatform::GetSourceSurfaceForSurface and CreateDrawTargetForSurface
are both static methods that we sometimes use via the pattern
gfxPlatform::GetPlatform()->... This is problematic because this forces
gfxPlatform to be initialized in the process, and in the GPU process, we
don't support this. It should be safe to call these methods without
initializing gfxPlatform, so this patch removes the GetPlatform() call.
GetSourceSurfaceForSurface may end up initializing gfxPlatform anyways,
depending on whether or not a DrawTarget was given. This should not be a
concern for the crashes observed in bug 1435586.
Differential Revision: https://phabricator.services.mozilla.com/D33785
Make nsIWebBrowserPrint included unconditionally for addressing nsIDocShell.rs build failure.
Remove direct_call of PPrinting and PRemotePrintJob. Their ipdl are built unconditionally, but their derived classes are not built with --disable-printing.
Differential Revision: https://phabricator.services.mozilla.com/D33391
--HG--
extra : moz-landing-system : lando
- Implement WaylandDMABufSurface class which provides basic 2D surfaces located at GPU memory.
- Implement ability to bind it as wl_buffer for direct wayland rendering and R/W mapping for CPU
Differential Revision: https://phabricator.services.mozilla.com/D33597
--HG--
extra : moz-landing-system : lando
- Implement nsGbmLib object which binds symbols run-time from libgbm.so library.
- Load available DRM pixel formats from Wayland registry and store related modifiers at WaylandDisplay object.
- Implement Gbm device setup at WaylandDisplay.
Differential Revision: https://phabricator.services.mozilla.com/D32633
--HG--
extra : moz-landing-system : lando
Only gtk returns failure ever, and nobody checks the result anyway.
Use an enum class so that it's clear from the caller what it means.
Differential Revision: https://phabricator.services.mozilla.com/D32353
--HG--
extra : moz-landing-system : lando
When transparent popup window is rendered clear window background to clear
visual artifacts and bold shadows over the popup.
Differential Revision: https://phabricator.services.mozilla.com/D33155
--HG--
extra : moz-landing-system : lando
Only gtk returns failure ever, and nobody checks the result anyway.
Use an enum class so that it's clear from the caller what it means.
Differential Revision: https://phabricator.services.mozilla.com/D32353
--HG--
extra : moz-landing-system : lando
- Rename recent WindowBackBuffer class to WindowBackBufferShm to clearly state that it uses Shm memory to store the pixel buffer.
- Implement WindowBackBufferDMABuf which stores pixel data in GPU memory in WaylandDMABufSurface object.
- Use WaylandDMABufSurface as a wayland backend when DMABuf is available and gfx.wayland_dmabuf_backend.enabled is set.
- Implement WindowImageSurface which temporary stores front buffer pixel data. It's used when front buffer is used by compositor and we want to draw.
Instead of the front/back buffer flip and read-back data from front buffer, don't flip, store the drawing and draw the pixels when compositor
releases the front buffer.
Differential Revision: https://phabricator.services.mozilla.com/D32635
--HG--
extra : moz-landing-system : lando
Ship Wayland DMABuf protocol headers. This is a non-offical extension thus it's missing in stable wayland headers.
Differential Revision: https://phabricator.services.mozilla.com/D32632
--HG--
extra : moz-landing-system : lando
Recently we track and position all popups on Wayland which leads to
wrong placement when parent popup window is hidden.
In this patch we use plain gtk_window_move() for hidden popups and
we don't track them so they can't be used as a parent window.
Also implement nsWindow::HideWaylandPopupAndAllChildren() to clearly
hide a popup window with and its children windows.
Differential Revision: https://phabricator.services.mozilla.com/D31056
--HG--
extra : moz-landing-system : lando
This fix wrong rendering of radio and checkbox indicators in menus by
correcting the dimensions acording to used theme.
Differential Revision: https://phabricator.services.mozilla.com/D32316
--HG--
extra : moz-landing-system : lando
If OnKeysChanged was called after keyboard_handle_keymap, then our newly configured keymap would be immediately cleared again. In order to avoid such scenario, use only keyboard_handle_keymap on wayland.
Differential Revision: https://phabricator.services.mozilla.com/D32599
--HG--
extra : moz-landing-system : lando
Use standard Gtk/Gnome way to set Firefox Gtk theme. Gtk theme of web content can be still configured
by widget.content.allow-gtk-dark-theme and widget.content.gtk-theme-override.
Depends on D29823
Differential Revision: https://phabricator.services.mozilla.com/D30919
--HG--
extra : moz-landing-system : lando
We previously disabled system dark themes for Firefox chrome and content by gtk-application-prefer-dark-theme settings.
That option is no longer preferred by gnome project and was removed from tweaks tools. Theme makers are encouraged to use
a different name for the dark theme variants, like Adwaita-dark, Yaru-dark and so on. This option also does not
work when the GTK theme is missing the light variant completely.
To address that, this patch implements heuristics based on https://www.w3.org/TR/AERT/#color-contrast
to check if the system GTK theme has good contrast/visibility with default HTML colors
(white background and black text).
If widget.content.gtk-theme-override is empty and the system theme fails the test with gtk-application-prefer-dark-theme set to false, then Adwaita:light theme is used.
This patch was tested with some distro default light themes (Ambiance, Radiance, Yaru - Ubuntu, Arc - KDE, Menta - MATE)
and dark/light themes are recognized correctly.
Differential Revision: https://phabricator.services.mozilla.com/D29823
--HG--
extra : moz-landing-system : lando
This should be an idempotent patch. The way to come up with this patch has been:
* Run the first script attached to the bug and pipe it to xclip, then paste it
in color.rs
* Add the relevant #[derive] annotations and remove the color.mako.rs
definition.
* Reorder the values to match the ColorID definition, on which some widget
prefs and caching stuff relies on.
* Manually port some documentation from nsLookAndFeel.h
* Run `rg 'eColorID_' | cut -d : -f 1 | sort | uniq >files`
* Run the second script attached to the bug.
* Manually fix usage of `LAST_COLOR` (adding the `End` variant), and adding
casts to integer as needed.
* Add an static assert so that people remember to update the prefs, rather than
a comment on the definition :)
Differential Revision: https://phabricator.services.mozilla.com/D32610
--HG--
extra : moz-landing-system : lando
- Follow Gtk and get theme button text color directly from "button" CSS node instead of "button label"
- Provide new -moz-gtk-buttonactivetext color for active/pressed button text color
- Replace ButtonText color with -moz-gtk-buttonactivetext when it's appropriate
Differential Revision: https://phabricator.services.mozilla.com/D30566
--HG--
extra : moz-landing-system : lando
In order to show all popups on Wayland we need to set popup parent runtime for popups which don't have
fixed parent. For instance popup menus (fired after right button mouse click) can be issued on top of another popup
and we need to follow that connection on Wayland.
We track all open (active) popups to:
- close all visible tooltip windows when we're going to open another tooltip
- close concurrent popup on the same level when a new one is about to open
- get latest active popup as a parent for a new tooltip windows
- get latest active popup as a parent for a new popup menu without fixed parent
Differential Revision: https://phabricator.services.mozilla.com/D29348
--HG--
extra : moz-landing-system : lando
This patch makes widget use `mozilla::PresShell` directly rather than via
`nsIPresShell` and changes some pure virtual methods of `nsIPresShell` which
called by widget to `mozilla::PresShell`'s non-virtual methods.
Differential Revision: https://phabricator.services.mozilla.com/D29112
--HG--
extra : moz-landing-system : lando