cog
cog copied to clipboard
mouse cursor not showing when cog is running
Hi,
I'm having problems working with cog and using a mouse. In weston/wayland the mouse pointer is working fine, however when I launch cog, I can see the browser page but the mouse pointer disappears. If I move the mouse over an element I see that the button/label/ or whatever is highlighted but I can not see the mouse pointer. When I close cog, and the weston/wayland desktop come back the mouse pointer is here again.
cog version:
~# cog --version 0.12.4 (WPE WebKit 2.36.4) ~#
cog backend: fdo
I tested to enable "COG_USE_WAYLAND_CURSOR" adding it to the make but I have the same issue. I'm using Yocto 4.0 to build it.
Any clue?
Thanks in advance.
hi, I have the same problem. I'm using buildroot 2022.02.x to build it
Hi i'm also having the same issue. Tried to launch weston desktop shell in which i can see the mouse cursor but whenever i mouse the mouse over the cog area, the mouse disappears.
I'm also using buildroot 2022.02.1
and cog version 0.12.4
I tested building using COG_USE_WAYLAND_CURSOR
as well but it doesn't seem to do anything.
Here is a video for reference:
https://user-images.githubusercontent.com/417379/181785108-0f105cc5-c92e-4d18-92be-93a2bbdcdc1c.mp4
Hello, same issue here with wlroot sway, sometime the mouse cursor disappear. cog --version 0.13.3+git-07defeb (WPE WebKit 2.36.3) sway --version sway version 1.7-5543acff (Apr 13 2022, branch 'HEAD')
I ran into similar issue when using weston's kiosk-shell. There was no cursor whatsoever as in kiosk-shell there is no startup client that would create one.
The fix was to delete the wl_data.wl_shm as it was never initialized and therefore the cursor theme and pointer were never loaded, using the proper wl_shm it now works as expected. Following are the changes for cog 1.16.0.
platform/wayland/cog-platform-wl.c:
@@ -173,7 +173,6 @@ static struct {
#endif
#ifdef COG_USE_WAYLAND_CURSOR
- struct wl_shm *wl_shm;
struct wl_cursor_theme *cursor_theme;
struct wl_cursor *cursor_left_ptr;
struct wl_surface *cursor_left_ptr_surface;
@@ -1979,10 +1978,10 @@ init_wayland (GError **error)
wl_display_roundtrip (wl_data.display);
#if COG_USE_WAYLAND_CURSOR
- if (wl_data.wl_shm) {
+ if (wl_data.shm) {
if (!(wl_data.cursor_theme = wl_cursor_theme_load (NULL,
32,
- wl_data.wl_shm))) {
+ wl_data.shm))) {
g_warning ("%s: Could not load cursor theme.", G_STRFUNC);
} else if (!(wl_data.cursor_left_ptr =
wl_cursor_theme_get_cursor (wl_data.cursor_theme, "left_ptr"))) {
@@ -2027,7 +2026,6 @@ clear_wayland (void)
#ifdef COG_USE_WAYLAND_CURSOR
g_clear_pointer (&wl_data.cursor_left_ptr_surface, wl_surface_destroy);
g_clear_pointer (&wl_data.cursor_theme, wl_cursor_theme_destroy);
- g_clear_pointer (&wl_data.wl_shm, wl_shm_destroy);
#endif /* COG_USE_WAYLAND_CURSOR */
@Flourick thanks!
I just tested it and it works. Also it looks a correct patch to me.
Can you make a pull request?
Sure thing!
Hi Just tested the master upstream that includes these fixes using Yocto (Weston).
cog --version
0.17.0+git-eafe741 (WPE WebKit 2.38.4)
I configured the cog as upstream, and all the other recipes I left as default. And that fixed the problem.
https://user-images.githubusercontent.com/7702208/218143424-79af1e21-71c3-440f-8b91-c7fc607f9073.mp4
@Flourick and @ceyusa I would like to suggest closing tickets about the cursor that you think will be fixed with that and if possible releasing a new version once this is a very nice fix.
@munoz0raul right, thanks!
Sadly, https://github.com/Igalia/cog/pull/512 didn't had the "Fixes: #471" to close this issue automatically.
But closing it manually now.