-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wayland: crash fl_read_image() #410
Comments
@wcout Thanks for the report, I tried it and I can confirm it's a bug. This program reveals AFAICT two issues:
Regarding (1.): The program "works" (kinda, i.e. it doesn't crash) if I change two things: Fl_RGB_Image *make_cursor_image( int W, int H )
{
Fl_Image_Surface surf( W, H );
// surf.set_current(); (b) move the code that creates the cursor after wait_for_expose(): win.show();
win.wait_for_expose();
Fl_RGB_Image *rgb = make_cursor_image( box.w()/2, box.h()/2 );
box.image( rgb ); @ManoloFLTK These changes are only meant for testing. The original program works fine under Windows (wine) and Linux. Regarding (2.): Although the custom cursor can be created and works with the correct hotspot it is not reset to the normal cursor when it (i.e. its hotspot) leaves the window boundaries. In my tests the cursor seems to be reset to normal when the hotspot leaves the shadow area around the window (which is about 20 px wide in my test with Weston). This is especially weird if you move the cursor from the window to the title bar and further upwards. It is not reset until it's "far" above (20 px) the title bar instead of when it enters the title bar. Issue (2.) is not strictly on topic but it's related and I thought I'd mention it here anyway. A "better" cursor than the big red circle might help to see this issue better. FWIW, in my tests I changed the hotspot to the top/center position: win.cursor( rgb, rgb->w()/2, 1); Screenshot with "cursor" (hotspot at top center of red circle) about 20 px above the title bar inside green ellipse. |
The cursor hotspot issue will be considered separately. |
Fixed only partially. With this modified version of my reproducer program, where the fl_read_image() is called from a Fl_Window::handle() method (hit the space key after start) there is no crash, but the image is obviously not read from the offscreen: |
Should be good now, hopefully. Instead of fl_read_window(), I would recommend to use the Fl_Image_Surface::image() |
Yes that fixes it. Thank you. |
Sorry. It's in the main repo now too. |
@Albrecht-S : Issue #2 above
should be fixed now in the git repo (618eb8f). |
@ManoloFLTK Yes, thanks, this fixes the issue. PS: Please don't use '#nnn' to refer to anything but issue or PR numbers because GitHub (mis)interprets this always as issue/PR number and adds unintended "user xxx mentioned this issue" messages to the (falsely) referred issue or PR. Sigh :-( |
I have here an old test program using fl_read_image(), that crashes with Wayland:
image_cursor_wayland.cxx.txt
The text was updated successfully, but these errors were encountered: