Skip to content

Commit 484b13a

Browse files
committed
Bug 1955112 [Wayland] Terminate buggy unfinished D&D operation as DragDrop r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D251691
1 parent 676f178 commit 484b13a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

widget/gtk/nsWindow.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,6 @@ static bool IsPenEvent(GdkEvent* aEvent, bool* isEraser) {
740740
*isEraser = true;
741741
return true;
742742
} else {
743-
744743
#ifdef MOZ_X11
745744
// Workaround : When using Xwayland, pens are reported as
746745
// GDK_SOURCE_TOUCHSCREEN If eSource is GDK_SOURCE_TOUCHSCREEN and the
@@ -899,7 +898,7 @@ bool nsWindow::ToplevelUsesCSD() const {
899898
#ifdef MOZ_WAYLAND
900899
if (GdkIsWaylandDisplay()) {
901900
static auto sGdkWaylandDisplayPrefersSsd =
902-
(gboolean (*)(const GdkWaylandDisplay*))dlsym(
901+
(gboolean(*)(const GdkWaylandDisplay*))dlsym(
903902
RTLD_DEFAULT, "gdk_wayland_display_prefers_ssd");
904903
// NOTE(emilio): Not using GDK_WAYLAND_DISPLAY to avoid bug 1946088.
905904
return !sGdkWaylandDisplayPrefersSsd ||
@@ -5082,7 +5081,7 @@ void nsWindow::OnScrollEvent(GdkEventScroll* aEvent) {
50825081
if (StaticPrefs::apz_gtk_pangesture_enabled() &&
50835082
gtk_check_version(3, 20, 0) == nullptr) {
50845083
static auto sGdkEventIsScrollStopEvent =
5085-
(gboolean (*)(const GdkEvent*))dlsym(
5084+
(gboolean(*)(const GdkEvent*))dlsym(
50865085
RTLD_DEFAULT, "gdk_event_is_scroll_stop_event");
50875086

50885087
LOG("[%d] pan smooth event dx=%f dy=%f inprogress=%d\n", aEvent->time,
@@ -7414,11 +7413,16 @@ MOZ_CAN_RUN_SCRIPT static void WaylandDragWorkaround(nsWindow* aWindow,
74147413

74157414
buttonPressCountWithDrag++;
74167415
if (buttonPressCountWithDrag > 1) {
7416+
LOGDRAG(
7417+
"WaylandDragWorkaround applied [buttonPressCountWithDrag %d], quit D&D "
7418+
"session",
7419+
buttonPressCountWithDrag);
7420+
74177421
NS_WARNING(
74187422
"Quit unfinished Wayland Drag and Drop operation. Buggy Wayland "
74197423
"compositor?");
74207424
buttonPressCountWithDrag = 0;
7421-
currentDragSession->EndDragSession(false, 0);
7425+
currentDragSession->EndDragSession(true, 0);
74227426
}
74237427
}
74247428

0 commit comments

Comments
 (0)