Title: [292064] trunk
Revision
292064
Author
[email protected]
Date
2022-03-29 13:24:48 -0700 (Tue, 29 Mar 2022)

Log Message

[LibWPE] Guard libxkbcommon code with WPE_ENABLE_XKB
https://bugs.webkit.org/show_bug.cgi?id=238510

Reviewed by Adrian Perez de Castro.

.:

Post v1.12.0 introduces the WPE_ENABLE_XKB definition to libwpe. For v1.12.0 and earlier
the define is added to the WPE::libwpe target's compile options. For later versions the
pkg-config for the library will determine the presence of this definition.

* Source/cmake/FindWPE.cmake:

Source/WebKit:

Guard libwpe xkb code with WPE_ENABLE_XKB.

* UIProcess/Automation/libwpe/WebAutomationSessionLibWPE.cpp:
(WebKit::doKeyStrokeEvent):

Tools:

Guard libwpe xkb code with WPE_ENABLE_XKB.

* WebKitTestRunner/libwpe/EventSenderProxyLibWPE.cpp:
(WTR::EventSenderProxy::keyDown):

Modified Paths

Diff

Modified: trunk/ChangeLog (292063 => 292064)


--- trunk/ChangeLog	2022-03-29 20:22:26 UTC (rev 292063)
+++ trunk/ChangeLog	2022-03-29 20:24:48 UTC (rev 292064)
@@ -1,3 +1,16 @@
+2022-03-29  Don Olmstead  <[email protected]>
+
+        [LibWPE] Guard libxkbcommon code with WPE_ENABLE_XKB
+        https://bugs.webkit.org/show_bug.cgi?id=238510
+
+        Reviewed by Adrian Perez de Castro.
+
+        Post v1.12.0 introduces the WPE_ENABLE_XKB definition to libwpe. For v1.12.0 and earlier
+        the define is added to the WPE::libwpe target's compile options. For later versions the
+        pkg-config for the library will determine the presence of this definition.
+
+        * Source/cmake/FindWPE.cmake:
+
 2022-03-26  Aakash Jain  <[email protected]>
 
         Update my github username.

Modified: trunk/Source/WebKit/ChangeLog (292063 => 292064)


--- trunk/Source/WebKit/ChangeLog	2022-03-29 20:22:26 UTC (rev 292063)
+++ trunk/Source/WebKit/ChangeLog	2022-03-29 20:24:48 UTC (rev 292064)
@@ -1,3 +1,15 @@
+2022-03-29  Don Olmstead  <[email protected]>
+
+        [LibWPE] Guard libxkbcommon code with WPE_ENABLE_XKB
+        https://bugs.webkit.org/show_bug.cgi?id=238510
+
+        Reviewed by Adrian Perez de Castro.
+
+        Guard libwpe xkb code with WPE_ENABLE_XKB.
+
+        * UIProcess/Automation/libwpe/WebAutomationSessionLibWPE.cpp:
+        (WebKit::doKeyStrokeEvent):
+
 2022-03-29  Sihui Liu  <[email protected]>
 
         Unreviewed test fix after r292024.

Modified: trunk/Source/WebKit/UIProcess/Automation/libwpe/WebAutomationSessionLibWPE.cpp (292063 => 292064)


--- trunk/Source/WebKit/UIProcess/Automation/libwpe/WebAutomationSessionLibWPE.cpp	2022-03-29 20:22:26 UTC (rev 292063)
+++ trunk/Source/WebKit/UIProcess/Automation/libwpe/WebAutomationSessionLibWPE.cpp	2022-03-29 20:24:48 UTC (rev 292064)
@@ -28,6 +28,7 @@
 
 #include "WebAutomationSessionMacros.h"
 #include "WebPageProxy.h"
+#include <wpe/wpe.h>
 
 namespace WebKit {
 using namespace WebCore;
@@ -147,12 +148,18 @@
 #if ENABLE(WEBDRIVER_KEYBOARD_INTERACTIONS)
 static void doKeyStrokeEvent(struct wpe_view_backend* viewBackend, bool pressed, uint32_t keyCode, uint32_t modifiers, bool doReleaseAfterPress = false)
 {
+#if defined(WPE_ENABLE_XKB) && WPE_ENABLE_XKB
     struct wpe_input_xkb_keymap_entry* entries;
     uint32_t entriesCount;
     wpe_input_xkb_context_get_entries_for_key_code(wpe_input_xkb_context_get_default(), keyCode, &entries, &entriesCount);
     struct wpe_input_keyboard_event event = { 0, keyCode, entriesCount ? entries[0].hardware_key_code : 0, pressed, modifiers };
+#else
+    struct wpe_input_keyboard_event event = { 0, keyCode, 0, pressed, modifiers };
+#endif
     wpe_view_backend_dispatch_keyboard_event(viewBackend, &event);
+#if defined(WPE_ENABLE_XKB) && WPE_ENABLE_XKB
     free(entries);
+#endif
 
     if (doReleaseAfterPress) {
         ASSERT(pressed);

Modified: trunk/Source/cmake/FindWPE.cmake (292063 => 292064)


--- trunk/Source/cmake/FindWPE.cmake	2022-03-29 20:22:26 UTC (rev 292063)
+++ trunk/Source/cmake/FindWPE.cmake	2022-03-29 20:24:48 UTC (rev 292064)
@@ -85,6 +85,11 @@
     endif ()
 endif ()
 
+# Version 1.12.0 is the last release where XKB support was always present
+if (WPE_VERSION VERSION_LESS_EQUAL 1.12.0)
+    list(APPEND WPE_COMPILE_OPTIONS -DWPE_ENABLE_XKB=1)
+endif ()
+
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(WPE
     FOUND_VAR WPE_FOUND

Modified: trunk/Tools/ChangeLog (292063 => 292064)


--- trunk/Tools/ChangeLog	2022-03-29 20:22:26 UTC (rev 292063)
+++ trunk/Tools/ChangeLog	2022-03-29 20:24:48 UTC (rev 292064)
@@ -1,3 +1,15 @@
+2022-03-29  Don Olmstead  <[email protected]>
+
+        [LibWPE] Guard libxkbcommon code with WPE_ENABLE_XKB
+        https://bugs.webkit.org/show_bug.cgi?id=238510
+
+        Reviewed by Adrian Perez de Castro.
+
+        Guard libwpe xkb code with WPE_ENABLE_XKB.
+
+        * WebKitTestRunner/libwpe/EventSenderProxyLibWPE.cpp:
+        (WTR::EventSenderProxy::keyDown):
+
 2022-03-29  Jonathan Bedard  <[email protected]>
 
         [Merge-Queue] Canonicalize commit

Modified: trunk/Tools/WebKitTestRunner/libwpe/EventSenderProxyLibWPE.cpp (292063 => 292064)


--- trunk/Tools/WebKitTestRunner/libwpe/EventSenderProxyLibWPE.cpp	2022-03-29 20:22:26 UTC (rev 292063)
+++ trunk/Tools/WebKitTestRunner/libwpe/EventSenderProxyLibWPE.cpp	2022-03-29 20:24:48 UTC (rev 292064)
@@ -317,14 +317,20 @@
 {
     uint32_t modifiers = wkEventModifiersToWPE(wkModifiers);
     uint32_t keySym = wpeKeySymForKeyRef(keyRef, location, &modifiers);
+#if defined(WPE_ENABLE_XKB) && WPE_ENABLE_XKB
     struct wpe_input_xkb_keymap_entry* entries;
     uint32_t entriesCount;
     wpe_input_xkb_context_get_entries_for_key_code(wpe_input_xkb_context_get_default(), keySym, &entries, &entriesCount);
     struct wpe_input_keyboard_event event { secToMsTimestamp(m_time), keySym, entriesCount ? entries[0].hardware_key_code : 0, true, modifiers };
+#else
+    struct wpe_input_keyboard_event event { secToMsTimestamp(m_time), keySym, 0, true, modifiers };
+#endif
     wpe_view_backend_dispatch_keyboard_event(viewBackend(*m_testController), &event);
     event.pressed = false;
     wpe_view_backend_dispatch_keyboard_event(viewBackend(*m_testController), &event);
+#if defined(WPE_ENABLE_XKB) && WPE_ENABLE_XKB
     free(entries);
+#endif
 }
 
 void EventSenderProxy::rawKeyDown(WKStringRef key, WKEventModifiers modifiers, unsigned keyLocation)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to