Merge branch 'master' into screencontent

This commit is contained in:
emersion 2018-06-17 14:49:18 +01:00
commit 57548b557a
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
43 changed files with 886 additions and 375 deletions

View file

@ -72,6 +72,9 @@ int main(int argc, char **argv) {
}
wl_display_run(server.wl_display);
#ifdef WLR_HAS_XWAYLAND
wlr_xwayland_destroy(server.desktop->xwayland);
#endif
wl_display_destroy_clients(server.wl_display);
wl_display_destroy(server.wl_display);
return 0;

View file

@ -189,7 +189,8 @@ static void render_surface(struct wlr_surface *surface, int sx, int sy,
struct roots_output *output = data->output;
float rotation = data->layout.rotation;
if (!wlr_surface_has_buffer(surface)) {
struct wlr_texture *texture = wlr_surface_get_texture(surface);
if (texture == NULL) {
return;
}
@ -230,8 +231,7 @@ static void render_surface(struct wlr_surface *surface, int sx, int sy,
pixman_box32_t *rects = pixman_region32_rectangles(&damage, &nrects);
for (int i = 0; i < nrects; ++i) {
scissor_output(output, &rects[i]);
wlr_render_texture_with_matrix(renderer, surface->texture, matrix,
data->alpha);
wlr_render_texture_with_matrix(renderer, texture, matrix, data->alpha);
}
damage_finish:

View file

@ -260,7 +260,7 @@ static void roots_drag_icon_handle_surface_commit(struct wl_listener *listener,
void *data) {
struct roots_drag_icon *icon =
wl_container_of(listener, icon, surface_commit);
roots_drag_icon_damage_whole(icon);
roots_drag_icon_update_position(icon);
}
static void roots_drag_icon_handle_map(struct wl_listener *listener,
@ -270,6 +270,13 @@ static void roots_drag_icon_handle_map(struct wl_listener *listener,
roots_drag_icon_damage_whole(icon);
}
static void roots_drag_icon_handle_unmap(struct wl_listener *listener,
void *data) {
struct roots_drag_icon *icon =
wl_container_of(listener, icon, unmap);
roots_drag_icon_damage_whole(icon);
}
static void roots_drag_icon_handle_destroy(struct wl_listener *listener,
void *data) {
struct roots_drag_icon *icon =
@ -278,7 +285,7 @@ static void roots_drag_icon_handle_destroy(struct wl_listener *listener,
wl_list_remove(&icon->link);
wl_list_remove(&icon->surface_commit.link);
wl_list_remove(&icon->map.link);
wl_list_remove(&icon->unmap.link);
wl_list_remove(&icon->destroy.link);
free(icon);
}
@ -297,12 +304,16 @@ static void roots_seat_handle_new_drag_icon(struct wl_listener *listener,
icon->surface_commit.notify = roots_drag_icon_handle_surface_commit;
wl_signal_add(&wlr_drag_icon->surface->events.commit, &icon->surface_commit);
icon->unmap.notify = roots_drag_icon_handle_unmap;
wl_signal_add(&wlr_drag_icon->events.unmap, &icon->unmap);
icon->map.notify = roots_drag_icon_handle_map;
wl_signal_add(&wlr_drag_icon->events.map, &icon->map);
icon->destroy.notify = roots_drag_icon_handle_destroy;
wl_signal_add(&wlr_drag_icon->events.destroy, &icon->destroy);
wl_list_insert(&seat->drag_icons, &icon->link);
roots_drag_icon_update_position(icon);
}
void roots_drag_icon_update_position(struct roots_drag_icon *icon) {

View file

@ -132,14 +132,10 @@ static void get_size(const struct roots_view *view, struct wlr_box *box) {
assert(view->type == ROOTS_XDG_SHELL_VIEW);
struct wlr_xdg_surface *surface = view->xdg_surface;
if (surface->geometry.width > 0 && surface->geometry.height > 0) {
box->width = surface->geometry.width;
box->height = surface->geometry.height;
} else {
assert(surface->surface);
box->width = surface->surface->current->width;
box->height = surface->surface->current->height;
}
struct wlr_box geo_box;
wlr_xdg_surface_get_geometry(surface, &geo_box);
box->width = geo_box.width;
box->height = geo_box.height;
}
static void activate(struct roots_view *view, bool active) {

View file

@ -133,14 +133,10 @@ static void get_size(const struct roots_view *view, struct wlr_box *box) {
assert(view->type == ROOTS_XDG_SHELL_V6_VIEW);
struct wlr_xdg_surface_v6 *surface = view->xdg_surface_v6;
if (surface->geometry.width > 0 && surface->geometry.height > 0) {
box->width = surface->geometry.width;
box->height = surface->geometry.height;
} else {
assert(surface->surface);
box->width = surface->surface->current->width;
box->height = surface->surface->current->height;
}
struct wlr_box geo_box;
wlr_xdg_surface_v6_get_geometry(surface, &geo_box);
box->width = geo_box.width;
box->height = geo_box.height;
}
static void activate(struct roots_view *view, bool active) {