Use widget.wayland.test-workarounds.enabled pref to apply Wayland focus workaround - hide/show nsWindow.
Delay nsWindow::Show() operation to avoid Gtk merge both operations to one which may result to no-op.
Depends on D111600
Differential Revision: https://phabricator.services.mozilla.com/D111601
Using `dlsym` for `gdk_wayland_display_get_type` is a cleaner solution
to bug 1696319, allowing running with a GTK that lacks the Wayland
backend.
Also adds a symmetric implementation for `gdk_x11_display_get_type`,
which should help running without X11.
Differential Revision: https://phabricator.services.mozilla.com/D107406
Using `dlsym` for `gdk_wayland_display_get_type` is a cleaner solution
to bug 1696319, allowing running with a GTK that lacks the Wayland
backend.
Also adds a symmetric implementation for `gdk_x11_display_get_type`,
which should help running without X11.
Differential Revision: https://phabricator.services.mozilla.com/D107406
This is a workaround for https://gitlab.gnome.org/GNOME/mutter/-/issues/1658
Wayland compositor sometimes fails to send wl_data_source::cancelled() so we don't get info that the D&D is finished
and it's still marked as active internally which preverts Firefox to do any further D&D operation.
In the patch we detect such scenario and reset internal D&D state.
Differential Revision: https://phabricator.services.mozilla.com/D106266
This is a workaround for https://gitlab.gnome.org/GNOME/mutter/-/issues/1658
Wayland compositor sometimes fails to send wl_data_source::cancelled() so we don't get info that the D&D is finished
and it's still marked as active internally which preverts Firefox to do any further D&D operation.
In the patch we detect such scenario and reset internal D&D state.
Differential Revision: https://phabricator.services.mozilla.com/D106266
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.
Differential Revision: https://phabricator.services.mozilla.com/D105473
It caused us substantial confusion investigating this bug under the belief that
StartRemoteDrawingInRegion may have been modifying the dirty region. None of our
existing widget code anymore uses the API in this way, so it makes sense to just
force this dirty region to be const so that we no longer support the assumption
and alleviate confusion in the future about how our widget code actually behaves.
Depends on D106246
Differential Revision: https://phabricator.services.mozilla.com/D106247
Currently, it takes a raw native message value, but it makes JS content too
complicated. And on Linux, it cannot synthesize non-primary button events
because GDK has only button press and release messages which dont' include
mouse button information.
For solving these problems, this patch creates a new abstract native message
as `nsIWidget::NativeMouseMessage` and makes each widget converts it to
a platform native message.
Additionally, this patch adds an argument to make it possible its callers
to specify pressing or releasing mouse button with a DOM mouse button value.
Note that the following patch adds new argument to
`synthesizeNativeEventMouse*` for mochitests and which will be tested by
new tests.
Differential Revision: https://phabricator.services.mozilla.com/D105763
Surprisingly, they don't take modifiers, and
`nsIWidget::SynthesizeNativeMouseEvent()` which are implementations of
`nsIDOMWindowUtils::SendNativeMouseEvent()` treat given modifier flags
are native's ones, and handle modifiers only on macOS. Therefore, this
patch makes them handle native modifiers of Gecko.
Unfortunately, I'm not so familiar with Android API, and in the short
term, I don't need the support on Android. Therefore, this patch just
adds a TODO comment on Android widget.
Additionally, we don't have a simple way to set modifier only while
posting a mouse input on Windows too. It requires complicated code.
Therefore, I don't add the support for it on Windows too.
Differential Revision: https://phabricator.services.mozilla.com/D105758
We need to trigger popupFrame->SetPopupPosition when we get size change from the Wayland popup
positioner - ie. window does not fit the screen. That will ensure that the
popup is cropped to fit the screen.
This patch also keeps the NativeMoveResizeWaylandPopupCallback connected to make sure
that the subsequent nsWindow::Show calls places the window correctly (when for
example the main window is moved to the screen edge - the menus can be flipped - and
we need to update the nsView for that to ensure the submenus are correctly placed.
We also use anchorRectAppUnits.ToNearestPixels to partially mirror behaviour of
nsView::CalcWidgetBounds.
Differential Revision: https://phabricator.services.mozilla.com/D105507
From GTK 3.24.25 on we have a new API that allows us to savely apply
opaque regions to our own surfaces without risking to freeze GDK.
Differential Revision: https://phabricator.services.mozilla.com/D102835
There are no code changes, only #include changes.
It was a fairly mechanical process: Search for all "AUTO_PROFILER_LABEL", and in each file, if only labels are used, convert "GeckoProfiler.h" into "ProfilerLabels.h" (or just add that last one where needed).
In some files, there were also some marker calls but no other profiler-related calls, in these cases "GeckoProfiler.h" was replaced with both "ProfilerLabels.h" and "ProfilerMarkers.h", which still helps in reducing the use of the all-encompassing "GeckoProfiler.h".
Differential Revision: https://phabricator.services.mozilla.com/D104588
- Recently we use size allocation event to create wl_subsurface of MozContainer. Unfortunately size allocation event
is not called when a window is opened second time, as its size is already set. Use map_event to create
wl_subsurface in this case.
Differential Revision: https://phabricator.services.mozilla.com/D104551
- Try to set subsurface offset even if we mozcontainer size allocation is not finished. Use window decoration size for it.
- Add more logging to mozcontainer code.
Depends on D104549
Differential Revision: https://phabricator.services.mozilla.com/D104550
- Recently we use size allocation event to create wl_subsurface of MozContainer. Unfortunately size allocation event
is not called when a window is opened second time, as its size is already set. Use map_event to create
wl_subsurface in this case.
Depends on D104550
Differential Revision: https://phabricator.services.mozilla.com/D104551
- Try to set subsurface offset even if we mozcontainer size allocation is not finished. Use window decoration size for it.
- Add more logging to mozcontainer code.
Depends on D104549
Differential Revision: https://phabricator.services.mozilla.com/D104550
Currently, this feature is implemented only on Linux and macOS (see also
bug 1077515 and bug 1301497), and the code is really similar each other.
Additionally, it always tries to query selection to check whether the caret is
in vertical content or not if arrow keys are pressed. For avoiding a lot of
query, this patch makes `TextEventDispatcher` cache writing mode at every
selection change notification. However, unfortunately, it's not available when
non-editable content has focus, but it should be out of scope of this bug since
it requires a lot of changes.
Anyway, with this patch, we can write a mochitest only on Linux and macOS.
The following patch adds a test for this as a fix of bug 1103374.
Differential Revision: https://phabricator.services.mozilla.com/D102881