questions about gtk simple applications running on wayland
Zhao, Juan J
juan.j.zhao at intel.com
Fri Oct 28 05:19:04 PDT 2011
In the client side: Gtk call wl_egl_pixmap_create_buffer to create the buffer and then use wl_surface_attach to attach this buffer to its surface.
In the server side: drm_create_buffer is called and add that buffer resource to this client. And wl_map_insert_at will be called. That buffer resource is inserted to the map. Then surface_attach will be called, this buffer will be saved to one wlsc_surface.
Then in the client side, gtk call wl_shell_set_toplevel, wl_connection_vmarshal will be called.
In the server side, shell_set_toplevel is called. The third parameter is the previous buffer object created by drm_create_buffer not the wlsc_surface.
Should I need to look into wl_connection_vmarshal to check each parameter sent to the server?
From: Zhao, Juan J
Sent: Thursday, October 27, 2011 4:15 PM
To: Zhao, Juan J; wayland-devel at lists.freedesktop.org
Subject: RE: questions about gtk simple applications running on wayland
Some updates for this question.
In gtk side, if I run "wl_shell_set_toplevel" once the surface is created by "wl_compositor_create_surface", everything is OK.
But later, gtk application will bind some image to this surface. And then call "wl_shell_set_toplevel".
In the server side, the function shell_set_toplevel's third parameter is only "wl_buffer" but not "wlsc_surface".
The server used some point which is not for wlsc_surface, and then, random result shows: like the height and width is too big....
From: wayland-devel-bounces+juan.j.zhao=intel.com at lists.freedesktop.org [mailto:wayland-devel-bounces+juan.j.zhao=intel.com at lists.freedesktop.org] On Behalf Of Zhao, Juan J
Sent: Thursday, October 27, 2011 9:26 AM
To: wayland-devel at lists.freedesktop.org
Subject: questions about gtk simple applications running on wayland
These days, I'm trying to run some simple gtk applications on wayland.
I built gtk, and fix some mismatched wayland interface. But there are still some problems.
It is announced that gtk applications can run on X11 backend wayland compositor. So I choose this backend at first.
Simple wayland client demos can run OK. But when running gtk applications, I will find that server will meet segment fault.
The segment fault is directly caused by shell_set_toplevel->wlsc_surface_damage->wlsc_surface_damage_rectangle->pixman_region32_union_rect. The width and height is more than 10,000+.
Looks like some boundaries check should be added here. Because the server should not crashed by some unhealthy clients.
And maybe we can still send some message to the client:"Hey, you did something wrong...and I will ignore your request"
Obviously, this is not the root cause. I went on track the shell_top_level's resource. This resource is inserted to wl_map by bind_shell.
There are something strange here. When adding these resource, it is a kind of wl_shell resource. But when using it in shell_set_toplevel, it become a wlsc_surface resource....
Did I misunderstand something here? Any thoughts for me for going ahead to fix this problem to the root cause?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the wayland-devel