https://bugzilla.gnome.org/show_bug.cgi?id=744932

Owen Taylor <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #299282|none                        |needs-work
             status|                            |

--- Comment #30 from Owen Taylor <[email protected]> ---
Review of attachment 299282:

If the point of the refactoring is to get to a clean design, there are elements
of this patch that feel off to me

::: src/frontends/meta-cursor.c
@@ +156,2 @@
 MetaCursorSprite *
+meta_cursor_sprite_new (void)

meta_foo_new() should create a MetaFoo, not a MetaFoo or a subclass. This is
something like meta_create_cursor_sprite().

@@ +160,3 @@
+    return g_object_new (META_TYPE_CURSOR_SPRITE_WAYLAND, NULL);
+  else
+    return g_object_new (META_TYPE_CURSOR_SPRITE, NULL);

Hmm, I think this reflects confusion whether MetaCursorSprite is a frontend or
a backend object. If it's genuinely a "frontend" object, then when creating it
we should always know what protocol we are creating it for. And
meta_cursor_sprite_from_theme() would be a third subclass independent of the
backend.

Obviously every transformation of frontend to backend isn't going to be
possible - e.g., creating an X cursor for a Wayland surface - but I don't think
that's a big problem - you just need to have the code somewhere that knows what
can be transformed to what.

::: src/frontends/wayland/meta-cursor-wayland.c
@@ +66,3 @@
+  MetaCursorSpriteWayland *self;
+
+  self = META_CURSOR_SPRITE_WAYLAND (meta_cursor_sprite_new ());

This doesn't make sense to me - this *has* to be a MetaCursorSpriteWayland, so
just create one.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
wayland-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-bugs

Reply via email to