Пример #1
0
static void
wl_cb_shell_surface_set_transient(struct wl_client *client, struct wl_resource *resource, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags)
{
   (void)client, (void)flags;

   struct wlc_view *view;
   if (!(view = convert_from_wlc_handle((wlc_handle)wl_resource_get_user_data(resource), "view")))
      return;

   struct wlc_surface *surface = (parent_resource ? convert_from_wl_resource(parent_resource, "surface") : NULL);
   wlc_view_set_parent_ptr(view, (surface ? convert_from_wlc_handle(surface->view, "view") : NULL));
   view->pending.geometry.origin = (struct wlc_point){ x, y };
}
Пример #2
0
Файл: shell.c Проект: hsoft/wlc
static void
wl_cb_shell_get_shell_surface(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource)
{
   struct wlc_shell *shell;
   struct wlc_surface *surface;
   if (!(shell = wl_resource_get_user_data(resource)) || !(surface = convert_from_wl_resource(surface_resource, "surface")))
      return;

   wlc_resource r;
   if (!(r = wlc_resource_create(&shell->surfaces, client, &wl_shell_surface_interface, wl_resource_get_version(resource), 1, id)))
      return;

   wlc_resource_implement(r, &wl_shell_surface_implementation, NULL);

   struct wlc_surface_event ev = { .attach = { .type = WLC_SHELL_SURFACE, .shell_surface = r }, .surface = surface, .type = WLC_SURFACE_EVENT_REQUEST_VIEW_ATTACH };