2022-06-10 17:23:08 +02:00
|
|
|
/*
|
|
|
|
* Wayland Transaction Support
|
|
|
|
*
|
|
|
|
* Copyright (C) 2021 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include "wayland/meta-wayland-transaction.h"
|
|
|
|
|
2021-05-30 15:00:13 +02:00
|
|
|
#include "wayland/meta-wayland.h"
|
2022-06-10 17:23:08 +02:00
|
|
|
#include "wayland/meta-wayland-subsurface.h"
|
|
|
|
|
2021-05-30 15:00:13 +02:00
|
|
|
#define META_WAYLAND_TRANSACTION_NONE ((void *)(uintptr_t) G_MAXSIZE)
|
|
|
|
|
2022-06-10 17:23:08 +02:00
|
|
|
struct _MetaWaylandTransaction
|
|
|
|
{
|
2021-05-30 15:00:13 +02:00
|
|
|
GList node;
|
|
|
|
MetaWaylandCompositor *compositor;
|
|
|
|
MetaWaylandTransaction *next_candidate;
|
|
|
|
uint64_t committed_sequence;
|
|
|
|
|
2022-06-13 18:58:56 +02:00
|
|
|
/*
|
|
|
|
* Keys: All surfaces referenced in the transaction
|
|
|
|
* Values: Pointer to MetaWaylandTransactionEntry for the surface
|
|
|
|
*/
|
2022-06-10 17:23:08 +02:00
|
|
|
GHashTable *entries;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _MetaWaylandTransactionEntry
|
|
|
|
{
|
2022-06-24 16:17:23 +02:00
|
|
|
/* Next committed transaction with entry for the same surface */
|
|
|
|
MetaWaylandTransaction *next_transaction;
|
|
|
|
|
2022-06-10 17:23:08 +02:00
|
|
|
MetaWaylandSurfaceState *state;
|
2021-05-28 12:39:48 +02:00
|
|
|
|
|
|
|
/* Sub-surface position */
|
|
|
|
gboolean has_sub_pos;
|
|
|
|
int x;
|
|
|
|
int y;
|
2022-06-10 17:23:08 +02:00
|
|
|
} MetaWaylandTransactionEntry;
|
|
|
|
|
|
|
|
static MetaWaylandTransactionEntry *
|
|
|
|
meta_wayland_transaction_get_entry (MetaWaylandTransaction *transaction,
|
|
|
|
MetaWaylandSurface *surface)
|
|
|
|
{
|
|
|
|
return g_hash_table_lookup (transaction->entries, surface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_wayland_transaction_sync_child_states (MetaWaylandSurface *surface)
|
|
|
|
{
|
|
|
|
MetaWaylandSurface *subsurface_surface;
|
|
|
|
|
|
|
|
META_WAYLAND_SURFACE_FOREACH_SUBSURFACE (surface, subsurface_surface)
|
|
|
|
{
|
|
|
|
MetaWaylandSubsurface *subsurface;
|
|
|
|
MetaWaylandActorSurface *actor_surface;
|
|
|
|
|
|
|
|
subsurface = META_WAYLAND_SUBSURFACE (subsurface_surface->role);
|
|
|
|
actor_surface = META_WAYLAND_ACTOR_SURFACE (subsurface);
|
|
|
|
meta_wayland_actor_surface_sync_actor_state (actor_surface);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-28 12:39:48 +02:00
|
|
|
static void
|
|
|
|
meta_wayland_transaction_apply_subsurface_position (MetaWaylandSurface *surface,
|
|
|
|
MetaWaylandTransactionEntry *entry)
|
|
|
|
{
|
|
|
|
if (!entry->has_sub_pos)
|
|
|
|
return;
|
|
|
|
|
|
|
|
surface->sub.x = entry->x;
|
|
|
|
surface->sub.y = entry->y;
|
|
|
|
}
|
|
|
|
|
2022-06-10 17:23:08 +02:00
|
|
|
static gboolean
|
|
|
|
is_ancestor (MetaWaylandSurface *candidate,
|
|
|
|
MetaWaylandSurface *reference)
|
|
|
|
{
|
|
|
|
MetaWaylandSurface *ancestor;
|
|
|
|
|
|
|
|
for (ancestor = reference->sub.parent; ancestor; ancestor = ancestor->sub.parent)
|
|
|
|
{
|
|
|
|
if (ancestor == candidate)
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
meta_wayland_transaction_compare (const void *key1,
|
|
|
|
const void *key2)
|
|
|
|
{
|
|
|
|
MetaWaylandSurface *surface1 = *(MetaWaylandSurface **) key1;
|
|
|
|
MetaWaylandSurface *surface2 = *(MetaWaylandSurface **) key2;
|
|
|
|
|
|
|
|
/* Order of siblings doesn't matter */
|
|
|
|
if (surface1->sub.parent == surface2->sub.parent)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* Ancestor surfaces come before descendant surfaces */
|
|
|
|
if (is_ancestor (surface1, surface2))
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
if (is_ancestor (surface2, surface1))
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Order unrelated surfaces by their toplevel surface pointer values, to
|
|
|
|
* prevent unrelated surfaces from getting mixed between siblings
|
|
|
|
*/
|
|
|
|
return (meta_wayland_surface_get_toplevel (surface1) <
|
|
|
|
meta_wayland_surface_get_toplevel (surface2)) ? -1 : 1;
|
|
|
|
}
|
|
|
|
|
2021-05-30 15:00:13 +02:00
|
|
|
static void
|
|
|
|
ensure_next_candidate (MetaWaylandTransaction *transaction,
|
|
|
|
MetaWaylandTransaction **first_candidate)
|
|
|
|
{
|
|
|
|
MetaWaylandTransaction **candidate;
|
|
|
|
|
|
|
|
if (transaction->next_candidate)
|
|
|
|
return;
|
|
|
|
|
|
|
|
candidate = first_candidate;
|
|
|
|
while (*candidate != META_WAYLAND_TRANSACTION_NONE &&
|
|
|
|
(*candidate)->committed_sequence <
|
|
|
|
transaction->committed_sequence)
|
|
|
|
candidate = &(*candidate)->next_candidate;
|
|
|
|
|
|
|
|
transaction->next_candidate = *candidate;
|
|
|
|
*candidate = transaction;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_wayland_transaction_apply (MetaWaylandTransaction *transaction,
|
|
|
|
MetaWaylandTransaction **first_candidate)
|
2022-06-10 17:23:08 +02:00
|
|
|
{
|
|
|
|
g_autofree MetaWaylandSurface **surfaces = NULL;
|
2021-05-28 12:39:48 +02:00
|
|
|
g_autofree MetaWaylandSurfaceState **states = NULL;
|
2022-06-10 17:23:08 +02:00
|
|
|
unsigned int num_surfaces;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
surfaces = (MetaWaylandSurface **)
|
|
|
|
g_hash_table_get_keys_as_array (transaction->entries, &num_surfaces);
|
2021-05-28 12:39:48 +02:00
|
|
|
states = g_new (MetaWaylandSurfaceState *, num_surfaces);
|
2022-06-10 17:23:08 +02:00
|
|
|
|
|
|
|
/* Sort surfaces from ancestors to descendants */
|
|
|
|
qsort (surfaces, num_surfaces, sizeof (MetaWaylandSurface *),
|
|
|
|
meta_wayland_transaction_compare);
|
|
|
|
|
|
|
|
/* Apply states from ancestors to descendants */
|
|
|
|
for (i = 0; i < num_surfaces; i++)
|
|
|
|
{
|
|
|
|
MetaWaylandSurface *surface = surfaces[i];
|
|
|
|
MetaWaylandTransactionEntry *entry;
|
|
|
|
|
|
|
|
entry = meta_wayland_transaction_get_entry (transaction, surface);
|
2021-05-28 12:39:48 +02:00
|
|
|
states[i] = entry->state;
|
|
|
|
meta_wayland_transaction_apply_subsurface_position (surface, entry);
|
|
|
|
if (entry->state)
|
|
|
|
meta_wayland_surface_apply_state (surface, entry->state);
|
2021-05-30 15:00:13 +02:00
|
|
|
|
|
|
|
if (surface->transaction.last_committed == transaction)
|
|
|
|
{
|
|
|
|
surface->transaction.first_committed = NULL;
|
|
|
|
surface->transaction.last_committed = NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-06-24 16:17:23 +02:00
|
|
|
MetaWaylandTransaction *next_transaction = entry->next_transaction;
|
2021-05-30 15:00:13 +02:00
|
|
|
|
|
|
|
if (next_transaction)
|
|
|
|
{
|
|
|
|
surface->transaction.first_committed = next_transaction;
|
|
|
|
ensure_next_candidate (next_transaction, first_candidate);
|
|
|
|
}
|
|
|
|
}
|
2022-06-10 17:23:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Synchronize child states from descendants to ancestors */
|
|
|
|
for (i = num_surfaces - 1; i >= 0; i--)
|
2021-05-28 12:39:48 +02:00
|
|
|
{
|
|
|
|
if (states[i])
|
|
|
|
meta_wayland_transaction_sync_child_states (surfaces[i]);
|
|
|
|
}
|
2022-06-10 17:23:08 +02:00
|
|
|
|
|
|
|
meta_wayland_transaction_free (transaction);
|
|
|
|
}
|
|
|
|
|
2021-05-30 15:00:13 +02:00
|
|
|
static gboolean
|
|
|
|
has_unapplied_dependencies (MetaWaylandTransaction *transaction)
|
|
|
|
{
|
|
|
|
GHashTableIter iter;
|
|
|
|
MetaWaylandSurface *surface;
|
|
|
|
|
|
|
|
g_hash_table_iter_init (&iter, transaction->entries);
|
|
|
|
while (g_hash_table_iter_next (&iter, (gpointer *) &surface, NULL))
|
|
|
|
{
|
|
|
|
if (surface->transaction.first_committed != transaction)
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_wayland_transaction_maybe_apply_one (MetaWaylandTransaction *transaction,
|
|
|
|
MetaWaylandTransaction **first_candidate)
|
|
|
|
{
|
|
|
|
if (has_unapplied_dependencies (transaction))
|
|
|
|
return;
|
|
|
|
|
|
|
|
meta_wayland_transaction_apply (transaction, first_candidate);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_wayland_transaction_maybe_apply (MetaWaylandTransaction *transaction)
|
|
|
|
{
|
|
|
|
MetaWaylandTransaction *first_candidate = META_WAYLAND_TRANSACTION_NONE;
|
|
|
|
|
|
|
|
while (TRUE)
|
|
|
|
{
|
|
|
|
meta_wayland_transaction_maybe_apply_one (transaction, &first_candidate);
|
|
|
|
|
|
|
|
if (first_candidate == META_WAYLAND_TRANSACTION_NONE)
|
|
|
|
return;
|
|
|
|
|
|
|
|
transaction = first_candidate;
|
|
|
|
first_candidate = transaction->next_candidate;
|
|
|
|
transaction->next_candidate = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_wayland_transaction_commit (MetaWaylandTransaction *transaction)
|
|
|
|
{
|
|
|
|
static uint64_t committed_sequence;
|
|
|
|
GQueue *committed_queue;
|
|
|
|
gboolean maybe_apply = TRUE;
|
|
|
|
GHashTableIter iter;
|
|
|
|
MetaWaylandSurface *surface;
|
|
|
|
|
|
|
|
transaction->committed_sequence = ++committed_sequence;
|
|
|
|
transaction->node.data = transaction;
|
|
|
|
|
|
|
|
committed_queue =
|
|
|
|
meta_wayland_compositor_get_committed_transactions (transaction->compositor);
|
|
|
|
g_queue_push_tail_link (committed_queue, &transaction->node);
|
|
|
|
|
|
|
|
g_hash_table_iter_init (&iter, transaction->entries);
|
|
|
|
while (g_hash_table_iter_next (&iter, (gpointer *) &surface, NULL))
|
|
|
|
{
|
2022-06-24 16:17:23 +02:00
|
|
|
if (surface->transaction.first_committed)
|
|
|
|
{
|
|
|
|
MetaWaylandTransactionEntry *entry;
|
2021-05-30 15:00:13 +02:00
|
|
|
|
2022-06-24 16:17:23 +02:00
|
|
|
entry = g_hash_table_lookup (surface->transaction.last_committed->entries,
|
|
|
|
surface);
|
|
|
|
entry->next_transaction = transaction;
|
|
|
|
maybe_apply = FALSE;
|
|
|
|
}
|
2021-05-30 15:00:13 +02:00
|
|
|
else
|
2022-06-24 16:17:23 +02:00
|
|
|
{
|
|
|
|
surface->transaction.first_committed = transaction;
|
|
|
|
}
|
|
|
|
|
|
|
|
surface->transaction.last_committed = transaction;
|
2021-05-30 15:00:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (maybe_apply)
|
|
|
|
meta_wayland_transaction_maybe_apply (transaction);
|
|
|
|
}
|
|
|
|
|
2022-06-10 17:23:08 +02:00
|
|
|
static MetaWaylandTransactionEntry *
|
|
|
|
meta_wayland_transaction_ensure_entry (MetaWaylandTransaction *transaction,
|
|
|
|
MetaWaylandSurface *surface)
|
|
|
|
{
|
|
|
|
MetaWaylandTransactionEntry *entry;
|
|
|
|
|
|
|
|
entry = meta_wayland_transaction_get_entry (transaction, surface);
|
|
|
|
if (entry)
|
|
|
|
return entry;
|
|
|
|
|
|
|
|
entry = g_new0 (MetaWaylandTransactionEntry, 1);
|
2022-06-13 18:58:56 +02:00
|
|
|
g_hash_table_insert (transaction->entries, g_object_ref (surface), entry);
|
2022-06-10 17:23:08 +02:00
|
|
|
|
|
|
|
return entry;
|
|
|
|
}
|
|
|
|
|
2021-06-07 15:19:47 +02:00
|
|
|
static void
|
|
|
|
meta_wayland_transaction_entry_free (MetaWaylandTransactionEntry *entry)
|
2022-06-10 17:23:08 +02:00
|
|
|
{
|
2021-06-07 15:19:47 +02:00
|
|
|
g_clear_object (&entry->state);
|
|
|
|
g_free (entry);
|
2022-06-10 17:23:08 +02:00
|
|
|
}
|
|
|
|
|
2022-06-13 18:58:56 +02:00
|
|
|
static void
|
|
|
|
meta_wayland_transaction_add_placement_surfaces (MetaWaylandTransaction *transaction,
|
|
|
|
MetaWaylandSurface *surface,
|
|
|
|
MetaWaylandSurfaceState *state)
|
|
|
|
{
|
|
|
|
GSList *l;
|
|
|
|
|
|
|
|
for (l = state->subsurface_placement_ops; l; l = l->next)
|
|
|
|
{
|
|
|
|
MetaWaylandSubsurfacePlacementOp *op = l->data;
|
|
|
|
|
|
|
|
if (op->surface)
|
|
|
|
meta_wayland_transaction_ensure_entry (transaction, op->surface);
|
|
|
|
|
|
|
|
if (op->sibling)
|
|
|
|
meta_wayland_transaction_ensure_entry (transaction, op->sibling);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_wayland_transaction_add_entry (MetaWaylandTransaction *transaction,
|
|
|
|
MetaWaylandSurface *surface,
|
|
|
|
MetaWaylandTransactionEntry *entry)
|
|
|
|
{
|
|
|
|
g_hash_table_insert (transaction->entries, g_object_ref (surface), entry);
|
|
|
|
|
|
|
|
if (entry->state)
|
|
|
|
{
|
|
|
|
meta_wayland_transaction_add_placement_surfaces (transaction, surface,
|
|
|
|
entry->state);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-28 12:39:48 +02:00
|
|
|
void
|
|
|
|
meta_wayland_transaction_add_subsurface_position (MetaWaylandTransaction *transaction,
|
2021-06-07 15:19:47 +02:00
|
|
|
MetaWaylandSurface *surface,
|
|
|
|
int x,
|
|
|
|
int y)
|
2021-05-28 12:39:48 +02:00
|
|
|
{
|
|
|
|
MetaWaylandTransactionEntry *entry;
|
|
|
|
|
|
|
|
entry = meta_wayland_transaction_ensure_entry (transaction, surface);
|
2021-06-07 15:19:47 +02:00
|
|
|
entry->x = x;
|
|
|
|
entry->y = y;
|
2021-05-28 12:39:48 +02:00
|
|
|
entry->has_sub_pos = TRUE;
|
|
|
|
}
|
|
|
|
|
2021-06-07 15:19:47 +02:00
|
|
|
static void
|
|
|
|
meta_wayland_transaction_entry_merge_into (MetaWaylandTransactionEntry *from,
|
|
|
|
MetaWaylandTransactionEntry *to)
|
2021-05-28 12:39:48 +02:00
|
|
|
{
|
2021-06-07 15:19:47 +02:00
|
|
|
if (from->has_sub_pos)
|
2021-05-28 12:39:48 +02:00
|
|
|
{
|
2021-06-07 15:19:47 +02:00
|
|
|
to->x = from->x;
|
|
|
|
to->y = from->y;
|
|
|
|
to->has_sub_pos = TRUE;
|
2021-05-28 12:39:48 +02:00
|
|
|
}
|
|
|
|
|
2021-06-07 15:19:47 +02:00
|
|
|
if (to->state)
|
|
|
|
{
|
|
|
|
meta_wayland_surface_state_merge_into (from->state, to->state);
|
|
|
|
g_clear_object (&from->state);
|
|
|
|
return;
|
|
|
|
}
|
2021-05-28 12:39:48 +02:00
|
|
|
|
2022-06-13 18:58:56 +02:00
|
|
|
to->state = g_steal_pointer (&from->state);
|
2021-05-28 12:39:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2021-06-07 15:19:47 +02:00
|
|
|
meta_wayland_transaction_merge_into (MetaWaylandTransaction *from,
|
|
|
|
MetaWaylandTransaction *to)
|
2021-05-28 12:39:48 +02:00
|
|
|
{
|
2021-06-07 15:19:47 +02:00
|
|
|
GHashTableIter iter;
|
|
|
|
MetaWaylandSurface *surface;
|
|
|
|
MetaWaylandTransactionEntry *from_entry, *to_entry;
|
2021-05-28 12:39:48 +02:00
|
|
|
|
2021-06-07 15:19:47 +02:00
|
|
|
g_hash_table_iter_init (&iter, from->entries);
|
|
|
|
while (g_hash_table_iter_next (&iter, (gpointer *) &surface,
|
|
|
|
(gpointer *) &from_entry))
|
|
|
|
{
|
|
|
|
to_entry = meta_wayland_transaction_get_entry (to, surface);
|
|
|
|
if (!to_entry)
|
|
|
|
{
|
2022-06-13 18:58:56 +02:00
|
|
|
g_hash_table_iter_steal (&iter);
|
|
|
|
meta_wayland_transaction_add_entry (to, surface, from_entry);
|
|
|
|
g_object_unref (surface);
|
2021-06-07 15:19:47 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2022-06-13 18:58:56 +02:00
|
|
|
if (from_entry->state)
|
|
|
|
{
|
|
|
|
meta_wayland_transaction_add_placement_surfaces (to, surface,
|
|
|
|
from_entry->state);
|
|
|
|
}
|
|
|
|
|
2021-06-07 15:19:47 +02:00
|
|
|
meta_wayland_transaction_entry_merge_into (from_entry, to_entry);
|
2022-06-13 18:58:56 +02:00
|
|
|
g_hash_table_iter_remove (&iter);
|
2021-06-07 15:19:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
meta_wayland_transaction_free (from);
|
2021-05-28 12:39:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2021-06-07 15:19:47 +02:00
|
|
|
meta_wayland_transaction_merge_pending_state (MetaWaylandTransaction *transaction,
|
|
|
|
MetaWaylandSurface *surface)
|
2021-05-28 12:39:48 +02:00
|
|
|
{
|
2021-06-07 15:19:47 +02:00
|
|
|
MetaWaylandSurfaceState *pending = surface->pending_state;
|
|
|
|
MetaWaylandTransactionEntry *entry;
|
2021-05-28 12:39:48 +02:00
|
|
|
|
2021-06-07 15:19:47 +02:00
|
|
|
entry = meta_wayland_transaction_ensure_entry (transaction, surface);
|
|
|
|
|
|
|
|
if (!entry->state)
|
|
|
|
{
|
|
|
|
entry->state = pending;
|
|
|
|
surface->pending_state = meta_wayland_surface_state_new ();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
meta_wayland_surface_state_merge_into (pending, entry->state);
|
|
|
|
meta_wayland_surface_state_reset (pending);
|
2022-06-10 17:23:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
MetaWaylandTransaction *
|
2021-05-30 15:00:13 +02:00
|
|
|
meta_wayland_transaction_new (MetaWaylandCompositor *compositor)
|
2022-06-10 17:23:08 +02:00
|
|
|
{
|
|
|
|
MetaWaylandTransaction *transaction;
|
|
|
|
|
|
|
|
transaction = g_new0 (MetaWaylandTransaction, 1);
|
|
|
|
|
2021-05-30 15:00:13 +02:00
|
|
|
transaction->compositor = compositor;
|
2022-06-13 18:58:56 +02:00
|
|
|
transaction->entries = g_hash_table_new_full (NULL, NULL, g_object_unref,
|
2022-06-10 17:23:08 +02:00
|
|
|
(GDestroyNotify) meta_wayland_transaction_entry_free);
|
|
|
|
|
|
|
|
return transaction;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_wayland_transaction_free (MetaWaylandTransaction *transaction)
|
|
|
|
{
|
2021-05-30 15:00:13 +02:00
|
|
|
if (transaction->node.data)
|
|
|
|
{
|
|
|
|
GQueue *committed_queue =
|
|
|
|
meta_wayland_compositor_get_committed_transactions (transaction->compositor);
|
|
|
|
|
|
|
|
g_queue_unlink (committed_queue, &transaction->node);
|
|
|
|
}
|
|
|
|
|
2022-06-10 17:23:08 +02:00
|
|
|
g_hash_table_destroy (transaction->entries);
|
|
|
|
g_free (transaction);
|
|
|
|
}
|
2021-05-30 15:00:13 +02:00
|
|
|
|
|
|
|
void
|
|
|
|
meta_wayland_transaction_finalize (MetaWaylandCompositor *compositor)
|
|
|
|
{
|
|
|
|
GQueue *transactions;
|
|
|
|
MetaWaylandTransaction *transaction;
|
|
|
|
|
|
|
|
transactions = meta_wayland_compositor_get_committed_transactions (compositor);
|
|
|
|
|
|
|
|
while ((transaction = g_queue_pop_head (transactions)))
|
|
|
|
meta_wayland_transaction_free (transaction);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_wayland_transaction_init (MetaWaylandCompositor *compositor)
|
|
|
|
{
|
|
|
|
GQueue *transactions;
|
|
|
|
|
|
|
|
transactions = meta_wayland_compositor_get_committed_transactions (compositor);
|
|
|
|
g_queue_init (transactions);
|
|
|
|
}
|