role -> state
This commit is contained in:
parent
27ca8eaced
commit
3d03ef2d02
|
@ -29,11 +29,11 @@ struct wlr_wl_shell_surface_popup_state {
|
||||||
uint32_t serial;
|
uint32_t serial;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum wlr_wl_shell_surface_role {
|
enum wlr_wl_shell_surface_state {
|
||||||
WLR_WL_SHELL_SURFACE_ROLE_NONE,
|
WLR_WL_SHELL_SURFACE_STATE_NONE,
|
||||||
WLR_WL_SHELL_SURFACE_ROLE_TOPLEVEL,
|
WLR_WL_SHELL_SURFACE_STATE_TOPLEVEL,
|
||||||
WLR_WL_SHELL_SURFACE_ROLE_TRANSIENT,
|
WLR_WL_SHELL_SURFACE_STATE_TRANSIENT,
|
||||||
WLR_WL_SHELL_SURFACE_ROLE_POPUP,
|
WLR_WL_SHELL_SURFACE_STATE_POPUP,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wlr_wl_shell_surface {
|
struct wlr_wl_shell_surface {
|
||||||
|
@ -46,7 +46,7 @@ struct wlr_wl_shell_surface {
|
||||||
uint32_t ping_serial;
|
uint32_t ping_serial;
|
||||||
struct wl_event_source *ping_timer;
|
struct wl_event_source *ping_timer;
|
||||||
|
|
||||||
enum wlr_wl_shell_surface_role role;
|
enum wlr_wl_shell_surface_state state;
|
||||||
struct wlr_wl_shell_surface_transient_state *transient_state;
|
struct wlr_wl_shell_surface_transient_state *transient_state;
|
||||||
struct wlr_wl_shell_surface_popup_state *popup_state;
|
struct wlr_wl_shell_surface_popup_state *popup_state;
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ struct wlr_wl_shell_surface {
|
||||||
struct wl_signal request_set_fullscreen;
|
struct wl_signal request_set_fullscreen;
|
||||||
struct wl_signal request_set_maximized;
|
struct wl_signal request_set_maximized;
|
||||||
|
|
||||||
struct wl_signal set_role;
|
struct wl_signal set_state;
|
||||||
struct wl_signal set_title;
|
struct wl_signal set_title;
|
||||||
struct wl_signal set_class;
|
struct wl_signal set_class;
|
||||||
} events;
|
} events;
|
||||||
|
|
|
@ -77,13 +77,13 @@ static void shell_surface_set_toplevel(struct wl_client *client,
|
||||||
wlr_log(L_DEBUG, "got shell surface toplevel");
|
wlr_log(L_DEBUG, "got shell surface toplevel");
|
||||||
struct wlr_wl_shell_surface *surface = wl_resource_get_user_data(resource);
|
struct wlr_wl_shell_surface *surface = wl_resource_get_user_data(resource);
|
||||||
|
|
||||||
if (surface->role != WLR_WL_SHELL_SURFACE_ROLE_NONE) {
|
if (surface->state != WLR_WL_SHELL_SURFACE_STATE_NONE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
surface->role = WLR_WL_SHELL_SURFACE_ROLE_TOPLEVEL;
|
surface->state = WLR_WL_SHELL_SURFACE_STATE_TOPLEVEL;
|
||||||
|
|
||||||
wl_signal_emit(&surface->events.set_role, surface);
|
wl_signal_emit(&surface->events.set_state, surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void shell_surface_set_transient(struct wl_client *client,
|
static void shell_surface_set_transient(struct wl_client *client,
|
||||||
|
@ -95,7 +95,7 @@ static void shell_surface_set_transient(struct wl_client *client,
|
||||||
wl_resource_get_user_data(parent_resource);
|
wl_resource_get_user_data(parent_resource);
|
||||||
// TODO: check if parent_resource == NULL?
|
// TODO: check if parent_resource == NULL?
|
||||||
|
|
||||||
if (surface->role != WLR_WL_SHELL_SURFACE_ROLE_NONE) {
|
if (surface->state != WLR_WL_SHELL_SURFACE_STATE_NONE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,9 +114,9 @@ static void shell_surface_set_transient(struct wl_client *client,
|
||||||
free(surface->transient_state);
|
free(surface->transient_state);
|
||||||
surface->transient_state = state;
|
surface->transient_state = state;
|
||||||
|
|
||||||
surface->role = WLR_WL_SHELL_SURFACE_ROLE_TRANSIENT;
|
surface->state = WLR_WL_SHELL_SURFACE_STATE_TRANSIENT;
|
||||||
|
|
||||||
wl_signal_emit(&surface->events.set_role, surface);
|
wl_signal_emit(&surface->events.set_state, surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void shell_surface_set_fullscreen(struct wl_client *client,
|
static void shell_surface_set_fullscreen(struct wl_client *client,
|
||||||
|
@ -129,7 +129,7 @@ static void shell_surface_set_fullscreen(struct wl_client *client,
|
||||||
output = wl_resource_get_user_data(output_resource);
|
output = wl_resource_get_user_data(output_resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (surface->role == WLR_WL_SHELL_SURFACE_ROLE_TOPLEVEL) {
|
if (surface->state == WLR_WL_SHELL_SURFACE_STATE_TOPLEVEL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ static void shell_surface_set_popup(struct wl_client *client,
|
||||||
wl_resource_get_user_data(parent_resource);
|
wl_resource_get_user_data(parent_resource);
|
||||||
// TODO: check if parent_resource == NULL?
|
// TODO: check if parent_resource == NULL?
|
||||||
|
|
||||||
if (surface->role != WLR_WL_SHELL_SURFACE_ROLE_NONE) {
|
if (surface->state != WLR_WL_SHELL_SURFACE_STATE_NONE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,9 +195,9 @@ static void shell_surface_set_popup(struct wl_client *client,
|
||||||
free(surface->popup_state);
|
free(surface->popup_state);
|
||||||
surface->popup_state = popup_state;
|
surface->popup_state = popup_state;
|
||||||
|
|
||||||
surface->role = WLR_WL_SHELL_SURFACE_ROLE_POPUP;
|
surface->state = WLR_WL_SHELL_SURFACE_STATE_POPUP;
|
||||||
|
|
||||||
wl_signal_emit(&surface->events.set_role, surface);
|
wl_signal_emit(&surface->events.set_state, surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void shell_surface_set_maximized(struct wl_client *client,
|
static void shell_surface_set_maximized(struct wl_client *client,
|
||||||
|
@ -209,7 +209,7 @@ static void shell_surface_set_maximized(struct wl_client *client,
|
||||||
output = wl_resource_get_user_data(output_resource);
|
output = wl_resource_get_user_data(output_resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (surface->role == WLR_WL_SHELL_SURFACE_ROLE_TOPLEVEL) {
|
if (surface->state == WLR_WL_SHELL_SURFACE_STATE_TOPLEVEL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,7 +336,7 @@ static void wl_shell_get_shell_surface(struct wl_client *client,
|
||||||
wl_signal_init(&wl_surface->events.request_resize);
|
wl_signal_init(&wl_surface->events.request_resize);
|
||||||
wl_signal_init(&wl_surface->events.request_set_fullscreen);
|
wl_signal_init(&wl_surface->events.request_set_fullscreen);
|
||||||
wl_signal_init(&wl_surface->events.request_set_maximized);
|
wl_signal_init(&wl_surface->events.request_set_maximized);
|
||||||
wl_signal_init(&wl_surface->events.set_role);
|
wl_signal_init(&wl_surface->events.set_state);
|
||||||
wl_signal_init(&wl_surface->events.set_title);
|
wl_signal_init(&wl_surface->events.set_title);
|
||||||
wl_signal_init(&wl_surface->events.set_class);
|
wl_signal_init(&wl_surface->events.set_class);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue