xdg_shell_v6: Emit new_surface signal on toplevel creation 75/295275/1
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 8 Jun 2023 23:50:42 +0000 (08:50 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Tue, 4 Jul 2023 09:23:37 +0000 (18:23 +0900)
It's actually supposed to emit new_surface signal on wl_surface.commit()
of xdg_toplevel_v6.
However, the tizen application doesn't follow this rule for historical
reason, and this patch makes new_surface signal be emitted on creation
of toplevel to make tizen applications work properly.

Change-Id: I5dc7f8104935ac1ad67b235afca384dbf8eb7414

src/xdg_shell_v6/xdg_surface_v6.c

index fe5e0c0..6a5af89 100644 (file)
@@ -245,11 +245,6 @@ xdg_surface_v6_handle_surface_commit(struct wl_listener *listener, void *data)
             break;
     }
 
-    if (!surface->added) {
-        surface->added = true;
-        wl_signal_emit_mutable(&surface->client->shell->events.new_surface, surface);
-    }
-
     if (surface->configured &&
             ds_surface_has_buffer(surface->ds_surface) &&
             !surface->mapped) {
@@ -302,6 +297,9 @@ xdg_surface_v6_handle_get_toplevel(struct wl_client *client,
 
     surface = wl_resource_get_user_data(resource);
     create_xdg_toplevel_v6(surface, id);
+
+    surface->added = true;
+    wl_signal_emit_mutable(&surface->client->shell->events.new_surface, surface);
 }
 
 static void