mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 01:50:42 -05:00
MetaWindow: Make buffer_rect and rect share coordinate space
Before this commit, on Wayland, the buffer rect would have the size of the attached Wayland buffer, no matter the scale. The scale would then be applied ad-hoc by callers when a sane rectangle was needed. This commit changes buffer_rect to rather represent the surface rect (i.e. what is drawn on the stage, including client side shadow). The users of buffer_rect will no longer need to scale the buffer_rect themself to get a usable rectangle. https://bugzilla.gnome.org/show_bug.cgi?id=763431
This commit is contained in:
parent
ca44770f1a
commit
bca041b68e
@ -612,20 +612,6 @@ meta_window_actor_get_shape_bounds (MetaWindowActor *self,
|
|||||||
MetaWindowActorPrivate *priv = self->priv;
|
MetaWindowActorPrivate *priv = self->priv;
|
||||||
|
|
||||||
cairo_region_get_extents (priv->shape_region, bounds);
|
cairo_region_get_extents (priv->shape_region, bounds);
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND
|
|
||||||
if (META_IS_SURFACE_ACTOR_WAYLAND (priv->surface))
|
|
||||||
{
|
|
||||||
MetaSurfaceActorWayland *surface_actor =
|
|
||||||
META_SURFACE_ACTOR_WAYLAND (priv->surface);
|
|
||||||
double scale = meta_surface_actor_wayland_get_scale (surface_actor);
|
|
||||||
|
|
||||||
bounds->x *= scale;
|
|
||||||
bounds->y *= scale;
|
|
||||||
bounds->width *= scale;
|
|
||||||
bounds->height *= scale;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -416,8 +416,10 @@ struct _MetaWindow
|
|||||||
*
|
*
|
||||||
* For X11 windows, this matches XGetGeometry of the toplevel.
|
* For X11 windows, this matches XGetGeometry of the toplevel.
|
||||||
*
|
*
|
||||||
* For Wayland windows, this matches the buffer size and where
|
* For Wayland windows, the position matches the position of the
|
||||||
* the surface actor is positioned. */
|
* surface associated with shell surface (wl_shell_surface, xdg_surface
|
||||||
|
* etc). The size matches the size surface size as displayed in the stage.
|
||||||
|
*/
|
||||||
MetaRectangle buffer_rect;
|
MetaRectangle buffer_rect;
|
||||||
|
|
||||||
/* Cached net_wm_icon_geometry */
|
/* Cached net_wm_icon_geometry */
|
||||||
|
@ -361,12 +361,16 @@ void
|
|||||||
meta_wayland_surface_apply_window_state (MetaWaylandSurface *surface,
|
meta_wayland_surface_apply_window_state (MetaWaylandSurface *surface,
|
||||||
MetaWaylandPendingState *pending)
|
MetaWaylandPendingState *pending)
|
||||||
{
|
{
|
||||||
|
MetaSurfaceActorWayland *actor =
|
||||||
|
META_SURFACE_ACTOR_WAYLAND (surface->surface_actor);
|
||||||
MetaWindow *window = surface->window;
|
MetaWindow *window = surface->window;
|
||||||
MetaWaylandBuffer *buffer = surface->buffer_ref.buffer;
|
MetaWaylandBuffer *buffer = surface->buffer_ref.buffer;
|
||||||
CoglTexture *texture = buffer->texture;
|
CoglTexture *texture = buffer->texture;
|
||||||
|
double scale;
|
||||||
|
|
||||||
window->buffer_rect.width = cogl_texture_get_width (texture);
|
scale = meta_surface_actor_wayland_get_scale (actor);
|
||||||
window->buffer_rect.height = cogl_texture_get_height (texture);
|
window->buffer_rect.width = cogl_texture_get_width (texture) * scale;
|
||||||
|
window->buffer_rect.height = cogl_texture_get_height (texture) * scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user