Partly revert "Only render mapped surfaces"
This reverts most of commit d69ccc7bdd
,
because it is now handled by wlroots.
The iterator -> callback renames have been kept in place.
This commit is contained in:
parent
a5ea9e98f7
commit
fe3236d948
4 changed files with 17 additions and 95 deletions
|
@ -71,7 +71,7 @@ struct kiwmi_view {
|
||||||
|
|
||||||
struct kiwmi_view_impl {
|
struct kiwmi_view_impl {
|
||||||
void (*close)(struct kiwmi_view *view);
|
void (*close)(struct kiwmi_view *view);
|
||||||
void (*for_each_mapped_surface)(
|
void (*for_each_surface)(
|
||||||
struct kiwmi_view *view,
|
struct kiwmi_view *view,
|
||||||
wlr_surface_iterator_func_t callback,
|
wlr_surface_iterator_func_t callback,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
|
@ -131,7 +131,7 @@ struct kiwmi_request_resize_event {
|
||||||
};
|
};
|
||||||
|
|
||||||
void view_close(struct kiwmi_view *view);
|
void view_close(struct kiwmi_view *view);
|
||||||
void view_for_each_mapped_surface(
|
void view_for_each_surface(
|
||||||
struct kiwmi_view *view,
|
struct kiwmi_view *view,
|
||||||
wlr_surface_iterator_func_t callback,
|
wlr_surface_iterator_func_t callback,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
|
|
|
@ -179,8 +179,7 @@ output_frame_notify(struct wl_listener *listener, void *data)
|
||||||
|
|
||||||
struct kiwmi_view *view;
|
struct kiwmi_view *view;
|
||||||
wl_list_for_each (view, &desktop->views, link) {
|
wl_list_for_each (view, &desktop->views, link) {
|
||||||
view_for_each_mapped_surface(
|
view_for_each_surface(view, send_frame_done_to_surface, &now);
|
||||||
view, send_frame_done_to_surface, &now);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (render_cursors(wlr_output)) {
|
if (render_cursors(wlr_output)) {
|
||||||
|
@ -227,7 +226,7 @@ output_frame_notify(struct wl_listener *listener, void *data)
|
||||||
rdata.data = view;
|
rdata.data = view;
|
||||||
|
|
||||||
wl_signal_emit(&view->events.pre_render, &rdata);
|
wl_signal_emit(&view->events.pre_render, &rdata);
|
||||||
view_for_each_mapped_surface(view, render_surface, &rdata);
|
view_for_each_surface(view, render_surface, &rdata);
|
||||||
wl_signal_emit(&view->events.post_render, &rdata);
|
wl_signal_emit(&view->events.post_render, &rdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,13 +24,13 @@ view_close(struct kiwmi_view *view)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
view_for_each_mapped_surface(
|
view_for_each_surface(
|
||||||
struct kiwmi_view *view,
|
struct kiwmi_view *view,
|
||||||
wlr_surface_iterator_func_t callback,
|
wlr_surface_iterator_func_t callback,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
if (view->impl->for_each_mapped_surface) {
|
if (view->impl->for_each_surface) {
|
||||||
view->impl->for_each_mapped_surface(view, callback, user_data);
|
view->impl->for_each_surface(view, callback, user_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -294,89 +294,12 @@ xdg_shell_view_close(struct kiwmi_view *view)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
surface_for_each_mapped_surface(
|
xdg_shell_view_for_each_surface(
|
||||||
struct wlr_surface *surface,
|
|
||||||
int x,
|
|
||||||
int y,
|
|
||||||
wlr_surface_iterator_func_t callback,
|
|
||||||
void *user_data)
|
|
||||||
{
|
|
||||||
struct wlr_subsurface *subsurface;
|
|
||||||
wl_list_for_each (
|
|
||||||
subsurface, &surface->current.subsurfaces_below, current.link) {
|
|
||||||
if (!subsurface->mapped) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
surface_for_each_mapped_surface(
|
|
||||||
subsurface->surface,
|
|
||||||
x + subsurface->current.x,
|
|
||||||
y + subsurface->current.y,
|
|
||||||
callback,
|
|
||||||
user_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
callback(surface, x, y, user_data);
|
|
||||||
|
|
||||||
wl_list_for_each (
|
|
||||||
subsurface, &surface->current.subsurfaces_above, current.link) {
|
|
||||||
if (!subsurface->mapped) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
surface_for_each_mapped_surface(
|
|
||||||
subsurface->surface,
|
|
||||||
x + subsurface->current.x,
|
|
||||||
y + subsurface->current.y,
|
|
||||||
callback,
|
|
||||||
user_data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
xdg_surface_for_each_mapped_popup_surface(
|
|
||||||
struct wlr_xdg_surface *surface,
|
|
||||||
int x,
|
|
||||||
int y,
|
|
||||||
wlr_surface_iterator_func_t callback,
|
|
||||||
void *user_data)
|
|
||||||
{
|
|
||||||
struct wlr_xdg_popup *popup;
|
|
||||||
wl_list_for_each (popup, &surface->popups, link) {
|
|
||||||
struct wlr_xdg_surface *popup_surface = popup->base;
|
|
||||||
if (!popup_surface->configured || !popup_surface->mapped) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
double popup_sx, popup_sy;
|
|
||||||
wlr_xdg_popup_get_position(popup, &popup_sx, &popup_sy);
|
|
||||||
|
|
||||||
surface_for_each_mapped_surface(
|
|
||||||
popup_surface->surface,
|
|
||||||
x + popup_sx,
|
|
||||||
y + popup_sy,
|
|
||||||
callback,
|
|
||||||
user_data);
|
|
||||||
xdg_surface_for_each_mapped_popup_surface(
|
|
||||||
popup_surface, x + popup_sx, y + popup_sy, callback, user_data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
xdg_shell_view_for_each_mapped_surface(
|
|
||||||
struct kiwmi_view *view,
|
struct kiwmi_view *view,
|
||||||
wlr_surface_iterator_func_t callback,
|
wlr_surface_iterator_func_t callback,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
if (!view->mapped) {
|
wlr_xdg_surface_for_each_surface(view->xdg_surface, callback, user_data);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Have to copy over the wlroots implementation with only small changes
|
|
||||||
surface_for_each_mapped_surface(
|
|
||||||
view->xdg_surface->surface, 0, 0, callback, user_data);
|
|
||||||
xdg_surface_for_each_mapped_popup_surface(
|
|
||||||
view->xdg_surface, 0, 0, callback, user_data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static pid_t
|
static pid_t
|
||||||
|
@ -438,14 +361,14 @@ xdg_shell_view_surface_at(
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct kiwmi_view_impl xdg_shell_view_impl = {
|
static const struct kiwmi_view_impl xdg_shell_view_impl = {
|
||||||
.close = xdg_shell_view_close,
|
.close = xdg_shell_view_close,
|
||||||
.for_each_mapped_surface = xdg_shell_view_for_each_mapped_surface,
|
.for_each_surface = xdg_shell_view_for_each_surface,
|
||||||
.get_pid = xdg_shell_view_get_pid,
|
.get_pid = xdg_shell_view_get_pid,
|
||||||
.get_string_prop = xdg_shell_view_get_string_prop,
|
.get_string_prop = xdg_shell_view_get_string_prop,
|
||||||
.set_activated = xdg_shell_view_set_activated,
|
.set_activated = xdg_shell_view_set_activated,
|
||||||
.set_size = xdg_shell_view_set_size,
|
.set_size = xdg_shell_view_set_size,
|
||||||
.set_tiled = xdg_shell_view_set_tiled,
|
.set_tiled = xdg_shell_view_set_tiled,
|
||||||
.surface_at = xdg_shell_view_surface_at,
|
.surface_at = xdg_shell_view_surface_at,
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue