Merge branch 'master' into heghe/wl_list

This commit is contained in:
Drew DeVault 2017-10-21 22:03:29 -04:00
commit 16f35ecbea
41 changed files with 263 additions and 157 deletions

View file

@ -21,7 +21,7 @@ static void wl_output_send_to_resource(struct wl_resource *resource) {
assert(output);
const uint32_t version = wl_resource_get_version(resource);
if (version >= WL_OUTPUT_GEOMETRY_SINCE_VERSION) {
wl_output_send_geometry(resource, 0, 0, // TODO: get position from layout?
wl_output_send_geometry(resource, output->lx, output->ly,
output->phys_width, output->phys_height, output->subpixel,
output->make, output->model, output->transform);
}
@ -122,6 +122,20 @@ void wlr_output_transform(struct wlr_output *output,
wlr_output_update_matrix(output);
}
void wlr_output_set_position(struct wlr_output *output, int32_t lx, int32_t ly) {
if (lx == output->lx && ly == output->ly) {
return;
}
output->lx = lx;
output->ly = ly;
struct wl_resource *resource;
wl_resource_for_each(resource, &output->wl_resources) {
wl_output_send_to_resource(resource);
}
}
static bool set_cursor(struct wlr_output *output, const uint8_t *buf,
int32_t stride, uint32_t width, uint32_t height, int32_t hotspot_x,
int32_t hotspot_y) {
@ -139,8 +153,7 @@ static bool set_cursor(struct wlr_output *output, const uint8_t *buf,
output->cursor.height = height;
if (!output->cursor.renderer) {
/* NULL egl is okay given that we are only using pixel buffers */
output->cursor.renderer = wlr_gles2_renderer_create(NULL);
output->cursor.renderer = wlr_gles2_renderer_create(output->backend);
if (!output->cursor.renderer) {
return false;
}
@ -293,8 +306,9 @@ bool wlr_output_move_cursor(struct wlr_output *output, int x, int y) {
return output->impl->move_cursor(output, x, y);
}
void wlr_output_init(struct wlr_output *output,
void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend,
const struct wlr_output_impl *impl) {
output->backend = backend;
output->impl = impl;
wl_list_init(&output->modes);
output->transform = WL_OUTPUT_TRANSFORM_NORMAL;

View file

@ -115,6 +115,10 @@ static void wlr_output_layout_reconfigure(struct wlr_output_layout *layout) {
max_x += box->width;
}
wl_list_for_each(l_output, &layout->outputs, link) {
wlr_output_set_position(l_output->output, l_output->x, l_output->y);
}
wl_signal_emit(&layout->events.change, layout);
}

View file

@ -635,17 +635,13 @@ void wlr_seat_attach_keyboard(struct wlr_seat *seat,
calloc(1, sizeof(struct wlr_seat_keyboard));
seat_kb->keyboard = kb;
seat_kb->seat = seat;
wl_list_init(&seat_kb->key.link);
seat_kb->key.notify = keyboard_key_notify;
wl_signal_add(&kb->events.key, &seat_kb->key);
wl_list_init(&seat_kb->modifiers.link);
seat_kb->modifiers.notify = keyboard_modifiers_notify;
wl_signal_add(&kb->events.modifiers, &seat_kb->modifiers);
wl_list_init(&seat_kb->keymap.link);
seat_kb->keymap.notify = keyboard_keymap_notify;
wl_signal_add(&kb->events.keymap, &seat_kb->keymap);
// TODO: update keymap as necessary
wl_list_init(&seat_kb->destroy.link);
seat_kb->destroy.notify = keyboard_destroy_notify;
wl_signal_add(&dev->events.destroy, &seat_kb->destroy);
wl_list_insert(&seat->keyboards, &seat_kb->link);

View file

@ -2,9 +2,9 @@
#include <stdlib.h>
#include <wayland-server.h>
#include <wlr/util/log.h>
#include <wlr/egl.h>
#include <wlr/render/interface.h>
#include <wlr/types/wlr_surface.h>
#include <wlr/render/egl.h>
#include <wlr/render/matrix.h>
static void wlr_surface_state_reset_buffer(struct wlr_surface_state *state) {