|
|
@ -812,6 +812,7 @@ static void xdg_surface_ack_configure(struct wl_client *client,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
surface->configured = true;
|
|
|
|
surface->configured = true;
|
|
|
|
|
|
|
|
surface->configure_serial = serial;
|
|
|
|
|
|
|
|
|
|
|
|
wl_signal_emit(&surface->events.ack_configure, surface);
|
|
|
|
wl_signal_emit(&surface->events.ack_configure, surface);
|
|
|
|
|
|
|
|
|
|
|
@ -941,7 +942,6 @@ static void wlr_xdg_toplevel_v6_send_configure(
|
|
|
|
|
|
|
|
|
|
|
|
static void wlr_xdg_surface_send_configure(void *user_data) {
|
|
|
|
static void wlr_xdg_surface_send_configure(void *user_data) {
|
|
|
|
struct wlr_xdg_surface_v6 *surface = user_data;
|
|
|
|
struct wlr_xdg_surface_v6 *surface = user_data;
|
|
|
|
struct wl_display *display = wl_client_get_display(surface->client->client);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
surface->configure_idle = NULL;
|
|
|
|
surface->configure_idle = NULL;
|
|
|
|
|
|
|
|
|
|
|
@ -953,7 +953,7 @@ static void wlr_xdg_surface_send_configure(void *user_data) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wl_list_insert(surface->configure_list.prev, &configure->link);
|
|
|
|
wl_list_insert(surface->configure_list.prev, &configure->link);
|
|
|
|
configure->serial = wl_display_next_serial(display);
|
|
|
|
configure->serial = surface->configure_next_serial;
|
|
|
|
|
|
|
|
|
|
|
|
switch (surface->role) {
|
|
|
|
switch (surface->role) {
|
|
|
|
case WLR_XDG_SURFACE_V6_ROLE_NONE:
|
|
|
|
case WLR_XDG_SURFACE_V6_ROLE_NONE:
|
|
|
@ -974,7 +974,7 @@ static void wlr_xdg_surface_send_configure(void *user_data) {
|
|
|
|
zxdg_surface_v6_send_configure(surface->resource, configure->serial);
|
|
|
|
zxdg_surface_v6_send_configure(surface->resource, configure->serial);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void wlr_xdg_surface_v6_schedule_configure(
|
|
|
|
static uint32_t wlr_xdg_surface_v6_schedule_configure(
|
|
|
|
struct wlr_xdg_surface_v6 *surface) {
|
|
|
|
struct wlr_xdg_surface_v6 *surface) {
|
|
|
|
struct wl_display *display = wl_client_get_display(surface->client->client);
|
|
|
|
struct wl_display *display = wl_client_get_display(surface->client->client);
|
|
|
|
struct wl_event_loop *loop = wl_display_get_event_loop(display);
|
|
|
|
struct wl_event_loop *loop = wl_display_get_event_loop(display);
|
|
|
@ -995,23 +995,23 @@ static void wlr_xdg_surface_v6_schedule_configure(
|
|
|
|
if (surface->configure_idle != NULL) {
|
|
|
|
if (surface->configure_idle != NULL) {
|
|
|
|
if (!pending_same) {
|
|
|
|
if (!pending_same) {
|
|
|
|
// configure request already scheduled
|
|
|
|
// configure request already scheduled
|
|
|
|
return;
|
|
|
|
return surface->configure_next_serial;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// configure request not necessary anymore
|
|
|
|
// configure request not necessary anymore
|
|
|
|
wl_event_source_remove(surface->configure_idle);
|
|
|
|
wl_event_source_remove(surface->configure_idle);
|
|
|
|
surface->configure_idle = NULL;
|
|
|
|
surface->configure_idle = NULL;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (pending_same) {
|
|
|
|
if (pending_same) {
|
|
|
|
// configure request not necessary
|
|
|
|
// configure request not necessary
|
|
|
|
return;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
surface->configure_idle =
|
|
|
|
surface->configure_next_serial = wl_display_next_serial(display);
|
|
|
|
wl_event_loop_add_idle(
|
|
|
|
surface->configure_idle = wl_event_loop_add_idle(loop,
|
|
|
|
loop,
|
|
|
|
wlr_xdg_surface_send_configure, surface);
|
|
|
|
wlr_xdg_surface_send_configure,
|
|
|
|
return surface->configure_next_serial;
|
|
|
|
surface);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1304,45 +1304,45 @@ void wlr_xdg_surface_v6_ping(struct wlr_xdg_surface_v6 *surface) {
|
|
|
|
surface->client->ping_serial);
|
|
|
|
surface->client->ping_serial);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void wlr_xdg_toplevel_v6_set_size(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
uint32_t wlr_xdg_toplevel_v6_set_size(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
uint32_t width, uint32_t height) {
|
|
|
|
uint32_t width, uint32_t height) {
|
|
|
|
assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL);
|
|
|
|
assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL);
|
|
|
|
surface->toplevel_state->pending.width = width;
|
|
|
|
surface->toplevel_state->pending.width = width;
|
|
|
|
surface->toplevel_state->pending.height = height;
|
|
|
|
surface->toplevel_state->pending.height = height;
|
|
|
|
|
|
|
|
|
|
|
|
wlr_xdg_surface_v6_schedule_configure(surface);
|
|
|
|
return wlr_xdg_surface_v6_schedule_configure(surface);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void wlr_xdg_toplevel_v6_set_activated(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
uint32_t wlr_xdg_toplevel_v6_set_activated(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
bool activated) {
|
|
|
|
bool activated) {
|
|
|
|
assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL);
|
|
|
|
assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL);
|
|
|
|
surface->toplevel_state->pending.activated = activated;
|
|
|
|
surface->toplevel_state->pending.activated = activated;
|
|
|
|
|
|
|
|
|
|
|
|
wlr_xdg_surface_v6_schedule_configure(surface);
|
|
|
|
return wlr_xdg_surface_v6_schedule_configure(surface);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void wlr_xdg_toplevel_v6_set_maximized(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
uint32_t wlr_xdg_toplevel_v6_set_maximized(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
bool maximized) {
|
|
|
|
bool maximized) {
|
|
|
|
assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL);
|
|
|
|
assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL);
|
|
|
|
surface->toplevel_state->pending.maximized = maximized;
|
|
|
|
surface->toplevel_state->pending.maximized = maximized;
|
|
|
|
|
|
|
|
|
|
|
|
wlr_xdg_surface_v6_schedule_configure(surface);
|
|
|
|
return wlr_xdg_surface_v6_schedule_configure(surface);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void wlr_xdg_toplevel_v6_set_fullscreen(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
uint32_t wlr_xdg_toplevel_v6_set_fullscreen(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
bool fullscreen) {
|
|
|
|
bool fullscreen) {
|
|
|
|
assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL);
|
|
|
|
assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL);
|
|
|
|
surface->toplevel_state->pending.fullscreen = fullscreen;
|
|
|
|
surface->toplevel_state->pending.fullscreen = fullscreen;
|
|
|
|
|
|
|
|
|
|
|
|
wlr_xdg_surface_v6_schedule_configure(surface);
|
|
|
|
return wlr_xdg_surface_v6_schedule_configure(surface);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
uint32_t wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
bool resizing) {
|
|
|
|
bool resizing) {
|
|
|
|
assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL);
|
|
|
|
assert(surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL);
|
|
|
|
surface->toplevel_state->pending.resizing = resizing;
|
|
|
|
surface->toplevel_state->pending.resizing = resizing;
|
|
|
|
|
|
|
|
|
|
|
|
wlr_xdg_surface_v6_schedule_configure(surface);
|
|
|
|
return wlr_xdg_surface_v6_schedule_configure(surface);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void wlr_xdg_toplevel_v6_send_close(struct wlr_xdg_surface_v6 *surface) {
|
|
|
|
void wlr_xdg_toplevel_v6_send_close(struct wlr_xdg_surface_v6 *surface) {
|
|
|
|