This is an automated email from the git hooks/post-receive script.

git pushed a commit to reference refs/pull/205/head
in repository enlightenment.

View the commit online.

commit 9177844ecbb656a42fab66f5be4fb18c0f7f4a81
Author: Cedric BAIL <[email protected]>
AuthorDate: Tue Nov 24 17:50:40 2026 -0600

    e_comp_wl - add xdg-foreign v2
    
    Chromium and the xdg-desktop-portal backends bind xdg-foreign v2 when
    it is offered, to parent a portal dialog, such as a file chooser, on
    the window that asked for it. E only offers v1.
    
    v2 is v1 with requests and interfaces renamed, so both run through the
    same code. They share one handle namespace: a handle is an opaque
    string, and nothing stops a portal exporting with one version while
    the dialog imports with the other. v2 also refuses to export a popup,
    with its own error; set_parent_of already refuses one in v1.
    
    Only Wayland code is touched.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 src/bin/e_comp_wl.h                     |   8 ++
 src/bin/e_comp_wl_extensions.c          | 105 +++++++++++++--
 src/bin/generated/meson.build           |   1 +
 src/tests/wayland/globals.expected      |   2 +
 src/tests/wayland/meson.build           |   2 +
 src/tests/wayland/test_xdg_foreign_v2.c | 222 ++++++++++++++++++++++++++++++++
 6 files changed, 331 insertions(+), 9 deletions(-)

diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h
index 1309a91b6..ad152e8a9 100644
--- a/src/bin/e_comp_wl.h
+++ b/src/bin/e_comp_wl.h
@@ -127,6 +127,14 @@ typedef struct E_Comp_Wl_Extension_Data
      {
         struct wl_global *global;
      } zxdg_importer_v1;
+   struct
+     {
+        struct wl_global *global;
+     } zxdg_exporter_v2;
+   struct
+     {
+        struct wl_global *global;
+     } zxdg_importer_v2;
    /* end xdg-foreign */
    struct
      {
diff --git a/src/bin/e_comp_wl_extensions.c b/src/bin/e_comp_wl_extensions.c
index 240e9dc7b..3d67d99ad 100644
--- a/src/bin/e_comp_wl_extensions.c
+++ b/src/bin/e_comp_wl_extensions.c
@@ -4,6 +4,7 @@
 #include <uuid.h>
 #include "session-recovery-server-protocol.h"
 #include "xdg-foreign-unstable-v1-server-protocol.h"
+#include "xdg-foreign-unstable-v2-server-protocol.h"
 #include "relative-pointer-unstable-v1-server-protocol.h"
 #include "pointer-constraints-unstable-v1-server-protocol.h"
 #include "action_route-server-protocol.h"
@@ -28,6 +29,7 @@ typedef struct Imported
    E_Client *ec;
    struct wl_resource *res;
    Exported *ex;
+   Eina_Bool v2 E_BITFIELD;
 } Imported;
 
 typedef struct Constraint
@@ -212,6 +214,13 @@ _e_comp_wl_zxdg_exported_v1_destroy(struct wl_client *client EINA_UNUSED, struct
 static void _imported_v1_del(Imported *im);
 static void _exported_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
 
+static void
+_e_comp_wl_zxdg_imported_destroyed_send(Imported *im)
+{
+   if (im->v2) zxdg_imported_v2_send_destroyed(im->res);
+   else zxdg_imported_v1_send_destroyed(im->res);
+}
+
 static void
 _exported_v1_del(Exported *ex)
 {
@@ -219,7 +228,7 @@ _exported_v1_del(Exported *ex)
      {
         Imported *im = eina_list_data_get(ex->imported);
 
-        zxdg_imported_v1_send_destroyed(im->res);
+        _e_comp_wl_zxdg_imported_destroyed_send(im);
         _imported_v1_del(im);
      }
    evas_object_event_callback_del(ex->ec->frame, EVAS_CALLBACK_DEL, _exported_del);
@@ -253,8 +262,16 @@ static const struct zxdg_exported_v1_interface _e_zxdg_exported_v1_interface =
    _e_comp_wl_zxdg_exported_v1_destroy,
 };
 
+static const struct zxdg_exported_v2_interface _e_zxdg_exported_v2_interface =
+{
+   _e_comp_wl_zxdg_exported_v1_destroy,
+};
+
+/* v2 is v1 with renamed requests and interfaces, and errors of its own.
+ * Both share one handle namespace: a handle is an opaque string, and a
+ * window exported with one version can be imported with the other. */
 static void
-_e_comp_wl_zxdg_exporter_v1_export(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface)
+_e_comp_wl_zxdg_export(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface, Eina_Bool v2)
 {
    E_Client *ec = wl_resource_get_user_data(surface);
    Exported *ex;
@@ -264,11 +281,25 @@ _e_comp_wl_zxdg_exporter_v1_export(struct wl_client *client, struct wl_resource
         wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "invalid role for exported surface");
         return;
      }
+   if ((v2) && (e_client_util_is_popup(ec)))
+     {
+        wl_resource_post_error(resource, ZXDG_EXPORTER_V2_ERROR_INVALID_SURFACE,
+                               "surface is not an xdg_toplevel");
+        return;
+     }
 
    ex = E_NEW(Exported, 1);
    ex->ec = ec;
-   ex->res = wl_resource_create(client, &zxdg_exported_v1_interface, wl_resource_get_version(resource), id);
-   wl_resource_set_implementation(ex->res, &_e_zxdg_exported_v1_interface, ex, _e_zxdg_exported_v1_del);
+   if (v2)
+     {
+        ex->res = wl_resource_create(client, &zxdg_exported_v2_interface, wl_resource_get_version(resource), id);
+        wl_resource_set_implementation(ex->res, &_e_zxdg_exported_v2_interface, ex, _e_zxdg_exported_v1_del);
+     }
+   else
+     {
+        ex->res = wl_resource_create(client, &zxdg_exported_v1_interface, wl_resource_get_version(resource), id);
+        wl_resource_set_implementation(ex->res, &_e_zxdg_exported_v1_interface, ex, _e_zxdg_exported_v1_del);
+     }
    evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_DEL, _exported_del, ex);
 
    do
@@ -283,7 +314,20 @@ _e_comp_wl_zxdg_exporter_v1_export(struct wl_client *client, struct wl_resource
      } while (eina_hash_find(e_comp_wl->extensions->zxdg_exporter_v1.surfaces, ex->handle));
    eina_hash_add(e_comp_wl->extensions->zxdg_exporter_v1.surfaces, ex->handle, ex);
 
-   zxdg_exported_v1_send_handle(ex->res, ex->handle);
+   if (v2) zxdg_exported_v2_send_handle(ex->res, ex->handle);
+   else zxdg_exported_v1_send_handle(ex->res, ex->handle);
+}
+
+static void
+_e_comp_wl_zxdg_exporter_v1_export(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface)
+{
+   _e_comp_wl_zxdg_export(client, resource, id, surface, EINA_FALSE);
+}
+
+static void
+_e_comp_wl_zxdg_exporter_v2_export_toplevel(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface)
+{
+   _e_comp_wl_zxdg_export(client, resource, id, surface, EINA_TRUE);
 }
 
 
@@ -369,20 +413,35 @@ static const struct zxdg_imported_v1_interface _e_zxdg_imported_v1_interface =
    _e_comp_wl_zxdg_imported_v1_set_parent_of,
 };
 
+static const struct zxdg_imported_v2_interface _e_zxdg_imported_v2_interface =
+{
+   _e_comp_wl_zxdg_imported_v1_destroy,
+   _e_comp_wl_zxdg_imported_v1_set_parent_of,
+};
+
 static void
-_e_comp_wl_zxdg_importer_v1_import(struct wl_client *client, struct wl_resource *resource, uint32_t id, const char *handle)
+_e_comp_wl_zxdg_import(struct wl_client *client, struct wl_resource *resource, uint32_t id, const char *handle, Eina_Bool v2)
 {
    Imported *im;
    Exported *ex;
 
    im = E_NEW(Imported, 1);
-   im->res = wl_resource_create(client, &zxdg_imported_v1_interface, wl_resource_get_version(resource), id);
-   wl_resource_set_implementation(im->res, &_e_zxdg_imported_v1_interface, NULL, _e_zxdg_imported_v1_del);
+   im->v2 = v2;
+   if (v2)
+     {
+        im->res = wl_resource_create(client, &zxdg_imported_v2_interface, wl_resource_get_version(resource), id);
+        wl_resource_set_implementation(im->res, &_e_zxdg_imported_v2_interface, NULL, _e_zxdg_imported_v1_del);
+     }
+   else
+     {
+        im->res = wl_resource_create(client, &zxdg_imported_v1_interface, wl_resource_get_version(resource), id);
+        wl_resource_set_implementation(im->res, &_e_zxdg_imported_v1_interface, NULL, _e_zxdg_imported_v1_del);
+     }
 
    ex = eina_hash_find(e_comp_wl->extensions->zxdg_exporter_v1.surfaces, handle);
    if ((!ex) || (!ex->ec->netwm.type))
      {
-        zxdg_imported_v1_send_destroyed(im->res);
+        _e_comp_wl_zxdg_imported_destroyed_send(im);
         free(im);
         return;
      }
@@ -392,6 +451,18 @@ _e_comp_wl_zxdg_importer_v1_import(struct wl_client *client, struct wl_resource
    ex->imported = eina_list_append(ex->imported, im);
 }
 
+static void
+_e_comp_wl_zxdg_importer_v1_import(struct wl_client *client, struct wl_resource *resource, uint32_t id, const char *handle)
+{
+   _e_comp_wl_zxdg_import(client, resource, id, handle, EINA_FALSE);
+}
+
+static void
+_e_comp_wl_zxdg_importer_v2_import_toplevel(struct wl_client *client, struct wl_resource *resource, uint32_t id, const char *handle)
+{
+   _e_comp_wl_zxdg_import(client, resource, id, handle, EINA_TRUE);
+}
+
 /////////////////////////////////////////////////////////
 
 static void
@@ -979,6 +1050,18 @@ static const struct zxdg_importer_v1_interface _e_zxdg_importer_v1_interface =
    _e_comp_wl_zxdg_importer_v1_import,
 };
 
+static const struct zxdg_exporter_v2_interface _e_zxdg_exporter_v2_interface =
+{
+   _e_comp_wl_zxdg_exporter_v1_exporter_destroy,
+   _e_comp_wl_zxdg_exporter_v2_export_toplevel,
+};
+
+static const struct zxdg_importer_v2_interface _e_zxdg_importer_v2_interface =
+{
+   _e_comp_wl_zxdg_importer_v1_importer_destroy,
+   _e_comp_wl_zxdg_importer_v2_import_toplevel,
+};
+
 static const struct zwp_relative_pointer_manager_v1_interface _e_zwp_relative_pointer_manager_v1_interface =
 {
    _e_comp_wl_zwp_relative_pointer_manager_v1_destroy,
@@ -1408,6 +1491,8 @@ _e_comp_wl_##NAME##_cb_bind(struct wl_client *client, void *data EINA_UNUSED, ui
 GLOBAL_BIND_CB(session_recovery, zwp_e_session_recovery_interface)
 GLOBAL_BIND_CB(zxdg_exporter_v1, zxdg_exporter_v1_interface)
 GLOBAL_BIND_CB(zxdg_importer_v1, zxdg_importer_v1_interface)
+GLOBAL_BIND_CB(zxdg_exporter_v2, zxdg_exporter_v2_interface)
+GLOBAL_BIND_CB(zxdg_importer_v2, zxdg_importer_v2_interface)
 GLOBAL_BIND_CB(zwp_relative_pointer_manager_v1, zwp_relative_pointer_manager_v1_interface)
 GLOBAL_BIND_CB(zwp_pointer_constraints_v1, zwp_pointer_constraints_v1_interface)
 GLOBAL_BIND_CB(zxdg_output_manager_v1, zxdg_output_manager_v1_interface)
@@ -1507,6 +1592,8 @@ e_comp_wl_extensions_init(void)
    GLOBAL_CREATE_OR_RETURN(zxdg_exporter_v1, zxdg_exporter_v1_interface, 1);
    e_comp_wl->extensions->zxdg_exporter_v1.surfaces = eina_hash_string_superfast_new(NULL);
    GLOBAL_CREATE_OR_RETURN(zxdg_importer_v1, zxdg_importer_v1_interface, 1);
+   GLOBAL_CREATE_OR_RETURN(zxdg_exporter_v2, zxdg_exporter_v2_interface, 1);
+   GLOBAL_CREATE_OR_RETURN(zxdg_importer_v2, zxdg_importer_v2_interface, 1);
    GLOBAL_CREATE_OR_RETURN(zwp_relative_pointer_manager_v1, zwp_relative_pointer_manager_v1_interface, 1);
    GLOBAL_CREATE_OR_RETURN(zwp_pointer_constraints_v1, zwp_pointer_constraints_v1_interface, 1);
    e_comp_wl->extensions->zwp_pointer_constraints_v1.constraints = eina_hash_pointer_new(NULL);
diff --git a/src/bin/generated/meson.build b/src/bin/generated/meson.build
index d928e370d..f2ac4ae48 100644
--- a/src/bin/generated/meson.build
+++ b/src/bin/generated/meson.build
@@ -4,6 +4,7 @@ protos = [
   '../../protocol/efl-aux-hints.xml',
   '../../protocol/action_route.xml',
   '@0@/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml'.format(dir_wayland_protocols),
+  '@0@/unstable/xdg-foreign/xdg-foreign-unstable-v2.xml'.format(dir_wayland_protocols),
   '@0@/unstable/relative-pointer/relative-pointer-unstable-v1.xml'.format(dir_wayland_protocols),
   '@0@/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml'.format(dir_wayland_protocols),
   '@0@/unstable/xdg-output/xdg-output-unstable-v1.xml'.format(dir_wayland_protocols),
diff --git a/src/tests/wayland/globals.expected b/src/tests/wayland/globals.expected
index 2b42ab8e1..72588e6fc 100644
--- a/src/tests/wayland/globals.expected
+++ b/src/tests/wayland/globals.expected
@@ -16,6 +16,8 @@ zwp_primary_selection_device_manager_v1	1
 zwp_relative_pointer_manager_v1	1
 zxdg_decoration_manager_v1	1
 zxdg_exporter_v1	1
+zxdg_exporter_v2	1
 zxdg_importer_v1	1
+zxdg_importer_v2	1
 zxdg_output_manager_v1	3
 zxdg_shell_v6	1
diff --git a/src/tests/wayland/meson.build b/src/tests/wayland/meson.build
index f749b4e97..867f6dff5 100644
--- a/src/tests/wayland/meson.build
+++ b/src/tests/wayland/meson.build
@@ -27,6 +27,7 @@ foreach p: [
   '@0@/stable/xdg-shell/xdg-shell.xml'.format(dir_wayland_protocols),
   '@0@/unstable/xdg-shell/xdg-shell-unstable-v6.xml'.format(dir_wayland_protocols),
   '@0@/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml'.format(dir_wayland_protocols),
+  '@0@/unstable/xdg-foreign/xdg-foreign-unstable-v2.xml'.format(dir_wayland_protocols),
   '@0@/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml'.format(dir_wayland_protocols),
   '@0@/unstable/xdg-output/xdg-output-unstable-v1.xml'.format(dir_wayland_protocols),
   '@0@/staging/xdg-activation/xdg-activation-v1.xml'.format(dir_wayland_protocols),
@@ -56,6 +57,7 @@ wl_protocol_tests = [
   ['client-action', 'test_client_action.c'],
   ['no-dialogs', 'test_no_dialogs.c'],
   ['xdg-foreign', 'test_xdg_foreign.c'],
+  ['xdg-foreign-v2', 'test_xdg_foreign_v2.c'],
   ['seat-capabilities', 'test_seat_capabilities.c'],
   ['dialog-focus', 'test_dialog_focus.c'],
   ['buffer-release', 'test_buffer_release.c'],
diff --git a/src/tests/wayland/test_xdg_foreign_v2.c b/src/tests/wayland/test_xdg_foreign_v2.c
new file mode 100644
index 000000000..3b77e7178
--- /dev/null
+++ b/src/tests/wayland/test_xdg_foreign_v2.c
@@ -0,0 +1,222 @@
+/* xdg-foreign v2, and handles crossing between v1 and v2: the imported
+ * window becomes the parent of the importer's toplevel. */
+#include <stdio.h>
+#include <string.h>
+
+#include "e_wl_testkit.h"
+#include "xdg-foreign-unstable-v1-client-protocol.h"
+#include "xdg-foreign-unstable-v2-client-protocol.h"
+
+#define PROG "test-xdg-foreign-v2"
+#define APP_PARENT "e.test.foreign.parent"
+#define APP_CHILD "e.test.foreign.child"
+
+typedef struct
+{
+   Tk *tk;
+   Tk_Toplevel *top;
+   struct zxdg_exporter_v1 *exporter_v1;
+   struct zxdg_importer_v1 *importer_v1;
+   struct zxdg_exporter_v2 *exporter_v2;
+   struct zxdg_importer_v2 *importer_v2;
+} Peer;
+
+static char handle[256];
+static int destroyed;
+
+static void
+_handle_v1(void *d __attribute__((unused)), struct zxdg_exported_v1 *e __attribute__((unused)),
+           const char *h)
+{
+   snprintf(handle, sizeof(handle), "%s", h);
+}
+
+static void
+_handle_v2(void *d __attribute__((unused)), struct zxdg_exported_v2 *e __attribute__((unused)),
+           const char *h)
+{
+   snprintf(handle, sizeof(handle), "%s", h);
+}
+
+static void
+_destroyed_v1(void *d __attribute__((unused)), struct zxdg_imported_v1 *i __attribute__((unused)))
+{
+   destroyed++;
+}
+
+static void
+_destroyed_v2(void *d __attribute__((unused)), struct zxdg_imported_v2 *i __attribute__((unused)))
+{
+   destroyed++;
+}
+
+static const struct zxdg_exported_v1_listener _exported_v1_listener = { _handle_v1 };
+static const struct zxdg_exported_v2_listener _exported_v2_listener = { _handle_v2 };
+static const struct zxdg_imported_v1_listener _imported_v1_listener = { _destroyed_v1 };
+static const struct zxdg_imported_v2_listener _imported_v2_listener = { _destroyed_v2 };
+
+static void
+_peer_new(Peer *p, const char *app_id)
+{
+   p->tk = tk_connect(PROG);
+   p->exporter_v1 = tk_bind(p->tk, &zxdg_exporter_v1_interface, 1);
+   p->importer_v1 = tk_bind(p->tk, &zxdg_importer_v1_interface, 1);
+   p->exporter_v2 = tk_bind(p->tk, &zxdg_exporter_v2_interface, 1);
+   p->importer_v2 = tk_bind(p->tk, &zxdg_importer_v2_interface, 1);
+   if ((!p->exporter_v1) || (!p->importer_v1) || (!p->exporter_v2) || (!p->importer_v2))
+     tk_fail(p->tk, "missing xdg-foreign global");
+   p->top = tk_toplevel_new(p->tk, app_id, app_id, 200, 150);
+}
+
+/* Export with one version, import with the other, and check the parent.
+ * Returns the exported object so the caller decides when it goes. */
+static void *
+_export(Peer *p, int v2)
+{
+   void *obj;
+
+   handle[0] = 0;
+   if (v2)
+     {
+        obj = zxdg_exporter_v2_export_toplevel(p->exporter_v2, tk_toplevel_surface(p->top));
+        zxdg_exported_v2_add_listener(obj, &_exported_v2_listener, NULL);
+     }
+   else
+     {
+        obj = zxdg_exporter_v1_export(p->exporter_v1, tk_toplevel_surface(p->top));
+        zxdg_exported_v1_add_listener(obj, &_exported_v1_listener, NULL);
+     }
+   tk_sync(p->tk);
+   if (!handle[0]) tk_fail(p->tk, "no handle for a v%d export", v2 ? 2 : 1);
+   return obj;
+}
+
+static void *
+_import(Peer *p, int v2, struct wl_surface *child)
+{
+   void *obj;
+
+   if (v2)
+     {
+        obj = zxdg_importer_v2_import_toplevel(p->importer_v2, handle);
+        zxdg_imported_v2_add_listener(obj, &_imported_v2_listener, NULL);
+        if (child) zxdg_imported_v2_set_parent_of(obj, child);
+     }
+   else
+     {
+        obj = zxdg_importer_v1_import(p->importer_v1, handle);
+        zxdg_imported_v1_add_listener(obj, &_imported_v1_listener, NULL);
+        if (child) zxdg_imported_v1_set_parent_of(obj, child);
+     }
+   tk_settle(p->tk);
+   return obj;
+}
+
+static void
+_imported_destroy(void *obj, int v2)
+{
+   if (v2) zxdg_imported_v2_destroy(obj);
+   else zxdg_imported_v1_destroy(obj);
+}
+
+static void
+_exported_destroy(void *obj, int v2)
+{
+   if (v2) zxdg_exported_v2_destroy(obj);
+   else zxdg_exported_v1_destroy(obj);
+}
+
+static void
+_test_pair(Peer *parent, Peer *child, int ex_v2, int im_v2)
+{
+   unsigned int parent_id = tk_expect(parent->tk, APP_PARENT)->id;
+   void *ex, *im;
+
+   ex = _export(parent, ex_v2);
+   im = _import(child, im_v2, tk_toplevel_surface(child->top));
+   if (tk_expect(child->tk, APP_CHILD)->parent != parent_id)
+     tk_fail(child->tk, "export v%d, import v%d: not the parent", ex_v2 + 1, im_v2 + 1);
+   _imported_destroy(im, im_v2);
+   tk_settle(child->tk);
+   if (tk_expect(child->tk, APP_CHILD)->parent)
+     tk_fail(child->tk, "export v%d, import v%d: still the parent after destroy",
+             ex_v2 + 1, im_v2 + 1);
+   _exported_destroy(ex, ex_v2);
+   tk_sync(parent->tk);
+}
+
+/* A popup role, which v2 refuses where it wants a toplevel. */
+static struct wl_surface *
+_popup_new(Peer *p, Tk_Toplevel *parent)
+{
+   struct xdg_positioner *pos;
+   struct xdg_surface *xs;
+   struct wl_surface *s;
+
+   pos = xdg_wm_base_create_positioner(tk_wm_base(p->tk));
+   xdg_positioner_set_size(pos, 60, 40);
+   xdg_positioner_set_anchor_rect(pos, 10, 10, 1, 1);
+   s = tk_surface_new(p->tk);
+   xs = xdg_wm_base_get_xdg_surface(tk_wm_base(p->tk), s);
+   xdg_surface_get_popup(xs, tk_toplevel_xdg_surface(parent), pos);
+   return s;
+}
+
+static void
+_expect_error(Peer *p, const struct wl_interface *want, const char *what)
+{
+   const struct wl_interface *iface = NULL;
+
+   if ((tk_protocol_error(p->tk, &iface) != 0) || (iface != want))
+     tk_fail(p->tk, "%s is not an invalid_surface error", what);
+   tk_disconnect(p->tk);
+}
+
+int
+main(void)
+{
+   Peer parent, child, bad;
+   void *ex, *im;
+
+   _peer_new(&parent, APP_PARENT);
+   _peer_new(&child, APP_CHILD);
+
+   _test_pair(&parent, &child, 1, 1);
+   _test_pair(&parent, &child, 0, 1);
+   _test_pair(&parent, &child, 1, 0);
+
+   /* The exporter going away tells a v2 importer on its own interface. */
+   ex = _export(&parent, 1);
+   destroyed = 0;
+   im = _import(&child, 1, tk_toplevel_surface(child.top));
+   _exported_destroy(ex, 1);
+   tk_sync(parent.tk);
+   tk_sync(child.tk);
+   if (destroyed != 1) tk_fail(child.tk, "no destroyed after the export went");
+   _imported_destroy(im, 1);
+
+   /* A handle nobody exported: destroyed, and set_parent_of sent before
+    * the client could read it is ignored. */
+   destroyed = 0;
+   snprintf(handle, sizeof(handle), "no-such-handle");
+   im = _import(&child, 1, tk_toplevel_surface(child.top));
+   if (destroyed != 1) tk_fail(child.tk, "a failed v2 import was not destroyed");
+   _imported_destroy(im, 1);
+
+   _peer_new(&bad, "e.test.foreign.bad");
+   zxdg_exporter_v2_export_toplevel(bad.exporter_v2, _popup_new(&bad, bad.top));
+   _expect_error(&bad, &zxdg_exporter_v2_interface, "exporting a popup");
+
+   ex = _export(&parent, 1);
+   _peer_new(&bad, "e.test.foreign.bad");
+   im = zxdg_importer_v2_import_toplevel(bad.importer_v2, handle);
+   zxdg_imported_v2_set_parent_of(im, _popup_new(&bad, bad.top));
+   _expect_error(&bad, &zxdg_imported_v2_interface, "set_parent_of a popup");
+   _exported_destroy(ex, 1);
+   tk_sync(parent.tk);
+
+   tk_disconnect(child.tk);
+   tk_disconnect(parent.tk);
+   printf(PROG ": ok\n");
+   return 0;
+}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to