mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-17 06:46:39 -04:00
Merge branch 'backport-0.20.1' into '0.20'
0.20.1 backports See merge request wlroots/wlroots!5325
This commit is contained in:
commit
35b243a299
8 changed files with 37 additions and 27 deletions
|
|
@ -159,6 +159,7 @@ static void render_pass_add_texture(struct wlr_render_pass *wlr_pass,
|
|||
|
||||
switch (options->filter_mode) {
|
||||
case WLR_SCALE_FILTER_BILINEAR:
|
||||
pixman_image_set_repeat(texture->image, PIXMAN_REPEAT_PAD);
|
||||
pixman_image_set_filter(texture->image, PIXMAN_FILTER_BILINEAR, NULL, 0);
|
||||
break;
|
||||
case WLR_SCALE_FILTER_NEAREST:
|
||||
|
|
|
|||
|
|
@ -34,18 +34,13 @@ static void foreign_toplevel_manager_handle_create_source(struct wl_client *clie
|
|||
return;
|
||||
}
|
||||
|
||||
struct wlr_ext_foreign_toplevel_image_capture_source_manager_v1_request *request =
|
||||
calloc(1, sizeof(*request));
|
||||
if (request == NULL) {
|
||||
wl_resource_post_no_memory(manager_resource);
|
||||
return;
|
||||
}
|
||||
struct wlr_ext_foreign_toplevel_image_capture_source_manager_v1_request request = {
|
||||
.toplevel_handle = toplevel_handle,
|
||||
.client = client,
|
||||
.new_id = new_id,
|
||||
};
|
||||
|
||||
request->toplevel_handle = toplevel_handle;
|
||||
request->client = client;
|
||||
request->new_id = new_id;
|
||||
|
||||
wl_signal_emit_mutable(&manager->events.new_request, request);
|
||||
wl_signal_emit_mutable(&manager->events.new_request, &request);
|
||||
}
|
||||
|
||||
static void foreign_toplevel_manager_handle_destroy(struct wl_client *client,
|
||||
|
|
|
|||
|
|
@ -34,13 +34,14 @@ struct scene_node_source_frame_event {
|
|||
|
||||
static size_t last_output_num = 0;
|
||||
|
||||
static void _get_scene_node_extents(struct wlr_scene_node *node, struct wlr_box *box, int lx, int ly) {
|
||||
static void _get_scene_node_extents(struct wlr_scene_node *node, int lx, int ly,
|
||||
int *x_min, int *y_min, int *x_max, int *y_max) {
|
||||
switch (node->type) {
|
||||
case WLR_SCENE_NODE_TREE:;
|
||||
struct wlr_scene_tree *scene_tree = wlr_scene_tree_from_node(node);
|
||||
struct wlr_scene_node *child;
|
||||
wl_list_for_each(child, &scene_tree->children, link) {
|
||||
_get_scene_node_extents(child, box, lx + child->x, ly + child->y);
|
||||
_get_scene_node_extents(child, lx + child->x, ly + child->y, x_min, y_min, x_max, y_max);
|
||||
}
|
||||
break;
|
||||
case WLR_SCENE_NODE_RECT:
|
||||
|
|
@ -48,27 +49,30 @@ static void _get_scene_node_extents(struct wlr_scene_node *node, struct wlr_box
|
|||
struct wlr_box node_box = { .x = lx, .y = ly };
|
||||
scene_node_get_size(node, &node_box.width, &node_box.height);
|
||||
|
||||
if (node_box.x < box->x) {
|
||||
box->x = node_box.x;
|
||||
if (node_box.x < *x_min) {
|
||||
*x_min = node_box.x;
|
||||
}
|
||||
if (node_box.y < box->y) {
|
||||
box->y = node_box.y;
|
||||
if (node_box.y < *y_min) {
|
||||
*y_min = node_box.y;
|
||||
}
|
||||
if (node_box.x + node_box.width > box->x + box->width) {
|
||||
box->width = node_box.x + node_box.width - box->x;
|
||||
if (node_box.x + node_box.width > *x_max) {
|
||||
*x_max = node_box.x + node_box.width;
|
||||
}
|
||||
if (node_box.y + node_box.height > box->y + box->height) {
|
||||
box->height = node_box.y + node_box.height - box->y;
|
||||
if (node_box.y + node_box.height > *y_max) {
|
||||
*y_max = node_box.y + node_box.height;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void get_scene_node_extents(struct wlr_scene_node *node, struct wlr_box *box) {
|
||||
*box = (struct wlr_box){ .x = INT_MAX, .y = INT_MAX };
|
||||
int lx = 0, ly = 0;
|
||||
wlr_scene_node_coords(node, &lx, &ly);
|
||||
_get_scene_node_extents(node, box, lx, ly);
|
||||
*box = (struct wlr_box){ .x = INT_MAX, .y = INT_MAX };
|
||||
int x_max = INT_MIN, y_max = INT_MIN;
|
||||
_get_scene_node_extents(node, lx, ly, &box->x, &box->y, &x_max, &y_max);
|
||||
box->width = x_max - box->x;
|
||||
box->height = y_max - box->y;
|
||||
}
|
||||
|
||||
static void source_render(struct scene_node_source *source) {
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ wlr_ext_foreign_toplevel_handle_v1_create(struct wlr_ext_foreign_toplevel_list_v
|
|||
return NULL;
|
||||
}
|
||||
|
||||
wl_list_insert(&list->toplevels, &toplevel->link);
|
||||
wl_list_insert(list->toplevels.prev, &toplevel->link);
|
||||
toplevel->list = list;
|
||||
if (state->app_id) {
|
||||
toplevel->app_id = strdup(state->app_id);
|
||||
|
|
|
|||
|
|
@ -790,7 +790,7 @@ struct wlr_ext_workspace_handle_v1 *wlr_ext_workspace_handle_v1_create(
|
|||
wl_array_init(&workspace->coordinates);
|
||||
wl_signal_init(&workspace->events.destroy);
|
||||
|
||||
wl_list_insert(&manager->workspaces, &workspace->link);
|
||||
wl_list_insert(manager->workspaces.prev, &workspace->link);
|
||||
|
||||
struct wlr_ext_workspace_manager_v1_resource *manager_res;
|
||||
wl_list_for_each(manager_res, &manager->resources, link) {
|
||||
|
|
|
|||
|
|
@ -530,7 +530,7 @@ wlr_foreign_toplevel_handle_v1_create(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
wl_list_insert(&manager->toplevels, &toplevel->link);
|
||||
wl_list_insert(manager->toplevels.prev, &toplevel->link);
|
||||
toplevel->manager = manager;
|
||||
|
||||
wl_list_init(&toplevel->resources);
|
||||
|
|
|
|||
|
|
@ -84,6 +84,16 @@ void wlr_keyboard_notify_modifiers(struct wlr_keyboard *keyboard,
|
|||
uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked,
|
||||
uint32_t group) {
|
||||
if (keyboard->xkb_state == NULL) {
|
||||
if (keyboard->modifiers.depressed != mods_depressed ||
|
||||
keyboard->modifiers.latched != mods_latched ||
|
||||
keyboard->modifiers.locked != mods_locked ||
|
||||
keyboard->modifiers.group != group) {
|
||||
keyboard->modifiers.depressed = mods_depressed;
|
||||
keyboard->modifiers.latched = mods_latched;
|
||||
keyboard->modifiers.locked = mods_locked;
|
||||
keyboard->modifiers.group = group;
|
||||
wl_signal_emit_mutable(&keyboard->events.modifiers, keyboard);
|
||||
}
|
||||
return;
|
||||
}
|
||||
xkb_state_update_mask(keyboard->xkb_state, mods_depressed, mods_latched,
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ static void virtual_keyboard_keymap(struct wl_client *client,
|
|||
if (data == MAP_FAILED) {
|
||||
goto fd_fail;
|
||||
}
|
||||
struct xkb_keymap *keymap = xkb_keymap_new_from_string(context, data,
|
||||
struct xkb_keymap *keymap = xkb_keymap_new_from_buffer(context, data, size,
|
||||
XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
|
||||
munmap(data, size);
|
||||
if (!keymap) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue