shell-util: Apply resource_scale on clipping when getting the meta texture image
https://bugzilla.gnome.org/show_bug.cgi?id=765011 https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5
This commit is contained in:
parent
6d6c2e5b99
commit
6f027ee7dc
@ -3,6 +3,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <math.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@ -434,14 +435,23 @@ shell_util_get_content_for_window_actor (MetaWindowActor *window_actor,
|
|||||||
cairo_surface_t *surface;
|
cairo_surface_t *surface;
|
||||||
cairo_rectangle_int_t clip;
|
cairo_rectangle_int_t clip;
|
||||||
gfloat actor_x, actor_y;
|
gfloat actor_x, actor_y;
|
||||||
|
gfloat resource_scale;
|
||||||
|
|
||||||
texture = meta_window_actor_get_texture (window_actor);
|
texture = meta_window_actor_get_texture (window_actor);
|
||||||
clutter_actor_get_position (CLUTTER_ACTOR (window_actor), &actor_x, &actor_y);
|
clutter_actor_get_position (CLUTTER_ACTOR (window_actor), &actor_x, &actor_y);
|
||||||
|
|
||||||
|
if (!clutter_actor_get_resource_scale (CLUTTER_ACTOR (window_actor),
|
||||||
|
&resource_scale))
|
||||||
|
{
|
||||||
|
resource_scale = 1.0;
|
||||||
|
g_warning ("Actor resource scale is not know at this point, "
|
||||||
|
"falling back to default 1.0");
|
||||||
|
}
|
||||||
|
|
||||||
clip.x = window_rect->x - (gint) actor_x;
|
clip.x = window_rect->x - (gint) actor_x;
|
||||||
clip.y = window_rect->y - (gint) actor_y;
|
clip.y = window_rect->y - (gint) actor_y;
|
||||||
clip.width = window_rect->width;
|
clip.width = ceilf (window_rect->width * resource_scale);
|
||||||
clip.height = window_rect->height;
|
clip.height = ceilf (window_rect->height * resource_scale);
|
||||||
|
|
||||||
surface = meta_shaped_texture_get_image (META_SHAPED_TEXTURE (texture),
|
surface = meta_shaped_texture_get_image (META_SHAPED_TEXTURE (texture),
|
||||||
&clip);
|
&clip);
|
||||||
|
Loading…
Reference in New Issue
Block a user