Title: [227519] trunk/Source/WebKit
Revision
227519
Author
mcatanz...@igalia.com
Date
2018-01-24 07:25:14 -0800 (Wed, 24 Jan 2018)

Log Message

[GTK] Use GDK_EVENT_PROPAGATE and GDK_EVENT_STOP in WebKitWebViewBase.cpp
https://bugs.webkit.org/show_bug.cgi?id=182031

Reviewed by Carlos Garcia Campos.

No functional changes, this just replaces TRUE with GDK_EVENT_STOP and FALSE with
GDK_EVENT_PROPAGATE, to improve readability.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseKeyPressEvent):
(webkitWebViewBaseKeyReleaseEvent):
(webkitWebViewBaseButtonPressEvent):
(webkitWebViewBaseButtonReleaseEvent):
(webkitWebViewBaseScrollEvent):
(webkitWebViewBaseMotionNotifyEvent):
(webkitWebViewBaseCrossingNotifyEvent):
(webkitWebViewBaseTouchEvent):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (227518 => 227519)


--- trunk/Source/WebKit/ChangeLog	2018-01-24 15:04:34 UTC (rev 227518)
+++ trunk/Source/WebKit/ChangeLog	2018-01-24 15:25:14 UTC (rev 227519)
@@ -1,3 +1,23 @@
+2018-01-24  Michael Catanzaro  <mcatanz...@igalia.com>
+
+        [GTK] Use GDK_EVENT_PROPAGATE and GDK_EVENT_STOP in WebKitWebViewBase.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=182031
+
+        Reviewed by Carlos Garcia Campos.
+
+        No functional changes, this just replaces TRUE with GDK_EVENT_STOP and FALSE with
+        GDK_EVENT_PROPAGATE, to improve readability.
+
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewBaseKeyPressEvent):
+        (webkitWebViewBaseKeyReleaseEvent):
+        (webkitWebViewBaseButtonPressEvent):
+        (webkitWebViewBaseButtonReleaseEvent):
+        (webkitWebViewBaseScrollEvent):
+        (webkitWebViewBaseMotionNotifyEvent):
+        (webkitWebViewBaseCrossingNotifyEvent):
+        (webkitWebViewBaseTouchEvent):
+
 2018-01-23  Eric Carlson  <eric.carl...@apple.com>
 
         Resign NowPlaying status when no media element is eligible

Modified: trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp (227518 => 227519)


--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp	2018-01-24 15:04:34 UTC (rev 227518)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp	2018-01-24 15:25:14 UTC (rev 227519)
@@ -681,7 +681,7 @@
         auto& preferences = priv->pageProxy->preferences();
         preferences.setResourceUsageOverlayVisible(!preferences.resourceUsageOverlayVisible());
         priv->shouldForwardNextKeyEvent = FALSE;
-        return TRUE;
+        return GDK_EVENT_STOP;
     }
 #endif
 
@@ -695,7 +695,7 @@
         case GDK_KEY_f:
         case GDK_KEY_F:
             priv->pageProxy->fullScreenManager()->requestExitFullScreen();
-            return TRUE;
+            return GDK_EVENT_STOP;
         default:
             break;
         }
@@ -718,7 +718,7 @@
             !compositionResults.compositionUpdated() ? priv->keyBindingTranslator.commandsForKeyEvent(&event->key) : Vector<String>()));
     });
 
-    return TRUE;
+    return GDK_EVENT_STOP;
 }
 
 static gboolean webkitWebViewBaseKeyReleaseEvent(GtkWidget* widget, GdkEventKey* keyEvent)
@@ -737,7 +737,7 @@
         priv->pageProxy->handleKeyboardEvent(NativeWebKeyboardEvent(event.get(), compositionResults, faked, { }));
     });
 
-    return TRUE;
+    return GDK_EVENT_STOP;
 }
 
 static gboolean webkitWebViewBaseButtonPressEvent(GtkWidget* widget, GdkEventButton* buttonEvent)
@@ -746,7 +746,7 @@
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
 
     if (priv->authenticationDialog)
-        return TRUE;
+        return GDK_EVENT_STOP;
 
     gtk_widget_grab_focus(widget);
 
@@ -759,7 +759,7 @@
     // are generated.
     GUniquePtr<GdkEvent> nextEvent(gdk_event_peek());
     if (nextEvent && (nextEvent->any.type == GDK_2BUTTON_PRESS || nextEvent->any.type == GDK_3BUTTON_PRESS))
-        return TRUE;
+        return GDK_EVENT_STOP;
 
     // If it's a right click event save it as a possible context menu event.
     if (buttonEvent->button == 3)
@@ -767,7 +767,7 @@
 
     priv->pageProxy->handleMouseEvent(NativeWebMouseEvent(reinterpret_cast<GdkEvent*>(buttonEvent),
         priv->clickCounter.currentClickCountForGdkButtonEvent(buttonEvent)));
-    return TRUE;
+    return GDK_EVENT_STOP;
 }
 
 static gboolean webkitWebViewBaseButtonReleaseEvent(GtkWidget* widget, GdkEventButton* event)
@@ -776,12 +776,12 @@
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
 
     if (priv->authenticationDialog)
-        return TRUE;
+        return GDK_EVENT_STOP;
 
     gtk_widget_grab_focus(widget);
     priv->pageProxy->handleMouseEvent(NativeWebMouseEvent(reinterpret_cast<GdkEvent*>(event), 0 /* currentClickCount */));
 
-    return TRUE;
+    return GDK_EVENT_STOP;
 }
 
 static gboolean webkitWebViewBaseScrollEvent(GtkWidget* widget, GdkEventScroll* event)
@@ -790,14 +790,14 @@
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
 
     if (std::exchange(priv->shouldForwardNextWheelEvent, false))
-        return FALSE;
+        return GDK_EVENT_PROPAGATE;
 
     if (priv->authenticationDialog)
-        return FALSE;
+        return GDK_EVENT_PROPAGATE;
 
     priv->pageProxy->handleWheelEvent(NativeWebWheelEvent(reinterpret_cast<GdkEvent*>(event)));
 
-    return TRUE;
+    return GDK_EVENT_STOP;
 }
 
 static gboolean webkitWebViewBasePopupMenu(GtkWidget* widget)
@@ -821,12 +821,12 @@
 
     if (priv->authenticationDialog) {
         auto* widgetClass = GTK_WIDGET_CLASS(webkit_web_view_base_parent_class);
-        return widgetClass->motion_notify_event ? widgetClass->motion_notify_event(widget, event) : FALSE;
+        return widgetClass->motion_notify_event ? widgetClass->motion_notify_event(widget, event) : GDK_EVENT_PROPAGATE;
     }
 
     priv->pageProxy->handleMouseEvent(NativeWebMouseEvent(reinterpret_cast<GdkEvent*>(event), 0 /* currentClickCount */));
 
-    return FALSE;
+    return GDK_EVENT_PROPAGATE;
 }
 
 static gboolean webkitWebViewBaseCrossingNotifyEvent(GtkWidget* widget, GdkEventCrossing* crosssingEvent)
@@ -835,7 +835,7 @@
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
 
     if (priv->authenticationDialog)
-        return FALSE;
+        return GDK_EVENT_PROPAGATE;
 
     // In the case of crossing events, it's very important the actual coordinates the WebProcess receives, because once the mouse leaves
     // the web view, the WebProcess won't receive more events until the mouse enters again in the web view. So, if the coordinates of the leave
@@ -867,7 +867,7 @@
 
     priv->pageProxy->handleMouseEvent(NativeWebMouseEvent(copiedEvent ? copiedEvent.get() : event, 0 /* currentClickCount */));
 
-    return FALSE;
+    return GDK_EVENT_PROPAGATE;
 }
 
 #if ENABLE(TOUCH_EVENTS)
@@ -919,7 +919,7 @@
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
 
     if (priv->authenticationDialog)
-        return TRUE;
+        return GDK_EVENT_STOP;
 
     GdkEvent* touchEvent = reinterpret_cast<GdkEvent*>(event);
     uint32_t sequence = GPOINTER_TO_UINT(gdk_event_get_event_sequence(touchEvent));
@@ -949,7 +949,7 @@
     webkitWebViewBaseGetTouchPointsForEvent(webViewBase, touchEvent, touchPoints);
     priv->pageProxy->handleTouchEvent(NativeWebTouchEvent(reinterpret_cast<GdkEvent*>(event), WTFMove(touchPoints)));
 
-    return TRUE;
+    return GDK_EVENT_STOP;
 }
 #endif // ENABLE(TOUCH_EVENTS)
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to