mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-24 21:37:30 -04:00
opt: opitmize subtree surface scale in overview
This commit is contained in:
parent
096ef0bf41
commit
406a16033b
3 changed files with 71 additions and 15 deletions
|
|
@ -243,11 +243,31 @@ void scene_buffer_apply_overview_effect(struct wlr_scene_buffer *buffer,
|
|||
int32_t sx, int32_t sy, void *data) {
|
||||
BufferData *buffer_data = (BufferData *)data;
|
||||
|
||||
if (buffer_data->width > 0 && buffer_data->height > 0) {
|
||||
wlr_scene_buffer_set_dest_size(buffer, buffer_data->width,
|
||||
buffer_data->height);
|
||||
if (buffer_data->width_scale >= 1.0 || buffer_data->height_scale >= 1.0)
|
||||
return;
|
||||
|
||||
int32_t surface_width = 0;
|
||||
int32_t surface_height = 0;
|
||||
bool is_subsurface = false;
|
||||
|
||||
struct wlr_scene_tree *parent_tree = buffer->node.parent;
|
||||
if (parent_tree->node.data != NULL) {
|
||||
SnapshotMetadata *meta = (SnapshotMetadata *)parent_tree->node.data;
|
||||
surface_width = meta->orig_width;
|
||||
surface_height = meta->orig_height;
|
||||
is_subsurface = meta->is_subsurface;
|
||||
}
|
||||
|
||||
surface_height = surface_height * buffer_data->height_scale;
|
||||
surface_width = surface_width * buffer_data->width_scale;
|
||||
|
||||
if (buffer_data->width > 0 && buffer_data->height > 0) {
|
||||
wlr_scene_buffer_set_dest_size(buffer, surface_width, surface_height);
|
||||
}
|
||||
|
||||
if (is_subsurface)
|
||||
return;
|
||||
|
||||
wlr_scene_buffer_set_corner_radius(buffer, config.border_radius,
|
||||
buffer_data->corner_location);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue