mirror of
https://github.com/brl/mutter.git
synced 2024-11-13 01:36:10 -05:00
cursor-tracker: Make ensure_wayland_cursor take a ref
This fixes a crash in the last commit because that's what I thought this would do. It also simplifies callers drastically...
This commit is contained in:
parent
4091f5493d
commit
73a9082062
@ -822,14 +822,14 @@ static MetaCursorReference *
|
|||||||
ensure_wayland_cursor (MetaCursorTracker *tracker,
|
ensure_wayland_cursor (MetaCursorTracker *tracker,
|
||||||
MetaCursor cursor)
|
MetaCursor cursor)
|
||||||
{
|
{
|
||||||
if (tracker->default_cursors[cursor])
|
|
||||||
return tracker->default_cursors[cursor];
|
|
||||||
|
|
||||||
tracker->default_cursors[cursor] = meta_cursor_reference_from_theme (tracker, cursor);
|
|
||||||
if (!tracker->default_cursors[cursor])
|
if (!tracker->default_cursors[cursor])
|
||||||
meta_warning ("Failed to load cursor from theme\n");
|
{
|
||||||
|
tracker->default_cursors[cursor] = meta_cursor_reference_from_theme (tracker, cursor);
|
||||||
|
if (!tracker->default_cursors[cursor])
|
||||||
|
meta_warning ("Failed to load cursor from theme\n");
|
||||||
|
}
|
||||||
|
|
||||||
return tracker->default_cursors[cursor];
|
return meta_cursor_reference_ref (tracker->default_cursors[cursor]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -880,12 +880,8 @@ meta_cursor_tracker_set_root_cursor (MetaCursorTracker *tracker,
|
|||||||
/* Now update the real root cursor */
|
/* Now update the real root cursor */
|
||||||
if (meta_is_wayland_compositor ())
|
if (meta_is_wayland_compositor ())
|
||||||
{
|
{
|
||||||
MetaCursorReference *ref;
|
|
||||||
|
|
||||||
ref = ensure_wayland_cursor (tracker, cursor);
|
|
||||||
|
|
||||||
g_clear_pointer (&tracker->root_cursor, meta_cursor_reference_unref);
|
g_clear_pointer (&tracker->root_cursor, meta_cursor_reference_unref);
|
||||||
tracker->root_cursor = meta_cursor_reference_ref (ref);
|
tracker->root_cursor = ensure_wayland_cursor (tracker, cursor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user