|
|
@ -34,7 +34,10 @@ static void rotate_child_position(double *sx, double *sy, double sw, double sh,
|
|
|
|
static void render_surface(struct wlr_surface *surface,
|
|
|
|
static void render_surface(struct wlr_surface *surface,
|
|
|
|
struct roots_desktop *desktop, struct wlr_output *wlr_output,
|
|
|
|
struct roots_desktop *desktop, struct wlr_output *wlr_output,
|
|
|
|
struct timespec *when, double lx, double ly, float rotation) {
|
|
|
|
struct timespec *when, double lx, double ly, float rotation) {
|
|
|
|
if (wlr_surface_has_buffer(surface)) {
|
|
|
|
if (!wlr_surface_has_buffer(surface)) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int width = surface->current->width;
|
|
|
|
int width = surface->current->width;
|
|
|
|
int height = surface->current->height;
|
|
|
|
int height = surface->current->height;
|
|
|
|
int render_width = width * wlr_output->scale;
|
|
|
|
int render_width = width * wlr_output->scale;
|
|
|
@ -44,8 +47,11 @@ static void render_surface(struct wlr_surface *surface,
|
|
|
|
ox *= wlr_output->scale;
|
|
|
|
ox *= wlr_output->scale;
|
|
|
|
oy *= wlr_output->scale;
|
|
|
|
oy *= wlr_output->scale;
|
|
|
|
|
|
|
|
|
|
|
|
if (wlr_output_layout_intersects(desktop->layout, wlr_output,
|
|
|
|
struct wlr_box render_box = {
|
|
|
|
lx, ly, lx + render_width, ly + render_height)) {
|
|
|
|
.x = lx, .y = ly,
|
|
|
|
|
|
|
|
.width = render_width, .height = render_height,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
if (wlr_output_layout_intersects(desktop->layout, wlr_output, &render_box)) {
|
|
|
|
float matrix[16];
|
|
|
|
float matrix[16];
|
|
|
|
|
|
|
|
|
|
|
|
float translate_center[16];
|
|
|
|
float translate_center[16];
|
|
|
@ -108,7 +114,6 @@ static void render_surface(struct wlr_surface *surface,
|
|
|
|
rotation);
|
|
|
|
rotation);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void render_xdg_v6_popups(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
static void render_xdg_v6_popups(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
struct roots_desktop *desktop, struct wlr_output *wlr_output,
|
|
|
|
struct roots_desktop *desktop, struct wlr_output *wlr_output,
|
|
|
@ -356,7 +361,9 @@ void output_add_notify(struct wl_listener *listener, void *data) {
|
|
|
|
|
|
|
|
|
|
|
|
void output_remove_notify(struct wl_listener *listener, void *data) {
|
|
|
|
void output_remove_notify(struct wl_listener *listener, void *data) {
|
|
|
|
struct wlr_output *wlr_output = data;
|
|
|
|
struct wlr_output *wlr_output = data;
|
|
|
|
struct roots_desktop *desktop = wl_container_of(listener, desktop, output_remove);
|
|
|
|
struct roots_desktop *desktop =
|
|
|
|
|
|
|
|
wl_container_of(listener, desktop, output_remove);
|
|
|
|
|
|
|
|
|
|
|
|
struct roots_output *output = NULL, *_output;
|
|
|
|
struct roots_output *output = NULL, *_output;
|
|
|
|
wl_list_for_each(_output, &desktop->outputs, link) {
|
|
|
|
wl_list_for_each(_output, &desktop->outputs, link) {
|
|
|
|
if (_output->wlr_output == wlr_output) {
|
|
|
|
if (_output->wlr_output == wlr_output) {
|
|
|
@ -367,10 +374,13 @@ void output_remove_notify(struct wl_listener *listener, void *data) {
|
|
|
|
if (!output) {
|
|
|
|
if (!output) {
|
|
|
|
return; // We are unfamiliar with this output
|
|
|
|
return; // We are unfamiliar with this output
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wlr_output_layout_remove(desktop->layout, output->wlr_output);
|
|
|
|
wlr_output_layout_remove(desktop->layout, output->wlr_output);
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: cursor
|
|
|
|
// TODO: cursor
|
|
|
|
//example_config_configure_cursor(sample->config, sample->cursor,
|
|
|
|
//example_config_configure_cursor(sample->config, sample->cursor,
|
|
|
|
// sample->compositor);
|
|
|
|
// sample->compositor);
|
|
|
|
|
|
|
|
|
|
|
|
wl_list_remove(&output->link);
|
|
|
|
wl_list_remove(&output->link);
|
|
|
|
wl_list_remove(&output->frame.link);
|
|
|
|
wl_list_remove(&output->frame.link);
|
|
|
|
free(output);
|
|
|
|
free(output);
|
|
|
|