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
This commit is contained in:
Jonas Ådahl
2015-02-03 15:49:52 +08:00
parent ba7c524a18
commit eb023ff2c9
7 changed files with 188 additions and 1 deletions

View File

@ -31,6 +31,14 @@
#include <string.h>
enum {
OUTPUT_DESTROYED,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL];
G_DEFINE_TYPE (MetaWaylandOutput, meta_wayland_output, G_TYPE_OBJECT)
static void
@ -102,6 +110,7 @@ wayland_output_destroy_notify (gpointer data)
{
MetaWaylandOutput *wayland_output = data;
g_signal_emit (wayland_output, signals[OUTPUT_DESTROYED], 0);
g_object_unref (wayland_output);
}
@ -243,6 +252,13 @@ meta_wayland_output_class_init (MetaWaylandOutputClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = meta_wayland_output_finalize;
signals[OUTPUT_DESTROYED] = g_signal_new ("output-destroyed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
}
void