static void
handle_configure(void *data, struct xdg_surface *surface,
		 int32_t width, int32_t height,
		 struct wl_array *states, uint32_t serial)
{
	xdg_surface_ack_configure(surface, serial);
}
void _WLxdg_surface_configure(void* data, struct xdg_surface* surface, int32_t width, int32_t height, struct wl_array* states, uint32_t serial) {
    NUNUSED(data);
    NUNUSED(width);
    NUNUSED(height);
    NUNUSED(states);
    xdg_surface_ack_configure(surface, serial);
}
Exemple #3
0
static void
handle_configure_xdg_shell_surface(void *data, struct xdg_surface *xdg, uint32_t serial)
{
    SDL_WindowData *wind = (SDL_WindowData *)data;
    SDL_Window *window = wind->sdlwindow;
    struct wl_region *region;

    wind->shell_surface.xdg.initial_configure_seen = SDL_TRUE;

    WAYLAND_wl_egl_window_resize(wind->egl_window, window->w, window->h, 0, 0);

    region = wl_compositor_create_region(wind->waylandData->compositor);
    wl_region_add(region, 0, 0, window->w, window->h);
    wl_surface_set_opaque_region(wind->surface, region);
    wl_region_destroy(region);
    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, window->w, window->h);
    xdg_surface_ack_configure(xdg, serial);
}
Exemple #4
0
void XdgShellSurfaceUnstableV5::Private::ackConfigure(quint32 serial)
{
    xdg_surface_ack_configure(xdgsurfacev5, serial);
}
Exemple #5
0
static void xdg_handle_configure(void* data, struct xdg_surface* surface,
                                 int32_t width, int32_t height,
                                 struct wl_array* states, uint32_t serial)
{
	UwacWindow* window = (UwacWindow*)data;
	UwacConfigureEvent* event;
	int ret, surfaceState;
	enum xdg_surface_state* state;
	surfaceState = 0;
	wl_array_for_each(state, states)
	{
		switch (*state)
		{
			case XDG_SURFACE_STATE_MAXIMIZED:
				surfaceState |= UWAC_WINDOW_MAXIMIZED;
				break;

			case XDG_SURFACE_STATE_FULLSCREEN:
				surfaceState |= UWAC_WINDOW_FULLSCREEN;
				break;

			case XDG_SURFACE_STATE_ACTIVATED:
				surfaceState |= UWAC_WINDOW_ACTIVATED;
				break;

			case XDG_SURFACE_STATE_RESIZING:
				surfaceState |= UWAC_WINDOW_RESIZING;
				break;

			default:
				break;
		}
	}
	window->surfaceStates = surfaceState;
	event = (UwacConfigureEvent*)UwacDisplayNewEvent(window->display, UWAC_EVENT_CONFIGURE);

	if (!event)
	{
		assert(uwacErrorHandler(window->display, UWAC_ERROR_NOMEMORY,
		                        "failed to allocate a configure event\n"));
		goto ack;
	}

	event->window = window;
	event->states = surfaceState;

	if (width && height)
	{
		event->width = width;
		event->height = height;
		UwacWindowDestroyBuffers(window);
		window->width = width;
		window->stride = width * bppFromShmFormat(window->format);
		window->height = height;
		ret = UwacWindowShmAllocBuffers(window, UWAC_INITIAL_BUFFERS, window->stride * height,
		                                width, height, window->format);

		if (ret != UWAC_SUCCESS)
		{
			assert(uwacErrorHandler(window->display, ret, "failed to reallocate a wayland buffers\n"));
			window->drawingBuffer = window->pendingBuffer = NULL;
			goto ack;
		}

		window->drawingBuffer = window->pendingBuffer = &window->buffers[0];
	}
	else
	{
		event->width = window->width;
		event->height = window->height;
	}

ack:
	xdg_surface_ack_configure(surface, serial);
}