xdg_shell_v6: Remove conditional parent update 87/304887/1
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 20 Dec 2023 08:12:50 +0000 (17:12 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Thu, 25 Jan 2024 06:53:36 +0000 (15:53 +0900)
Previously, the parent window was updated based on the mapping state of
the parent window in ds_xdg_shell_v6, following the implementation of
xdg_wm_base protocol. However, the zxdg_shell_v6 protocol specification
does not mention any such requirement.

This patch removes the unnecessary condition and allows the compositor
to decide how to handle unmapped parents.

Change-Id: I73cba48a7cd2adfc3ef01dff68afa2cc3e622eeb

include/libds/types/ds_xdg_shell_v6.h
src/xdg_shell_v6/xdg_toplevel_v6.c

index b846c0c..2349135 100644 (file)
@@ -74,7 +74,6 @@ struct ds_xdg_toplevel_v6
     struct ds_xdg_surface_v6 *base;
 
     struct ds_xdg_toplevel_v6 *parent;
-    struct wl_listener parent_unmap;
 
     struct ds_xdg_toplevel_v6_state current, pending;
     struct ds_xdg_toplevel_v6_configure scheduled;
index 819476d..a45f942 100644 (file)
@@ -237,7 +237,6 @@ void
 reset_xdg_toplevel_v6(struct ds_xdg_toplevel_v6 *toplevel)
 {
     if (toplevel->parent) {
-        wl_list_remove(&toplevel->parent_unmap.link);
         toplevel->parent = NULL;
     }
 
@@ -576,15 +575,6 @@ xdg_toplevel_v6_handle_resource_destroy(struct wl_resource *resource)
 }
 
 static void
-xdg_toplevel_v6_handle_parent_unmap(struct wl_listener *listener, void *data)
-{
-    struct ds_xdg_toplevel_v6 *toplevel;
-
-    toplevel = wl_container_of(listener, toplevel, parent_unmap);
-    xdg_toplevel_v6_set_parent(toplevel, toplevel->parent->parent);
-}
-
-static void
 xdg_toplevel_v6_set_parent(struct ds_xdg_toplevel_v6 *toplevel,
         struct ds_xdg_toplevel_v6 *parent)
 {
@@ -596,18 +586,6 @@ xdg_toplevel_v6_set_parent(struct ds_xdg_toplevel_v6 *toplevel,
         iter = iter->parent;
     }
 
-    if (toplevel->parent)
-        wl_list_remove(&toplevel->parent_unmap.link);
-
-    if (parent && parent->base->mapped) {
-        toplevel->parent = parent;
-        toplevel->parent_unmap.notify = xdg_toplevel_v6_handle_parent_unmap;
-        wl_signal_add(&toplevel->parent->base->events.unmap,
-                &toplevel->parent_unmap);
-    }
-    else {
-        toplevel->parent = NULL;
-    }
-
+    toplevel->parent = parent;
     wl_signal_emit_mutable(&toplevel->events.set_parent, NULL);
 }