djpohly / dwl

dwm for Wayland - ARCHIVE: development has moved to Codeberg
https://codeberg.org/dwl/dwl
Other
1.93k stars 283 forks source link

The Obs-studio mouse cursor is not visible in the wlroo-next branch It is visible in the main branch #500

Closed DreamMaoMao closed 11 months ago

DreamMaoMao commented 1 year ago

Info

main branch dwl version:dwl v0.4-60-gab87410-dirty wlroots version:0.16.2

wlroots-next branch dwl version:dwl v0.4-109-g892a4d3-dirty wlroots version:lastest source code(2023-10-16)

main branch:

https://github.com/djpohly/dwl/assets/30348075/fe5a2af7-8766-4a17-b21e-89946b761ec0

wlroots-next branch:

https://github.com/djpohly/dwl/assets/30348075/2ab1eeb4-2454-4a64-abb2-dd23cadfc403

What's the problem?

DreamMaoMao commented 1 year ago

In the wlroots-next branch, moving the mouse cursor into the obs window will cause the cursor to disappear.

DreamMaoMao commented 1 year ago

When using the same latest source code to build wlroots, there is no such problem in sway. This is a problem unique to dwl (wlroot-next). I would like to ask which section of code is the problem so that I can compare it with sway source code.

sway test:

https://github.com/djpohly/dwl/assets/30348075/a07fa300-1bcb-4717-b99d-ca323fd40774

sevz17 commented 1 year ago

Hm We change the cursor image in each call to wlr_cursor_set_xcursor and wlr_cursor_set_surface.

A good start to search would be motionnotify, setcursor and setcursorshape.

Also, when you say "not visible", do you mean that you cannot see the cursor on your screen, or is limited to only the recordings of obs?

DreamMaoMao commented 1 year ago

Hm We change the cursor image in each call to wlr_cursor_set_xcursor and wlr_cursor_set_surface.

A good start to search would be motionnotify, setcursor and setcursorshape.

Also, when you say "not visible", do you mean that you cannot see the cursor on your screen, or is limited to only the recordings of obs?

it means thant the cursor cannot be saw on my screen

DreamMaoMao commented 1 year ago

i try to force change obs some surface to xwayland suface by add some enviroment variable , the result is that the cursor can be saw on some xwayland surface in obs, and the cursor still cannot be saw on xdg surface in obs.

sevz17 commented 1 year ago

Hm We change the cursor image in each call to wlr_cursor_set_xcursor and wlr_cursor_set_surface. A good start to search would be motionnotify, setcursor and setcursorshape. Also, when you say "not visible", do you mean that you cannot see the cursor on your screen, or is limited to only the recordings of obs?

it means thant the cursor cannot be saw on my screen

I see.

i try to force change obs some surface to xwayland suface by add some enviroment variable , the result is that the cursor can be saw on some xwayland surface in obs, and the cursor still cannot be saw on xdg surface in obs.

Can you try commenting these two lines in setup?

cursor_shape_mgr = wlr_cursor_shape_manager_v1_create(dpy, 1);
LISTEN_STATIC(&cursor_shape_mgr->events.request_set_shape, setcursorshape);
DreamMaoMao commented 1 year ago

I commented these two lines of code,Problem solved!!

//cursor_shape_mgr = wlr_cursor_shape_manager_v1_create(dpy, 1);
//LISTEN_STATIC(&cursor_shape_mgr->events.request_set_shape, setcursorshape);

now it work .

https://github.com/djpohly/dwl/assets/30348075/f43a4e4c-6906-4ab0-9582-096dbe6401f0

sevz17 commented 12 months ago

I see...

I need to check sway code (removing those two lines is not a viable solution).

DreamMaoMao commented 11 months ago

When I looked at the hyprland source code I discovered the cause of this bug.This is due to some applications not getting the default system cursor theme. So I added an option in config.h to set the default cursor theme, which solves this problem.

image image

sevz17 commented 11 months ago

I see...

I think here are two problems:

wlroots just merged a mr that could help with this, can you try again with the latest wlroots and dwl commits and with the two lines uncommented?

and also dwl can now be launched with -d option, can you use it and attach the stderr?

DreamMaoMao commented 11 months ago

https://github.com/djpohly/dwl/assets/30348075/e9f38dc7-f292-4fc9-a191-add7387eb18a

No problem, this commit is working well