mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-05 05:05:57 +01:00
s/wlr_subsurface_from_surface/wlr_subsurface_from_wlr_surface/
This was the only x_from_wlr_surface function that lacked the wlr_ prefix, let's have an API as uniform as possible.
This commit is contained in:
parent
167105e606
commit
c263f7ca29
3 changed files with 8 additions and 7 deletions
|
@ -35,6 +35,7 @@ struct wlr_compositor *wlr_compositor_create(struct wl_display *display,
|
||||||
|
|
||||||
bool wlr_surface_is_subsurface(struct wlr_surface *surface);
|
bool wlr_surface_is_subsurface(struct wlr_surface *surface);
|
||||||
|
|
||||||
struct wlr_subsurface *wlr_subsurface_from_surface(struct wlr_surface *surface);
|
struct wlr_subsurface *wlr_subsurface_from_wlr_surface(
|
||||||
|
struct wlr_surface *surface);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -17,7 +17,7 @@ bool wlr_surface_is_subsurface(struct wlr_surface *surface) {
|
||||||
strcmp(surface->role, subsurface_role) == 0;
|
strcmp(surface->role, subsurface_role) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_subsurface *wlr_subsurface_from_surface(
|
struct wlr_subsurface *wlr_subsurface_from_wlr_surface(
|
||||||
struct wlr_surface *surface) {
|
struct wlr_surface *surface) {
|
||||||
assert(wlr_surface_is_subsurface(surface));
|
assert(wlr_surface_is_subsurface(surface));
|
||||||
return (struct wlr_subsurface *)surface->role_data;
|
return (struct wlr_subsurface *)surface->role_data;
|
||||||
|
@ -57,7 +57,7 @@ static void subcompositor_handle_get_subsurface(struct wl_client *client,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wlr_surface_is_subsurface(surface) &&
|
if (wlr_surface_is_subsurface(surface) &&
|
||||||
wlr_subsurface_from_surface(surface) != NULL) {
|
wlr_subsurface_from_wlr_surface(surface) != NULL) {
|
||||||
wl_resource_post_error(resource,
|
wl_resource_post_error(resource,
|
||||||
WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE,
|
WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE,
|
||||||
"%s%d: wl_surface@%d is already a sub-surface",
|
"%s%d: wl_surface@%d is already a sub-surface",
|
||||||
|
|
|
@ -395,7 +395,7 @@ static bool subsurface_is_synchronized(struct wlr_subsurface *subsurface) {
|
||||||
if (!wlr_surface_is_subsurface(subsurface->parent)) {
|
if (!wlr_surface_is_subsurface(subsurface->parent)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
subsurface = wlr_subsurface_from_surface(subsurface->parent);
|
subsurface = wlr_subsurface_from_wlr_surface(subsurface->parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -451,7 +451,7 @@ static void surface_commit(struct wl_client *client,
|
||||||
|
|
||||||
if (wlr_surface_is_subsurface(surface)) {
|
if (wlr_surface_is_subsurface(surface)) {
|
||||||
struct wlr_subsurface *subsurface =
|
struct wlr_subsurface *subsurface =
|
||||||
wlr_subsurface_from_surface(surface);
|
wlr_subsurface_from_wlr_surface(surface);
|
||||||
subsurface_commit(subsurface);
|
subsurface_commit(subsurface);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -887,7 +887,7 @@ struct wlr_subsurface *wlr_subsurface_create(struct wlr_surface *surface,
|
||||||
struct wlr_surface *wlr_surface_get_root_surface(struct wlr_surface *surface) {
|
struct wlr_surface *wlr_surface_get_root_surface(struct wlr_surface *surface) {
|
||||||
while (wlr_surface_is_subsurface(surface)) {
|
while (wlr_surface_is_subsurface(surface)) {
|
||||||
struct wlr_subsurface *subsurface =
|
struct wlr_subsurface *subsurface =
|
||||||
wlr_subsurface_from_surface(surface);
|
wlr_subsurface_from_wlr_surface(surface);
|
||||||
surface = subsurface->parent;
|
surface = subsurface->parent;
|
||||||
}
|
}
|
||||||
return surface;
|
return surface;
|
||||||
|
|
Loading…
Reference in a new issue