diff --git a/README.md b/README.md index fec01e4..6acd30f 100644 --- a/README.md +++ b/README.md @@ -125,10 +125,10 @@ CXX=arm-poky-linux-gnueabi-g++ ... ... ``` -## Running Cog browser: +## Running WPE launcher: -* Cog with FDO backend in Weston: `/usr/bin/cog-fdo-exported-wayland https://wpewebkit.org` -* Cog with DRM backend directly in framebuffer: `/usr/bin/cog-drm-kill-weston https://wpewebkit.org` +* WPE with FDO backend in Weston: `/usr/bin/wpe-exported-wayland https://wpewebkit.org` +* WPE with DRM backend directly in framebuffer: `export WPE_DISPLAY="wpe-display-drm"; /usr/bin/wpe-exported-wayland https://wpewebkit.org` All this commands will execute the browsers as `weston` user. diff --git a/recipes-browser/cog/cog_0.18.%.bbappend b/recipes-browser/cog/cog_0.18.%.bbappend deleted file mode 100644 index 6d3016c..0000000 --- a/recipes-browser/cog/cog_0.18.%.bbappend +++ /dev/null @@ -1,42 +0,0 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/files:" -FILESEXTRAPATHS:prepend:class-devupstream := "${THISDIR}/files:" - -SRC_URI:class-devupstream = "git://github.com/Igalia/cog.git;protocol=https;branch=master" -SRCREV:class-devupstream = "${AUTOREV}" - -SRC_URI += " \ - file://cog-drm \ - file://cog-drm-kill-weston \ - file://cog-fdo \ - file://cog-fdo-ctl \ - file://cog-fdo-exported-wayland \ -" - -SRC_URI:class-devupstream += " \ - file://cog-drm \ - file://cog-drm-kill-weston \ - file://cog-fdo \ - file://cog-fdo-ctl \ - file://cog-fdo-exported-wayland \ - file://0001-wl-Add-safe-guards-for-touch-and-pointer-events.patch \ -" - -do_install:append () { - install -d ${D}/${bindir}/ - install -m 755 ${WORKDIR}/cog-drm ${D}/${bindir}/cog-drm - install -m 755 ${WORKDIR}/cog-drm-kill-weston ${D}/${bindir}/cog-drm-kill-weston - install -m 755 ${WORKDIR}/cog-fdo ${D}/${bindir}/cog-fdo - install -m 755 ${WORKDIR}/cog-fdo-ctl ${D}/${bindir}/cog-fdo-ctl - install -m 755 ${WORKDIR}/cog-fdo-exported-wayland ${D}/${bindir}/cog-fdo-exported-wayland -} - -PV:class-devupstream = "trunk" - -RDEPENDS:${PN} += "bash" -RDEPENDS:${PN}:class-devupstream += "bash" - -PACKAGECONFIG:append = " gtk4" - -# Required for future 0.19 -DEPENDS:append:class-devupstream = " libportal" - diff --git a/recipes-browser/cog/files/0001-wl-Add-safe-guards-for-touch-and-pointer-events.patch b/recipes-browser/cog/files/0001-wl-Add-safe-guards-for-touch-and-pointer-events.patch deleted file mode 100644 index c601cf2..0000000 --- a/recipes-browser/cog/files/0001-wl-Add-safe-guards-for-touch-and-pointer-events.patch +++ /dev/null @@ -1,95 +0,0 @@ -From bd0a410395327c2350ed97d4fd962d0203b94777 Mon Sep 17 00:00:00 2001 -From: Pablo Saavedra -Date: Wed, 15 Nov 2023 12:10:59 +0100 -Subject: [PATCH] wl: Add safe-guards for touch and pointer events - -In some unstable compositors it could be posible these 2 cases: - -* to receive touch up/motion events inmediatelly after a touch up - (touch deinit the touch target). -* to receive pointer motion/leave event inmediatelly after a touch - leave (deinit the touch target). - -%% original patch: 0002-wl-Add-safe-guards-for-touch-and-pointer-events.patch ---- - platform/wayland/cog-platform-wl.c | 36 +++++++++++++++++++++++++++++- - 1 file changed, 35 insertions(+), 1 deletion(-) - -diff --git a/platform/wayland/cog-platform-wl.c b/platform/wayland/cog-platform-wl.c -index a6e3904..8c20c10 100644 ---- a/platform/wayland/cog-platform-wl.c -+++ b/platform/wayland/cog-platform-wl.c -@@ -271,8 +271,17 @@ pointer_on_enter(void *data, - static void - pointer_on_leave(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface) - { -+ if (data == NULL || pointer == NULL) { -+ return; -+ } -+ - CogWlSeat *seat = data; - -+ if (seat->pointer_target == NULL || seat->pointer.surface == NULL) { -+ return; -+ } -+ -+ - if (pointer != seat->pointer_obj) { - g_critical("%s: Got pointer %p, expected %p.", G_STRFUNC, pointer, seat->pointer_obj); - return; -@@ -286,7 +295,16 @@ pointer_on_leave(void *data, struct wl_pointer *pointer, uint32_t serial, struct - static void - pointer_on_motion(void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t fixed_x, wl_fixed_t fixed_y) - { -- CogWlSeat *seat = data; -+ if (data == NULL || pointer == NULL) { -+ return; -+ } -+ -+ CogWlSeat *seat = data; -+ -+ if (seat->pointer_target == NULL || seat->pointer.surface == NULL) { -+ return; -+ } -+ - CogWlDisplay *display = seat->display; - - if (pointer != seat->pointer_obj) { -@@ -783,8 +801,16 @@ touch_on_down(void *data, - static void - touch_on_up(void *data, struct wl_touch *touch, uint32_t serial, uint32_t time, int32_t id) - { -+ if (data == NULL || touch == NULL) { -+ return; -+ } -+ - CogWlSeat *seat = data; - -+ if (seat->touch_target == NULL || seat->touch.surface == NULL) { -+ return; -+ } -+ - if (touch != seat->touch_obj) { - g_critical("%s: Got touch %p, expected %p.", G_STRFUNC, touch, seat->touch_obj); - return; -@@ -833,9 +859,17 @@ touch_on_up(void *data, struct wl_touch *touch, uint32_t serial, uint32_t time, - static void - touch_on_motion(void *data, struct wl_touch *touch, uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y) - { -+ if (data == NULL || touch == NULL) { -+ return; -+ } -+ - CogWlSeat *seat = data; - CogWlDisplay *display = seat->display; - -+ if (seat->touch_target == NULL || seat->touch.surface == NULL) { -+ return; -+ } -+ - if (touch != seat->touch_obj) { - g_critical("%s: Got touch %p, expected %p.", G_STRFUNC, touch, seat->touch_obj); - return; --- -2.34.1 - diff --git a/recipes-browser/cog/files/cog-drm b/recipes-browser/cog/files/cog-drm deleted file mode 100755 index 18f4c3b..0000000 --- a/recipes-browser/cog/files/cog-drm +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/bash - -/usr/bin/cog -P drm "$@" diff --git a/recipes-browser/cog/files/cog-drm-kill-weston b/recipes-browser/cog/files/cog-drm-kill-weston deleted file mode 100755 index e805150..0000000 --- a/recipes-browser/cog/files/cog-drm-kill-weston +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -systemctl stop weston.service -su - bot /usr/bin/cog-drm "$1" diff --git a/recipes-browser/cog/files/cog-fdo b/recipes-browser/cog/files/cog-fdo deleted file mode 100755 index dd72662..0000000 --- a/recipes-browser/cog/files/cog-fdo +++ /dev/null @@ -1,30 +0,0 @@ -#! /bin/bash - -# export WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1 -# export GST_PLUGIN_FEATURE_RANK="avdec_av1:0" -# export GST_DEBUG_DUMP_DOT_DIR=/tmp/gst-out/ -# mkdir -p /tmp/gst-out -# chmod 777 /tmp/gst-out - -# WebKitDMABufVideoSink sink that is able to accept decode -# dmabuf or raw data in a range of RGB-like or YUV formats. -# Bug: https://bugs.webkit.org/show_bug.cgi?id=279819 -export WEBKIT_GST_DMABUF_SINK_ENABLED=1 - -export GST_PLUGIN_FEATURE_RANK="avdec_av1:0" - -params=() - -for arg in "$@"; do - if [[ $arg == "--maximized" ]]; then - COG_PLATFORM_WL_VIEW_WIDTH=$(journalctl -b | grep weston | grep current | cut -f 1 -d '@' | awk '{ print $6 }' | cut -d 'x' -f 1 | tail -n 1) - export COG_PLATFORM_WL_VIEW_WIDTH - - COG_PLATFORM_WL_VIEW_HEIGHT=$(journalctl -b | grep weston | grep current | cut -f 1 -d '@' | awk '{ print $6 }' | cut -d 'x' -f 2 | tail -n 1) - export COG_PLATFORM_WL_VIEW_HEIGHT - else - params+=("$arg") - fi -done - -/usr/bin/cog -P wl "${params[@]}" diff --git a/recipes-browser/cog/files/cog-fdo-ctl b/recipes-browser/cog/files/cog-fdo-ctl deleted file mode 100644 index 08626d8..0000000 --- a/recipes-browser/cog/files/cog-fdo-ctl +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -export $(cat /proc/$(pidof weston-keyboard)/environ | strings | grep DBUS_SESSION_BUS_ADDRESS) - -/usr/bin/cogctl "$@" - diff --git a/recipes-browser/cog/files/cog-fdo-exported-wayland b/recipes-browser/cog/files/cog-fdo-exported-wayland deleted file mode 100755 index ed60e65..0000000 --- a/recipes-browser/cog/files/cog-fdo-exported-wayland +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -export "$(strings < /proc/"$(pidof weston-keyboard)"/environ | grep WAYLAND_DISPLAY)" -export "$(strings < /proc/"$(pidof weston-keyboard)"/environ | grep XDG_RUNTIME_DIR)" - -if [ "root" = "$(whoami)" ] -then - su weston -c "/usr/bin/cog-fdo $*" -else - /usr/bin/cog-fdo "$@" -fi - diff --git a/recipes-browser/wpe-simple-launcher/wpe-simple-launcher/wpe-ctl b/recipes-browser/wpe-simple-launcher/wpe-simple-launcher/wpe-ctl new file mode 100644 index 0000000..ff31f90 --- /dev/null +++ b/recipes-browser/wpe-simple-launcher/wpe-simple-launcher/wpe-ctl @@ -0,0 +1,4 @@ +#!/bin/bash +CTL_FILE=/tmp/wpe-exported-wayland + +echo "$@" > ${CTL_FILE} diff --git a/recipes-browser/wpe-simple-launcher/wpe-simple-launcher/wpe-exported-wayland b/recipes-browser/wpe-simple-launcher/wpe-simple-launcher/wpe-exported-wayland new file mode 100755 index 0000000..25d3877 --- /dev/null +++ b/recipes-browser/wpe-simple-launcher/wpe-simple-launcher/wpe-exported-wayland @@ -0,0 +1,33 @@ +#! /bin/sh + +# export WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1 +# export GST_PLUGIN_FEATURE_RANK="avdec_av1:0" +# export GST_DEBUG_DUMP_DOT_DIR=/tmp/gst-out/ +# mkdir -p /tmp/gst-out +# chmod 777 /tmp/gst-out + +CTL_FILE=/tmp/wpe-exported-wayland + +# WebKitDMABufVideoSink sink that is able to accept decode +# dmabuf or raw data in a range of RGB-like or YUV formats. +# Bug: https://bugs.webkit.org/show_bug.cgi?id=279819 +export WEBKIT_GST_DMABUF_SINK_ENABLED=1 + +export GST_PLUGIN_FEATURE_RANK="avdec_av1:0" + +export "$(strings < /proc/"$(pidof weston-keyboard)"/environ | grep WAYLAND_DISPLAY)" +export "$(strings < /proc/"$(pidof weston-keyboard)"/environ | grep XDG_RUNTIME_DIR)" + +for arg in "$@"; do + if [ "$arg" = "--maximized" ]; then + echo "maximized" > ${CTL_FILE} + fi +done + +if [ "root" = "$(whoami)" ]; then + su weston -c "/usr/bin/wpe-simple-launcher ${CTL_FILE}" +else + /usr/bin/wpe-simple-launcher "${CTL_FILE}" +fi + +echo "${arg}" > ${CTL_FILE} diff --git a/recipes-browser/wpe-simple-launcher/wpe-simple-launcher_git.bb b/recipes-browser/wpe-simple-launcher/wpe-simple-launcher_git.bb index b8cf6e0..324c249 100644 --- a/recipes-browser/wpe-simple-launcher/wpe-simple-launcher_git.bb +++ b/recipes-browser/wpe-simple-launcher/wpe-simple-launcher_git.bb @@ -1,4 +1,7 @@ DESCRIPTION = "Simple WPE-based web launcher" + +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=dd93f6e0496294f589c3d561f96ffee4" @@ -7,9 +10,19 @@ inherit meson pkgconfig DEPENDS = "glib-2.0-native wpewebkit" SRCREV = "ca6175445ab527ab1318666536061150573adb5c" -SRC_URI = "git://git@github.com/psaavedra/wpe-simple-launcher.git;protocol=ssh;branch=main" +SRC_URI = "git://git@github.com/psaavedra/wpe-simple-launcher.git;protocol=ssh;branch=main \ + file://wpe-ctl \ + file://wpe-exported-wayland \ + " S = "${WORKDIR}/git" EXTRA_OECMAKE = "" +do_install:append () { + install -d ${D}/${bindir}/ + install -m 755 ${WORKDIR}/wpe-ctl ${D}/${bindir}/wpe-ctl + install -m 755 ${WORKDIR}/wpe-exported-wayland ${D}/${bindir}/wpe-exported-wayland +} + +RDEPENDS:${PN} += "bash" diff --git a/recipes-core/images/core-image-weston-wpe.bb b/recipes-core/images/core-image-weston-wpe.bb index 7b12183..b71653e 100644 --- a/recipes-core/images/core-image-weston-wpe.bb +++ b/recipes-core/images/core-image-weston-wpe.bb @@ -3,8 +3,6 @@ DESCRIPTION = "core-image-weston with WPEWebKit" inherit image_browsers image_weston IMAGE_INSTALL:append = " \ - cog \ - wpebackend-fdo \ wpewebkit \ wpe-simple-launcher \ python3-uinput \ diff --git a/recipes-graphics/wayland/files/demo-wpe-duckduckgo b/recipes-graphics/wayland/files/demo-wpe-duckduckgo index 156c282..acaa8b0 100644 --- a/recipes-graphics/wayland/files/demo-wpe-duckduckgo +++ b/recipes-graphics/wayland/files/demo-wpe-duckduckgo @@ -1,6 +1,4 @@ #!/bin/bash /usr/bin/kill-demo -export COG_PLATFORM_WL_VIEW_WIDTH=$(journalctl -b | grep weston | grep current | cut -f 1 -d '@' | awk '{ print $6 }' | cut -d 'x' -f 1 | tail -n 1) -export COG_PLATFORM_WL_VIEW_HEIGHT=$(journalctl -b | grep weston | grep current | cut -f 1 -d '@' | awk '{ print $6 }' | cut -d 'x' -f 2 | tail -n 1) export WEBKIT_SHOW_FPS=0 GALLIUM_HUD_TOGGLE_SIGNAL=10 GALLIUM_HUD_VISIBLE=0 GALLIUM_HUD=cpu+fps -/usr/bin/cog-fdo-exported-wayland https://duckduckgo.com/ +/usr/bin/wpe-exported-wayland --maximized https://duckduckgo.com/ diff --git a/recipes-graphics/wayland/files/demo-wpe-website b/recipes-graphics/wayland/files/demo-wpe-website index 50e8b01..8851c66 100644 --- a/recipes-graphics/wayland/files/demo-wpe-website +++ b/recipes-graphics/wayland/files/demo-wpe-website @@ -1,6 +1,4 @@ #!/bin/bash /usr/bin/kill-demo -export COG_PLATFORM_WL_VIEW_WIDTH=$(journalctl -b | grep weston | grep current | cut -f 1 -d '@' | awk '{ print $6 }' | cut -d 'x' -f 1 | tail -n 1) -export COG_PLATFORM_WL_VIEW_HEIGHT=$(journalctl -b | grep weston | grep current | cut -f 1 -d '@' | awk '{ print $6 }' | cut -d 'x' -f 2 | tail -n 1) export WEBKIT_SHOW_FPS=0 GALLIUM_HUD_TOGGLE_SIGNAL=10 GALLIUM_HUD_VISIBLE=0 GALLIUM_HUD=cpu+fps -/usr/bin/cog-fdo-exported-wayland https://www.wpewebkit.org +/usr/bin/wpe-exported-wayland --maximized https://www.wpewebkit.org diff --git a/recipes-graphics/wayland/files/kill-demo b/recipes-graphics/wayland/files/kill-demo index 341546f..30ee419 100644 --- a/recipes-graphics/wayland/files/kill-demo +++ b/recipes-graphics/wayland/files/kill-demo @@ -1,4 +1,4 @@ #! /bin/bash -/usr/bin/pkill -9 -f "cog" +/usr/bin/pkill -9 -f "wpe-simple-launcher" /usr/bin/pkill -9 -O 1 -f "demo" diff --git a/recipes-graphics/wayland/files/weston.ini b/recipes-graphics/wayland/files/weston.ini index 90517b1..70520ad 100644 --- a/recipes-graphics/wayland/files/weston.ini +++ b/recipes-graphics/wayland/files/weston.ini @@ -102,7 +102,7 @@ path=/usr/bin/false [launcher] icon=/usr/share/go-next-symbolic-rtl.symbolic.png displayname=Previous page -path=/usr/bin/cog-fdo-ctl previous +path=/usr/bin/wpe-ctl back [launcher] icon=/usr/share/24x24-blank.png @@ -112,7 +112,7 @@ path=/usr/bin/false [launcher] icon=/usr/share/go-next-symbolic.symbolic.png displayname=Next page -path=/usr/bin/cog-fdo-ctl next +path=/usr/bin/wpe-ctl forward [launcher] icon=/usr/share/24x24-blank.png @@ -122,7 +122,7 @@ path=/usr/bin/false [launcher] icon=/usr/share/view-refresh-symbolic.symbolic.png displayname=Page reload -path=/usr/bin/cog-fdo-ctl reload +path=/usr/bin/wpe-ctl reload [launcher] icon=/usr/share/24x24-blank.png diff --git a/recipes-graphics/wayland/files/cog-demo-run b/recipes-graphics/wayland/files/wpe-demo-run similarity index 89% rename from recipes-graphics/wayland/files/cog-demo-run rename to recipes-graphics/wayland/files/wpe-demo-run index f0bfa6b..5fc1dda 100644 --- a/recipes-graphics/wayland/files/cog-demo-run +++ b/recipes-graphics/wayland/files/wpe-demo-run @@ -10,7 +10,7 @@ import sys import time ## vars ######################################################################## -launcher = 'cog' +launcher = 'wpe-simple-launcher' urls = 'urls.conf' ## functions ################################################################### @@ -54,7 +54,8 @@ if __name__ == "__main__": lines = f.readlines() try: - os.system("%s %s &" % (launcher, lines[0].split()[0])) + os.system("%s /tmp/wpe-demo-run" % launcher) + os.system("echo maximized > /tmp/wpe-demo-run" % lines[0].split()[0]) except Exception as e: print("Error parsing first line: %s" % e) sys.exit(2) @@ -66,7 +67,7 @@ if __name__ == "__main__": entry = l.split() url = entry[0] duration = entry[1] - call("%s-ctl open %s" % (launcher, url)) + call("echo %s > /tmp/wpe-demo-run" % (launcher, url)) time.sleep(int(duration)) counter += 1 except Exception as e: diff --git a/recipes-graphics/wayland/weston-init.bbappend b/recipes-graphics/wayland/weston-init.bbappend index 1d8addf..efcd0ab 100644 --- a/recipes-graphics/wayland/weston-init.bbappend +++ b/recipes-graphics/wayland/weston-init.bbappend @@ -6,7 +6,7 @@ SRC_URI += "file://weston.env \ file://wayland-1.service \ file://kill-demo \ file://toggle-gallium-hud \ - file://cog-demo-run \ + file://wpe-demo-run \ file://demo-wpe-website \ file://demo-wpe-duckduckgo\ file://24x24-blank.png \ @@ -34,7 +34,6 @@ FILES:${PN} += "\ ${systemd_system_unitdir}/wayland-1.service \ ${bindir}/kill-demo \ ${bindir}/toggle-gallium-hud \ - ${bindir}/cog-demo-run \ ${bindir}/demo-wpe-website \ ${bindir}/demo-wpe-duckduckgo \ ${datadir}/24x24-blank.png \ @@ -71,7 +70,6 @@ do_install:append () { install -Dm755 ${WORKDIR}/kill-demo ${D}/${bindir}/kill-demo install -Dm755 ${WORKDIR}/toggle-gallium-hud ${D}/${bindir}/toggle-gallium-hud - install -Dm755 ${WORKDIR}/cog-demo-run ${D}/${bindir}/cog-demo-run install -Dm755 ${WORKDIR}/demo-wpe-website ${D}/${bindir}/demo-wpe-website install -Dm755 ${WORKDIR}/demo-wpe-duckduckgo ${D}/${bindir}/demo-wpe-duckduckgo install -Dm755 ${WORKDIR}/weston-terminal-configure-network ${D}/${bindir}/weston-terminal-configure-network