2013-08-30 12:03:30 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
* 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef META_WAYLAND_SURFACE_H
|
|
|
|
#define META_WAYLAND_SURFACE_H
|
|
|
|
|
2018-07-10 04:36:24 -04:00
|
|
|
#include <cairo.h>
|
|
|
|
#include <glib.h>
|
2013-08-30 12:03:30 -04:00
|
|
|
#include <wayland-server.h>
|
|
|
|
#include <xkbcommon/xkbcommon.h>
|
|
|
|
|
2015-07-08 04:14:00 -04:00
|
|
|
#include "backends/meta-monitor-manager-private.h"
|
2018-07-10 04:36:24 -04:00
|
|
|
#include "clutter/clutter.h"
|
2018-11-26 13:40:57 -05:00
|
|
|
#include "compositor/meta-shaped-texture-private.h"
|
2018-07-10 04:36:24 -04:00
|
|
|
#include "compositor/meta-surface-actor.h"
|
|
|
|
#include "meta/meta-cursor-tracker.h"
|
|
|
|
#include "wayland/meta-wayland-pointer-constraints.h"
|
|
|
|
#include "wayland/meta-wayland-types.h"
|
2015-07-08 04:14:00 -04:00
|
|
|
|
|
|
|
typedef struct _MetaWaylandPendingState MetaWaylandPendingState;
|
2013-08-30 12:03:30 -04:00
|
|
|
|
2015-07-07 23:21:23 -04:00
|
|
|
#define META_TYPE_WAYLAND_SURFACE (meta_wayland_surface_get_type ())
|
|
|
|
G_DECLARE_FINAL_TYPE (MetaWaylandSurface,
|
|
|
|
meta_wayland_surface,
|
|
|
|
META, WAYLAND_SURFACE,
|
|
|
|
GObject);
|
|
|
|
|
2015-07-08 04:14:00 -04:00
|
|
|
#define META_TYPE_WAYLAND_SURFACE_ROLE (meta_wayland_surface_role_get_type ())
|
|
|
|
G_DECLARE_DERIVABLE_TYPE (MetaWaylandSurfaceRole, meta_wayland_surface_role,
|
|
|
|
META, WAYLAND_SURFACE_ROLE, GObject);
|
|
|
|
|
2015-12-14 04:13:35 -05:00
|
|
|
#define META_TYPE_WAYLAND_PENDING_STATE (meta_wayland_pending_state_get_type ())
|
|
|
|
G_DECLARE_FINAL_TYPE (MetaWaylandPendingState,
|
|
|
|
meta_wayland_pending_state,
|
|
|
|
META, WAYLAND_PENDING_STATE,
|
|
|
|
GObject);
|
|
|
|
|
2015-07-08 04:14:00 -04:00
|
|
|
struct _MetaWaylandSurfaceRoleClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
|
|
|
|
void (*assigned) (MetaWaylandSurfaceRole *surface_role);
|
2016-03-16 02:55:51 -04:00
|
|
|
void (*pre_commit) (MetaWaylandSurfaceRole *surface_role,
|
|
|
|
MetaWaylandPendingState *pending);
|
2015-07-08 04:14:00 -04:00
|
|
|
void (*commit) (MetaWaylandSurfaceRole *surface_role,
|
|
|
|
MetaWaylandPendingState *pending);
|
2016-11-25 01:38:28 -05:00
|
|
|
gboolean (*is_on_logical_monitor) (MetaWaylandSurfaceRole *surface_role,
|
|
|
|
MetaLogicalMonitor *logical_monitor);
|
2016-01-14 04:43:47 -05:00
|
|
|
MetaWaylandSurface * (*get_toplevel) (MetaWaylandSurfaceRole *surface_role);
|
2015-07-08 04:14:00 -04:00
|
|
|
};
|
|
|
|
|
wayland-surface: Don't do pending move/resizes on all commits
We assume in meta_window_wayland_move_resize that the next commit that
changes the geometry will always be for our next pending operation, so
if we have a move pending on a resize, the next commit will trigger the
move. This is, of course, fundamentally wrong.
We broke this assumption even more now that we don't fizzle out calls to
meta_window_move_resize_internal and now call it on every commit, which
means that a simple damage and then commit would complete a pending
move.
This was even broken by apps like weston-terminal, which, when clicking
on the maximize button, first redraws the terminal with the maximize
button state back on hover on press, and would only redraw when it got
the configure event with the coordinates.
To track the correct commit to apply the move for, we implement the
ack_configure request and ignore all move/resizes that happen before
that.
Right now, we actually fizzle out the entire move/resize if there's a
future pending configure we're waiting on.
2014-07-27 11:23:17 -04:00
|
|
|
struct _MetaWaylandSerial {
|
|
|
|
gboolean set;
|
|
|
|
uint32_t value;
|
|
|
|
};
|
|
|
|
|
2015-07-08 04:14:00 -04:00
|
|
|
struct _MetaWaylandPendingState
|
2013-08-30 12:03:30 -04:00
|
|
|
{
|
2015-12-14 04:13:35 -05:00
|
|
|
GObject parent;
|
|
|
|
|
2013-08-30 12:03:30 -04:00
|
|
|
/* wl_surface.attach */
|
|
|
|
gboolean newly_attached;
|
|
|
|
MetaWaylandBuffer *buffer;
|
2016-03-15 00:46:06 -04:00
|
|
|
gulong buffer_destroy_handler_id;
|
2013-09-03 06:00:29 -04:00
|
|
|
int32_t dx;
|
|
|
|
int32_t dy;
|
2013-08-30 12:03:30 -04:00
|
|
|
|
2014-04-26 04:27:34 -04:00
|
|
|
int scale;
|
|
|
|
|
2013-08-30 12:03:30 -04:00
|
|
|
/* wl_surface.damage */
|
2017-06-05 08:08:04 -04:00
|
|
|
cairo_region_t *surface_damage;
|
|
|
|
/* wl_surface.damage_buffer */
|
|
|
|
cairo_region_t *buffer_damage;
|
2013-08-30 12:03:30 -04:00
|
|
|
|
|
|
|
cairo_region_t *input_region;
|
2015-08-04 02:58:26 -04:00
|
|
|
gboolean input_region_set;
|
2013-08-30 12:03:30 -04:00
|
|
|
cairo_region_t *opaque_region;
|
2015-08-04 02:58:26 -04:00
|
|
|
gboolean opaque_region_set;
|
2013-08-30 12:03:30 -04:00
|
|
|
|
|
|
|
/* wl_surface.frame */
|
|
|
|
struct wl_list frame_callback_list;
|
2014-02-09 18:23:07 -05:00
|
|
|
|
2014-07-17 14:07:38 -04:00
|
|
|
MetaRectangle new_geometry;
|
|
|
|
gboolean has_new_geometry;
|
2016-04-06 08:07:08 -04:00
|
|
|
|
|
|
|
/* pending min/max size in window geometry coordinates */
|
|
|
|
gboolean has_new_min_size;
|
|
|
|
int new_min_width;
|
|
|
|
int new_min_height;
|
|
|
|
gboolean has_new_max_size;
|
|
|
|
int new_max_width;
|
|
|
|
int new_max_height;
|
2018-11-26 13:40:57 -05:00
|
|
|
|
|
|
|
gboolean has_new_buffer_transform;
|
|
|
|
MetaMonitorTransform buffer_transform;
|
2018-11-24 14:25:38 -05:00
|
|
|
gboolean has_new_viewport_src_rect;
|
2019-02-20 10:23:04 -05:00
|
|
|
graphene_rect_t viewport_src_rect;
|
2018-11-24 14:25:38 -05:00
|
|
|
gboolean has_new_viewport_dst_size;
|
|
|
|
int viewport_dst_width;
|
|
|
|
int viewport_dst_height;
|
2015-07-08 04:14:00 -04:00
|
|
|
};
|
2013-08-30 03:40:36 -04:00
|
|
|
|
2015-05-18 07:24:27 -04:00
|
|
|
struct _MetaWaylandDragDestFuncs
|
|
|
|
{
|
|
|
|
void (* focus_in) (MetaWaylandDataDevice *data_device,
|
|
|
|
MetaWaylandSurface *surface,
|
|
|
|
MetaWaylandDataOffer *offer);
|
|
|
|
void (* focus_out) (MetaWaylandDataDevice *data_device,
|
|
|
|
MetaWaylandSurface *surface);
|
|
|
|
void (* motion) (MetaWaylandDataDevice *data_device,
|
|
|
|
MetaWaylandSurface *surface,
|
|
|
|
const ClutterEvent *event);
|
|
|
|
void (* drop) (MetaWaylandDataDevice *data_device,
|
|
|
|
MetaWaylandSurface *surface);
|
2015-09-28 08:16:20 -04:00
|
|
|
void (* update) (MetaWaylandDataDevice *data_device,
|
|
|
|
MetaWaylandSurface *surface);
|
2015-05-18 07:24:27 -04:00
|
|
|
};
|
|
|
|
|
2013-08-30 12:03:30 -04:00
|
|
|
struct _MetaWaylandSurface
|
|
|
|
{
|
2015-07-07 23:21:23 -04:00
|
|
|
GObject parent;
|
|
|
|
|
2014-10-06 23:15:18 -04:00
|
|
|
/* Generic stuff */
|
2013-08-30 12:03:30 -04:00
|
|
|
struct wl_resource *resource;
|
|
|
|
MetaWaylandCompositor *compositor;
|
2015-07-08 04:14:00 -04:00
|
|
|
MetaWaylandSurfaceRole *role;
|
2013-08-30 12:03:30 -04:00
|
|
|
MetaWindow *window;
|
2015-03-02 09:56:35 -05:00
|
|
|
cairo_region_t *input_region;
|
|
|
|
cairo_region_t *opaque_region;
|
2014-10-06 23:15:18 -04:00
|
|
|
int scale;
|
|
|
|
int32_t offset_x, offset_y;
|
2019-06-30 09:18:46 -04:00
|
|
|
GNode *subsurface_branch_node;
|
|
|
|
GNode *subsurface_leaf_node;
|
2015-10-14 00:33:15 -04:00
|
|
|
GHashTable *outputs_to_destroy_notify_id;
|
2018-11-26 13:40:57 -05:00
|
|
|
MetaMonitorTransform buffer_transform;
|
2014-10-06 23:15:18 -04:00
|
|
|
|
wayland: Move surface texture ownership to MetaWaylandSurface
Prior to this commit, MetaWaylandSurface held a reference to
MetaWaylandBuffer, who owned the texture drawn by the surface. When
switching buffer, the texture change with it.
This is problematic when dealing with SHM buffer damage management, as
when having one texture per buffer, damaged regions uploaded to one,
will not follow along to the next one attached. It also wasted GPU
memory as there would be one texture per buffer, instead of one one
texture per surface.
Instead, move the texture ownership to MetaWaylandSurface, and have the
SHM buffer damage management update the surface texture. This ensures
damage is processed properly, and that we won't end up with stale
texture content when doing partial texture uploads. If the same SHM
buffer is attached to multiple surfaces, each surface will get their own
copy, and damage is tracked and uploaded separately.
Non-SHM types of buffers still has their own texture reference, as the
texture is just a representation of the GPU memory associated with the
buffer. When such a buffer is attached to a surface, instead the surface
just gets a reference to that texture, instead of a separately allocated
one.
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/199
2019-02-08 05:46:48 -05:00
|
|
|
CoglTexture *texture;
|
|
|
|
|
2016-03-16 02:47:53 -04:00
|
|
|
/* Buffer reference state. */
|
|
|
|
struct {
|
|
|
|
MetaWaylandBuffer *buffer;
|
|
|
|
unsigned int use_count;
|
|
|
|
} buffer_ref;
|
|
|
|
|
|
|
|
/* Buffer renderer state. */
|
|
|
|
gboolean buffer_held;
|
|
|
|
|
2015-08-18 23:06:46 -04:00
|
|
|
/* List of pending frame callbacks that needs to stay queued longer than one
|
|
|
|
* commit sequence, such as when it has not yet been assigned a role.
|
|
|
|
*/
|
|
|
|
struct wl_list pending_frame_callback_list;
|
|
|
|
|
2016-03-16 02:55:51 -04:00
|
|
|
/* Intermediate state for when no role has been assigned. */
|
|
|
|
struct {
|
|
|
|
MetaWaylandBuffer *buffer;
|
|
|
|
} unassigned;
|
|
|
|
|
2015-05-18 07:24:27 -04:00
|
|
|
struct {
|
|
|
|
const MetaWaylandDragDestFuncs *funcs;
|
|
|
|
} dnd;
|
|
|
|
|
2014-10-06 23:15:18 -04:00
|
|
|
/* All the pending state that wl_surface.commit will apply. */
|
2015-12-14 04:13:35 -05:00
|
|
|
MetaWaylandPendingState *pending;
|
2014-10-06 23:15:18 -04:00
|
|
|
|
2014-10-07 13:44:16 -04:00
|
|
|
/* Extension resources. */
|
|
|
|
struct wl_resource *wl_subsurface;
|
2014-02-03 18:36:46 -05:00
|
|
|
|
2014-10-06 23:15:18 -04:00
|
|
|
/* wl_subsurface stuff. */
|
2014-01-12 16:02:09 -05:00
|
|
|
struct {
|
|
|
|
MetaWaylandSurface *parent;
|
|
|
|
struct wl_listener parent_destroy_listener;
|
2014-01-12 17:17:29 -05:00
|
|
|
|
2015-03-04 22:11:09 -05:00
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
|
2014-04-18 18:12:54 -04:00
|
|
|
/* When the surface is synchronous, its state will be applied
|
|
|
|
* when the parent is committed. This is done by moving the
|
|
|
|
* "real" pending state below to here when this surface is
|
|
|
|
* committed and in synchronous mode.
|
|
|
|
*
|
|
|
|
* When the parent surface is committed, we apply the pending
|
|
|
|
* state here.
|
|
|
|
*/
|
2014-01-13 17:31:25 -05:00
|
|
|
gboolean synchronous;
|
2015-12-14 04:13:35 -05:00
|
|
|
MetaWaylandPendingState *pending;
|
2014-01-13 17:31:25 -05:00
|
|
|
|
2014-01-12 17:17:29 -05:00
|
|
|
int32_t pending_x;
|
|
|
|
int32_t pending_y;
|
|
|
|
gboolean pending_pos;
|
2014-01-12 17:24:00 -05:00
|
|
|
GSList *pending_placement_ops;
|
2014-01-12 16:02:09 -05:00
|
|
|
} sub;
|
2017-03-17 08:34:52 -04:00
|
|
|
|
2018-11-24 14:25:38 -05:00
|
|
|
/* wp_viewport */
|
|
|
|
struct {
|
|
|
|
struct wl_resource *resource;
|
|
|
|
gulong destroy_handler_id;
|
|
|
|
|
|
|
|
gboolean has_src_rect;
|
2019-02-20 10:23:04 -05:00
|
|
|
graphene_rect_t src_rect;
|
2018-11-24 14:25:38 -05:00
|
|
|
|
|
|
|
gboolean has_dst_size;
|
|
|
|
int dst_width;
|
|
|
|
int dst_height;
|
|
|
|
} viewport;
|
|
|
|
|
2017-03-17 08:34:52 -04:00
|
|
|
/* table of seats for which shortcuts are inhibited */
|
|
|
|
GHashTable *shortcut_inhibited_seats;
|
2013-08-30 12:03:30 -04:00
|
|
|
};
|
|
|
|
|
2014-04-22 18:05:44 -04:00
|
|
|
void meta_wayland_shell_init (MetaWaylandCompositor *compositor);
|
2013-08-30 12:26:18 -04:00
|
|
|
|
|
|
|
MetaWaylandSurface *meta_wayland_surface_create (MetaWaylandCompositor *compositor,
|
2014-04-22 18:22:13 -04:00
|
|
|
struct wl_client *client,
|
|
|
|
struct wl_resource *compositor_resource,
|
|
|
|
guint32 id);
|
2014-02-18 16:39:23 -05:00
|
|
|
|
2017-12-20 04:40:22 -05:00
|
|
|
void meta_wayland_surface_apply_pending_state (MetaWaylandSurface *surface,
|
|
|
|
MetaWaylandPendingState *pending);
|
|
|
|
|
|
|
|
gboolean meta_wayland_surface_is_effectively_synchronized (MetaWaylandSurface *surface);
|
|
|
|
|
2015-07-08 04:14:00 -04:00
|
|
|
gboolean meta_wayland_surface_assign_role (MetaWaylandSurface *surface,
|
2016-01-28 04:14:06 -05:00
|
|
|
GType role_type,
|
|
|
|
const char *first_property_name,
|
|
|
|
...);
|
2015-02-06 03:12:21 -05:00
|
|
|
|
2016-03-16 02:47:53 -04:00
|
|
|
MetaWaylandBuffer *meta_wayland_surface_get_buffer (MetaWaylandSurface *surface);
|
|
|
|
|
|
|
|
void meta_wayland_surface_ref_buffer_use_count (MetaWaylandSurface *surface);
|
|
|
|
|
|
|
|
void meta_wayland_surface_unref_buffer_use_count (MetaWaylandSurface *surface);
|
|
|
|
|
2014-04-02 10:37:08 -04:00
|
|
|
void meta_wayland_surface_set_window (MetaWaylandSurface *surface,
|
|
|
|
MetaWindow *window);
|
2014-02-18 16:39:23 -05:00
|
|
|
|
2013-09-03 06:00:29 -04:00
|
|
|
void meta_wayland_surface_configure_notify (MetaWaylandSurface *surface,
|
2016-07-01 03:14:12 -04:00
|
|
|
int new_x,
|
|
|
|
int new_y,
|
wayland-surface: Don't do pending move/resizes on all commits
We assume in meta_window_wayland_move_resize that the next commit that
changes the geometry will always be for our next pending operation, so
if we have a move pending on a resize, the next commit will trigger the
move. This is, of course, fundamentally wrong.
We broke this assumption even more now that we don't fizzle out calls to
meta_window_move_resize_internal and now call it on every commit, which
means that a simple damage and then commit would complete a pending
move.
This was even broken by apps like weston-terminal, which, when clicking
on the maximize button, first redraws the terminal with the maximize
button state back on hover on press, and would only redraw when it got
the configure event with the coordinates.
To track the correct commit to apply the move for, we implement the
ack_configure request and ignore all move/resizes that happen before
that.
Right now, we actually fizzle out the entire move/resize if there's a
future pending configure we're waiting on.
2014-07-27 11:23:17 -04:00
|
|
|
int width,
|
|
|
|
int height,
|
|
|
|
MetaWaylandSerial *sent_serial);
|
2013-11-12 15:52:03 -05:00
|
|
|
|
2013-11-21 14:20:52 -05:00
|
|
|
void meta_wayland_surface_ping (MetaWaylandSurface *surface,
|
|
|
|
guint32 serial);
|
2014-02-07 17:28:33 -05:00
|
|
|
void meta_wayland_surface_delete (MetaWaylandSurface *surface);
|
2013-11-21 14:20:52 -05:00
|
|
|
|
2015-05-18 07:24:27 -04:00
|
|
|
/* Drag dest functions */
|
|
|
|
void meta_wayland_surface_drag_dest_focus_in (MetaWaylandSurface *surface,
|
|
|
|
MetaWaylandDataOffer *offer);
|
|
|
|
void meta_wayland_surface_drag_dest_motion (MetaWaylandSurface *surface,
|
|
|
|
const ClutterEvent *event);
|
|
|
|
void meta_wayland_surface_drag_dest_focus_out (MetaWaylandSurface *surface);
|
|
|
|
void meta_wayland_surface_drag_dest_drop (MetaWaylandSurface *surface);
|
2015-09-28 08:16:20 -04:00
|
|
|
void meta_wayland_surface_drag_dest_update (MetaWaylandSurface *surface);
|
2015-05-18 07:24:27 -04:00
|
|
|
|
wayland: Send wl_surface.enter and wl_surface.leave
Whenever a MetaSurfaceActor is painted, update the list of what outputs
the surface is being drawed upon. Since we do this on paint, we
effectively avoids this whenever the surface is not drawn, for example
being minimized, on a non-active workspace, or simply outside of the
damage region of a frame.
DND icons and cursors are not affected by this patch, since they are not
drawn as MetaSurfaceActors. If a MetaSurfaceActor or a parent is cloned,
then we'll check the position of the original actor again when the clone is
drawn, which is slightly expensive, but harmless. If the MetaShapedTexture
instead is cloned, as GNOME Shell does in many cases, then these clones
will not cause duplicate position checks.
https://bugzilla.gnome.org/show_bug.cgi?id=744453
2015-02-03 02:49:52 -05:00
|
|
|
void meta_wayland_surface_update_outputs (MetaWaylandSurface *surface);
|
|
|
|
|
2016-01-14 04:43:47 -05:00
|
|
|
MetaWaylandSurface *meta_wayland_surface_get_toplevel (MetaWaylandSurface *surface);
|
|
|
|
|
2015-03-23 09:10:20 -04:00
|
|
|
MetaWindow * meta_wayland_surface_get_toplevel_window (MetaWaylandSurface *surface);
|
|
|
|
|
2018-08-27 06:05:58 -04:00
|
|
|
void meta_wayland_surface_cache_pending_frame_callbacks (MetaWaylandSurface *surface,
|
|
|
|
MetaWaylandPendingState *pending);
|
|
|
|
|
2015-07-17 10:02:15 -04:00
|
|
|
void meta_wayland_surface_queue_pending_frame_callbacks (MetaWaylandSurface *surface);
|
|
|
|
|
2015-07-08 04:14:00 -04:00
|
|
|
void meta_wayland_surface_queue_pending_state_frame_callbacks (MetaWaylandSurface *surface,
|
|
|
|
MetaWaylandPendingState *pending);
|
|
|
|
|
2015-06-16 22:16:02 -04:00
|
|
|
void meta_wayland_surface_get_relative_coordinates (MetaWaylandSurface *surface,
|
|
|
|
float abs_x,
|
|
|
|
float abs_y,
|
|
|
|
float *sx,
|
|
|
|
float *sy);
|
|
|
|
|
2015-06-17 00:10:52 -04:00
|
|
|
void meta_wayland_surface_get_absolute_coordinates (MetaWaylandSurface *surface,
|
|
|
|
float sx,
|
|
|
|
float sy,
|
|
|
|
float *x,
|
|
|
|
float *y);
|
|
|
|
|
2015-07-08 04:14:00 -04:00
|
|
|
MetaWaylandSurface * meta_wayland_surface_role_get_surface (MetaWaylandSurfaceRole *role);
|
|
|
|
|
2016-02-23 08:26:52 -05:00
|
|
|
cairo_region_t * meta_wayland_surface_calculate_input_region (MetaWaylandSurface *surface);
|
|
|
|
|
2016-01-14 04:49:57 -05:00
|
|
|
|
2015-12-14 23:51:24 -05:00
|
|
|
gboolean meta_wayland_surface_begin_grab_op (MetaWaylandSurface *surface,
|
|
|
|
MetaWaylandSeat *seat,
|
|
|
|
MetaGrabOp grab_op,
|
|
|
|
gfloat x,
|
|
|
|
gfloat y);
|
2015-12-15 09:09:20 -05:00
|
|
|
|
|
|
|
void meta_wayland_surface_window_managed (MetaWaylandSurface *surface,
|
|
|
|
MetaWindow *window);
|
|
|
|
|
2017-03-17 08:34:52 -04:00
|
|
|
void meta_wayland_surface_inhibit_shortcuts (MetaWaylandSurface *surface,
|
|
|
|
MetaWaylandSeat *seat);
|
|
|
|
|
|
|
|
void meta_wayland_surface_restore_shortcuts (MetaWaylandSurface *surface,
|
|
|
|
MetaWaylandSeat *seat);
|
|
|
|
|
|
|
|
gboolean meta_wayland_surface_is_shortcuts_inhibited (MetaWaylandSurface *surface,
|
|
|
|
MetaWaylandSeat *seat);
|
|
|
|
|
wayland: Move surface texture ownership to MetaWaylandSurface
Prior to this commit, MetaWaylandSurface held a reference to
MetaWaylandBuffer, who owned the texture drawn by the surface. When
switching buffer, the texture change with it.
This is problematic when dealing with SHM buffer damage management, as
when having one texture per buffer, damaged regions uploaded to one,
will not follow along to the next one attached. It also wasted GPU
memory as there would be one texture per buffer, instead of one one
texture per surface.
Instead, move the texture ownership to MetaWaylandSurface, and have the
SHM buffer damage management update the surface texture. This ensures
damage is processed properly, and that we won't end up with stale
texture content when doing partial texture uploads. If the same SHM
buffer is attached to multiple surfaces, each surface will get their own
copy, and damage is tracked and uploaded separately.
Non-SHM types of buffers still has their own texture reference, as the
texture is just a representation of the GPU memory associated with the
buffer. When such a buffer is attached to a surface, instead the surface
just gets a reference to that texture, instead of a separately allocated
one.
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/199
2019-02-08 05:46:48 -05:00
|
|
|
CoglTexture * meta_wayland_surface_get_texture (MetaWaylandSurface *surface);
|
|
|
|
|
2018-04-06 06:29:37 -04:00
|
|
|
MetaSurfaceActor * meta_wayland_surface_get_actor (MetaWaylandSurface *surface);
|
|
|
|
|
2018-04-06 06:35:34 -04:00
|
|
|
void meta_wayland_surface_notify_geometry_changed (MetaWaylandSurface *surface);
|
|
|
|
|
2018-06-29 11:45:28 -04:00
|
|
|
int meta_wayland_surface_get_width (MetaWaylandSurface *surface);
|
|
|
|
int meta_wayland_surface_get_height (MetaWaylandSurface *surface);
|
|
|
|
|
2013-08-30 12:03:30 -04:00
|
|
|
#endif
|