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

git pushed a commit to branch master
in repository enlightenment.

View the commit online.

commit 3f2b1eefe2e56afcc7736446ff62bcc5bc9fcbac
Author: Cedric BAIL <[email protected]>
AuthorDate: Thu Nov 19 18:25:50 2026 -0600

    tests - drag an EFL window that draws its own decorations on X11
    
    The X11 tests were Xlib programs that made up a CSD client: a window with
    _MOTIF_WM_HINTS and a hand-built _NET_WM_MOVERESIZE. EFL already is one.
    An elementary window draws its own decorations on X11 with
    EFL_WIN_FRAME_MODE=on, and a press on its title bar sends E the move
    request through ecore_x, as a GTK header bar does. So the tests now use
    that: elementary and ecore_x, and no Xlib or XTest of their own.
    
    The move test presses the window's own title bar. The resize test presses
    the content and calls elm_win_move_resize_start(), which is what the
    frame's border does: where that border is depends on the theme.
    
    The pointer goes through ecore_x_test_fake_mouse_move/down/up(), new in
    EFL 1.30: E has to see the press, the motion and the release from the
    server under its grab.
    
    With b2e61b1f2 applied, x11-csd-move-2heads now shows what was reported
    when it was reverted: a drag from the title bar on the right-hand head
    throws the window from +1525+353 to +37+25, on the left-hand one.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 AGENTS.md                       |   9 +-
 src/tests/x11/meson.build       |  12 +-
 src/tests/x11/test_csd_move.c   |  50 ++++----
 src/tests/x11/test_csd_resize.c |  57 ++++-----
 src/tests/x11/x11_testkit.h     | 275 ++++++++++++++++++++++++++--------------
 5 files changed, 240 insertions(+), 163 deletions(-)

diff --git a/AGENTS.md b/AGENTS.md
index 7631515e7..fbdf8df98 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -99,9 +99,12 @@ protects nothing.
   `wl_protocol_tests` in that directory's `meson.build`. When it needs
   something from E that the protocol does not give, extend `wl-test.xml`:
   append new requests at the end and bump its version.
-* An X11 test is a plain Xlib program in `src/tests/x11/`, using XTest for
-  input. Do what the real client does: a GTK header bar sends
-  `_NET_WM_MOVERESIZE` after a button press, so the test does too.
+* An X11 test is an EFL program in `src/tests/x11/`, built on
+  `x11_testkit.h`: elementary windows and ecore_x, not Xlib. Do what the
+  real client does: an elementary window draws its own decorations on X11
+  with `EFL_WIN_FRAME_MODE=on` and sends `_NET_WM_MOVERESIZE` from a press
+  on them, as a GTK header bar does. `ecore_x_test_fake_mouse_*()` drive
+  the pointer.
 * Test the behaviour, not the implementation: a test that has to be
   rewritten every time the code is refactored protects nothing.
 * A test that waits on a timer flakes. Wait for an event or a state where
diff --git a/src/tests/x11/meson.build b/src/tests/x11/meson.build
index 5b4b19ecf..e61f23b25 100644
--- a/src/tests/x11/meson.build
+++ b/src/tests/x11/meson.build
@@ -8,18 +8,18 @@
 # Xvfb is not something a build machine has to have: run-x11.sh exits 77
 # without it, and meson reports a skip.
 
-dep_x11 = dependency('x11', required: false)
-dep_xtst = dependency('xtst', required: false)
-
-if dep_x11.found() and dep_xtst.found()
+# The windows under test are elementary ones, drawing their own decorations
+# on X11, and ecore_x drives the pointer. Not in a Wayland-only build.
+if not config_h.has('HAVE_WAYLAND_ONLY')
   x11_test_env = environment()
   x11_test_env.set('E_TEST_COMPOSITOR', e_test_compositor)
 
+  x11_test_deps = [dep_elementary, dep_ecore_x]
   x11_tests = [
     ['x11-csd-move', executable('test_x11_csd_move', 'test_csd_move.c',
-                                dependencies: [dep_x11, dep_xtst])],
+                                dependencies: x11_test_deps)],
     ['x11-csd-resize', executable('test_x11_csd_resize', 'test_csd_resize.c',
-                                  dependencies: [dep_x11, dep_xtst])],
+                                  dependencies: x11_test_deps)],
   ]
 
   # Two heads as well: a window on the right-hand screen is far from 0,0,
diff --git a/src/tests/x11/test_csd_move.c b/src/tests/x11/test_csd_move.c
index 0fffd33ff..d8adcd72b 100644
--- a/src/tests/x11/test_csd_move.c
+++ b/src/tests/x11/test_csd_move.c
@@ -1,7 +1,7 @@
-/* Move a client-side-decorated window with _NET_WM_MOVERESIZE, the way GTK
- * starts a drag from its header bar. E records where the drag starts from
- * the message itself: the window must follow the pointer by how far the
- * pointer travelled. */
+/* Move a window that draws its own decorations from its title bar: the
+ * press hands the drag to E with _NET_WM_MOVERESIZE, as a header bar does.
+ * E records where the drag starts from the message itself: the window must
+ * follow the pointer by how far the pointer travelled. */
 #include "x11_testkit.h"
 
 #define W 300
@@ -10,39 +10,33 @@
 #define DY 40
 
 int
-main(void)
+main(int argc, char **argv)
 {
-   Display *dpy;
-   Window win;
-   int x0, y0, x1, y1, px, py;
+   Evas_Object *win;
+   int x0, y0, x1, y1, px, py, sw, sh;
 
-   dpy = xtk_connect("test-x11-csd-move");
+   xtk_init(argc, argv, "test-x11-csd-move");
 
    /* Bottom right, which is the right-hand screen with two heads: a drag
     * that loses its starting point falls back to 0,0 and has to show. */
-   win = xtk_csd_window_new(dpy,
-                            DisplayWidth(dpy, DefaultScreen(dpy)) - W - 150,
-                            DisplayHeight(dpy, DefaultScreen(dpy)) - H - 150,
-                            W, H, "csd move under test");
-   xtk_geometry_get(dpy, win, &x0, &y0, NULL, NULL);
+   ecore_x_screen_size_get(ecore_x_default_screen_get(), &sw, &sh);
+   win = xtk_csd_window_new(sw - W - 200, sh - H - 200, W, H,
+                            "csd move under test");
+   xtk_geometry_get(win, &x0, &y0, NULL, NULL);
 
-   /* On the header bar. */
-   px = x0 + (W / 2);
-   py = y0 + 10;
-   xtk_pointer_move_to(dpy, px, py);
-   xtk_settle(dpy);
-   xtk_csd_drag_begin(dpy, win, px, py, NET_WM_MOVERESIZE_MOVE);
-   xtk_pointer_drag(dpy, px, py, DX, DY);
-   xtk_settle(dpy);
-   xtk_csd_drag_end(dpy);
-   xtk_geometry_get(dpy, win, &x1, &y1, NULL, NULL);
+   xtk_title_point(win, &px, &py);
+   xtk_pointer_move_to(px, py);
+   xtk_csd_move_begin();
+   xtk_pointer_drag(px, py, DX, DY);
+   xtk_settle(0.3);
+   xtk_csd_drag_end();
+   xtk_geometry_get(win, &x1, &y1, NULL, NULL);
 
    if ((x1 != x0 + DX) || (y1 != y0 + DY))
-     xtk_fail("a %d,%d drag from the header bar moved the window from "
-              "+%d+%d to +%d+%d, expected +%d+%d", DX, DY, x0, y0, x1, y1,
-              x0 + DX, y0 + DY);
+     xtk_fail("a %d,%d drag moved the window from +%d+%d to +%d+%d, "
+              "expected +%d+%d", DX, DY, x0, y0, x1, y1, x0 + DX, y0 + DY);
 
    printf("test-x11-csd-move: ok (+%d+%d -> +%d+%d)\n", x0, y0, x1, y1);
-   XCloseDisplay(dpy);
+   xtk_shutdown(win);
    return 0;
 }
diff --git a/src/tests/x11/test_csd_resize.c b/src/tests/x11/test_csd_resize.c
index 30c6e6721..b6ec831e8 100644
--- a/src/tests/x11/test_csd_resize.c
+++ b/src/tests/x11/test_csd_resize.c
@@ -1,7 +1,7 @@
-/* Resize a client-side-decorated window with _NET_WM_MOVERESIZE, the way
- * GTK starts a resize from the shadow around its window, from the
- * bottom-right corner and from the top-left one. The dragged corner must
- * follow the pointer and the opposite corner must stay where it was. */
+/* Resize a window that draws its own decorations, as it does from the
+ * border of its frame, from the bottom-right corner and from the top-left
+ * one. The dragged corner must follow the pointer and the opposite corner
+ * must stay where it was. */
 #include "x11_testkit.h"
 
 #define W 300
@@ -10,15 +10,15 @@
 #define DY 40
 
 static void
-corner_drag(Display *dpy, Window win, int direction, const char *corner)
+corner_drag(Evas_Object *win, Elm_Win_Move_Resize_Mode mode,
+            const char *corner)
 {
    int x0, y0, w0, h0, x1, y1, w1, h1, px, py, ex, ey, ew, eh;
 
-   xtk_geometry_get(dpy, win, &x0, &y0, &w0, &h0);
-   if (direction == NET_WM_MOVERESIZE_SIZE_TOPLEFT)
+   xtk_geometry_get(win, &x0, &y0, &w0, &h0);
+   if (mode == (ELM_WIN_MOVE_RESIZE_TOP | ELM_WIN_MOVE_RESIZE_LEFT))
      {
-        px = x0 + 2;
-        py = y0 + 2;
+        xtk_content_point(win, 2, 2, &px, &py);
         ex = x0 + DX;
         ey = y0 + DY;
         ew = w0 - DX;
@@ -26,21 +26,19 @@ corner_drag(Display *dpy, Window win, int direction, const char *corner)
      }
    else
      {
-        px = x0 + w0 - 2;
-        py = y0 + h0 - 2;
+        xtk_content_point(win, -2, -2, &px, &py);
         ex = x0;
         ey = y0;
         ew = w0 + DX;
         eh = h0 + DY;
      }
 
-   xtk_pointer_move_to(dpy, px, py);
-   xtk_settle(dpy);
-   xtk_csd_drag_begin(dpy, win, px, py, direction);
-   xtk_pointer_drag(dpy, px, py, DX, DY);
-   xtk_settle(dpy);
-   xtk_csd_drag_end(dpy);
-   xtk_geometry_get(dpy, win, &x1, &y1, &w1, &h1);
+   xtk_pointer_move_to(px, py);
+   xtk_csd_resize_begin(mode);
+   xtk_pointer_drag(px, py, DX, DY);
+   xtk_settle(0.3);
+   xtk_csd_drag_end();
+   xtk_geometry_get(win, &x1, &y1, &w1, &h1);
 
    if ((x1 != ex) || (y1 != ey) || (w1 != ew) || (h1 != eh))
      xtk_fail("a %d,%d drag of the %s corner made %dx%d+%d+%d into "
@@ -51,23 +49,24 @@ corner_drag(Display *dpy, Window win, int direction, const char *corner)
 }
 
 int
-main(void)
+main(int argc, char **argv)
 {
-   Display *dpy;
-   Window win;
+   Evas_Object *win;
+   int sw, sh;
 
-   dpy = xtk_connect("test-x11-csd-resize");
+   xtk_init(argc, argv, "test-x11-csd-resize");
 
    /* Bottom right, which is the right-hand screen with two heads: a drag
     * that loses its starting point falls back to 0,0 and has to show. */
-   win = xtk_csd_window_new(dpy,
-                            DisplayWidth(dpy, DefaultScreen(dpy)) - W - 200,
-                            DisplayHeight(dpy, DefaultScreen(dpy)) - H - 200,
-                            W, H, "csd resize under test");
+   ecore_x_screen_size_get(ecore_x_default_screen_get(), &sw, &sh);
+   win = xtk_csd_window_new(sw - W - 250, sh - H - 250, W, H,
+                            "csd resize under test");
 
-   corner_drag(dpy, win, NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT, "bottom-right");
-   corner_drag(dpy, win, NET_WM_MOVERESIZE_SIZE_TOPLEFT, "top-left");
+   corner_drag(win, ELM_WIN_MOVE_RESIZE_BOTTOM | ELM_WIN_MOVE_RESIZE_RIGHT,
+               "bottom-right");
+   corner_drag(win, ELM_WIN_MOVE_RESIZE_TOP | ELM_WIN_MOVE_RESIZE_LEFT,
+               "top-left");
 
-   XCloseDisplay(dpy);
+   xtk_shutdown(win);
    return 0;
 }
diff --git a/src/tests/x11/x11_testkit.h b/src/tests/x11/x11_testkit.h
index fd7c97255..640ae52df 100644
--- a/src/tests/x11/x11_testkit.h
+++ b/src/tests/x11/x11_testkit.h
@@ -1,26 +1,31 @@
 /* Helpers shared by the X11 tests: each test is a single program, so these
- * are static and live in the header. */
+ * are static and live in the header.
+ *
+ * The window under test is an elementary window with its own decorations,
+ * which EFL draws on X11 when EFL_WIN_FRAME_MODE=on. A press on them hands
+ * the drag to the window manager with _NET_WM_MOVERESIZE, as GTK does, so
+ * the request E gets is the one a real CSD client sends.
+ *
+ * The pointer is moved and pressed with ecore_x_test_fake_mouse_*(): the
+ * press, the motion and the release have to come from the server for E to
+ * see them under its grab. */
 #ifndef X11_TESTKIT_H
 #define X11_TESTKIT_H
 
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 #include <unistd.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/extensions/XTest.h>
-
-/* _NET_WM_MOVERESIZE directions and source, from the EWMH spec */
-#define NET_WM_MOVERESIZE_SIZE_TOPLEFT     0
-#define NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4
-#define NET_WM_MOVERESIZE_MOVE             8
-#define NET_WM_SOURCE_APPLICATION          1
+#include <Elementary.h>
+#include <Ecore_X.h>
 
 static const char *xtk_name = "x11-test";
 
-static void
+/* What the next press in the content starts, nothing when 0. */
+static Elm_Win_Move_Resize_Mode xtk_press_mode = 0;
+static Eina_Bool xtk_press_started = EINA_FALSE;
+
+static inline void
 xtk_fail(const char *fmt, ...)
 {
    va_list ap;
@@ -33,124 +38,200 @@ xtk_fail(const char *fmt, ...)
    exit(1);
 }
 
-static Display *
-xtk_connect(const char *name)
+/* Runs the main loop for a while: E and the window both have to handle
+ * what was just sent, and X has no round trip that waits for the window
+ * manager. */
+static inline void
+xtk_settle(double seconds)
 {
-   Display *dpy;
+   double end = ecore_time_get() + seconds;
 
+   ecore_x_sync();
+   while (ecore_time_get() < end)
+     {
+        ecore_main_loop_iterate();
+        usleep(10 * 1000);
+     }
+}
+
+static inline void
+xtk_init(int argc, char **argv, const char *name)
+{
    xtk_name = name;
-   dpy = XOpenDisplay(NULL);
-   if (!dpy) xtk_fail("cannot open the display");
-   return dpy;
+   /* Decorations drawn by the client on X11 as well, not only on Wayland. */
+   setenv("EFL_WIN_FRAME_MODE", "on", 1);
+   setenv("ELM_ENGINE", "software_x11", 1);
+   elm_init(argc, argv);
+   /* elementary opens the display with its first window, too late here. */
+   if (!ecore_x_init(NULL)) xtk_fail("cannot open the display");
 }
 
-/* Gives E time to handle what was just sent: X has no round trip that
- * waits for the window manager. */
-static void
-xtk_settle(Display *dpy)
+/* Where the X window is on the root window: E reparents it into its own
+ * frame, so the position is the sum down from the root. */
+static inline void
+xtk_geometry_get(Evas_Object *win, int *x, int *y, int *w, int *h)
 {
-   XSync(dpy, False);
-   usleep(300 * 1000);
+   Ecore_X_Window xwin = elm_win_xwindow_get(win), root, p;
+   int px, py;
+
+   ecore_x_sync();
+   root = ecore_x_window_root_get(xwin);
+   ecore_x_window_geometry_get(xwin, x, y, w, h);
+   for (p = ecore_x_window_parent_get(xwin); p && (p != root);
+        p = ecore_x_window_parent_get(p))
+     {
+        ecore_x_window_geometry_get(p, &px, &py, NULL, NULL);
+        *x += px;
+        *y += py;
+     }
 }
 
-static void
-xtk_geometry_get(Display *dpy, Window win, int *x, int *y, int *w, int *h)
+static inline void
+xtk_pointer_move_to(int x, int y)
 {
-   XWindowAttributes attr;
-   Window child;
-
-   XSync(dpy, False);
-   XTranslateCoordinates(dpy, win, DefaultRootWindow(dpy), 0, 0, x, y, &child);
-   XGetWindowAttributes(dpy, win, &attr);
-   if (w) *w = attr.width;
-   if (h) *h = attr.height;
-}
-
-static void
-xtk_pointer_move_to(Display *dpy, int x, int y)
-{
-   XTestFakeMotionEvent(dpy, DefaultScreen(dpy), x, y, CurrentTime);
-   XSync(dpy, False);
-   usleep(50 * 1000);
+   if (!ecore_x_test_fake_mouse_move(x, y))
+     xtk_fail("cannot move the pointer: XTest missing from ecore_x or X");
+   xtk_settle(0.05);
 }
 
 /* Moves the pointer by dx,dy in steps, as a hand would. */
-static void
-xtk_pointer_drag(Display *dpy, int x, int y, int dx, int dy)
+static inline void
+xtk_pointer_drag(int x, int y, int dx, int dy)
 {
    int i;
 
    for (i = 1; i <= 10; i++)
-     xtk_pointer_move_to(dpy, x + (i * dx / 10), y + (i * dy / 10));
+     xtk_pointer_move_to(x + (i * dx / 10), y + (i * dy / 10));
 }
 
-/* A window with no server-side frame, as a GTK header bar window asks for,
- * mapped where it asked to be. Returns once it is mapped. */
-static Window
-xtk_csd_window_new(Display *dpy, int x, int y, int w, int h, const char *title)
+/* Where a press lands in the window's content, x and y in from its
+ * top-left corner, or from its bottom-right one when negative: the
+ * decorations the window draws itself surround the content. */
+static inline void
+xtk_content_point(Evas_Object *win, int x, int y, int *px, int *py)
 {
-   /* _MOTIF_WM_HINTS: flags = decorations, decorations = none */
-   long mwm[5] = { 2, 0, 0, 0, 0 };
-   XSizeHints *hints;
-   XEvent ev;
-   Window win;
-   Atom motif;
+   Evas_Object *bg = evas_object_data_get(win, "xtk_bg");
+   int wx, wy, fx, fy, cx, cy, cw, ch;
 
-   win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), x, y, w, h, 0,
-                             0, 0xffffff);
-   hints = XAllocSizeHints();
-   hints->flags = USPosition | PPosition;
-   hints->x = x;
-   hints->y = y;
-   XSetWMNormalHints(dpy, win, hints);
-   XFree(hints);
-   XStoreName(dpy, win, title);
+   xtk_geometry_get(win, &wx, &wy, NULL, NULL);
+   /* Canvas coordinates start inside the decorations. */
+   evas_output_framespace_get(evas_object_evas_get(win), &fx, &fy, NULL, NULL);
+   evas_object_geometry_get(bg, &cx, &cy, &cw, &ch);
+   cx += fx;
+   cy += fy;
+   *px = wx + (x >= 0 ? cx + x : cx + cw + x);
+   *py = wy + (y >= 0 ? cy + y : cy + ch + y);
+}
 
-   motif = XInternAtom(dpy, "_MOTIF_WM_HINTS", False);
-   XChangeProperty(dpy, win, motif, motif, 32, PropModeReplace,
-                   (unsigned char *)mwm, 5);
+/* The middle of the title bar the window draws above its content. */
+static inline void
+xtk_title_point(Evas_Object *win, int *px, int *py)
+{
+   Evas *e = evas_object_evas_get(win);
+   int wx, wy, fy, ww;
 
-   XSelectInput(dpy, win, StructureNotifyMask);
-   XMapWindow(dpy, win);
-   do XNextEvent(dpy, &ev); while (ev.type != MapNotify);
-   xtk_settle(dpy);
+   xtk_geometry_get(win, &wx, &wy, &ww, NULL);
+   /* The title bar is the top of the space around the canvas, below the
+    * shadow: lower than its middle rather than higher. */
+   evas_output_framespace_get(e, NULL, &fy, NULL, NULL);
+   *px = wx + (ww / 2);
+   *py = wy + (fy / 2) + 4;
+}
+
+static inline void
+_xtk_press_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
+              void *event_info EINA_UNUSED)
+{
+   if (xtk_press_mode)
+     xtk_press_started = elm_win_move_resize_start(data, xtk_press_mode);
+}
+
+/* A window that draws its own decorations, at x,y with content w by h,
+ * mapped where it asked to be. */
+static inline Evas_Object *
+xtk_csd_window_new(int x, int y, int w, int h, const char *title)
+{
+   Evas_Object *win, *bg;
+   Ecore_X_Window xwin;
+
+   win = elm_win_add(NULL, title, ELM_WIN_BASIC);
+   elm_win_title_set(win, title);
+   elm_win_autodel_set(win, EINA_FALSE);
+
+   bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_event_callback_add(bg, EVAS_CALLBACK_MOUSE_DOWN,
+                                  _xtk_press_cb, win);
+   evas_object_data_set(win, "xtk_bg", bg);
+   evas_object_show(bg);
+
+   evas_object_resize(win, w, h);
+   evas_object_move(win, x, y);
+
+   /* The position is the user's, as a session restore would give it: E
+    * places it there instead of choosing one. */
+   xwin = elm_win_xwindow_get(win);
+   ecore_x_icccm_size_pos_hints_set(xwin, EINA_TRUE,
+                                    ECORE_X_GRAVITY_NW, 0, 0, 0, 0,
+                                    0, 0, 1, 1, 0.0, 0.0);
+   evas_object_show(win);
+   xtk_settle(1.0);
+   if (!ecore_x_window_visible_get(xwin))
+     xtk_fail("the window was never mapped");
    return win;
 }
 
-/* What a CSD client does on a press in its own decorations: it gives up
- * the implicit grab the press took and hands the drag to the window
- * manager. The pointer must already be at x,y. */
-static void
-xtk_csd_drag_begin(Display *dpy, Window win, int x, int y, int direction)
+static inline void
+xtk_button_press(void)
 {
-   XEvent ev;
+   ecore_x_test_fake_mouse_down(1);
+   xtk_settle(0.3);
+}
 
-   XTestFakeButtonEvent(dpy, 1, True, CurrentTime);
-   XSync(dpy, False);
-   XUngrabPointer(dpy, CurrentTime);
+/* A press on the title bar: the window's own decorations hand the move to
+ * the window manager, as a header bar does. The pointer must already be on
+ * the title bar. */
+static inline void
+xtk_csd_move_begin(void)
+{
+   xtk_press_mode = 0;
+   xtk_button_press();
+}
 
-   memset(&ev, 0, sizeof(ev));
-   ev.xclient.type = ClientMessage;
-   ev.xclient.window = win;
-   ev.xclient.message_type = XInternAtom(dpy, "_NET_WM_MOVERESIZE", False);
-   ev.xclient.format = 32;
-   ev.xclient.data.l[0] = x;
-   ev.xclient.data.l[1] = y;
-   ev.xclient.data.l[2] = direction;
-   ev.xclient.data.l[3] = 1;
-   ev.xclient.data.l[4] = NET_WM_SOURCE_APPLICATION;
-   XSendEvent(dpy, DefaultRootWindow(dpy), False,
-              SubstructureRedirectMask | SubstructureNotifyMask, &ev);
-   xtk_settle(dpy);
+/* A press in the content that the window turns into a resize from the
+ * given edges, with the call its own decorations make from their border.
+ * The pointer must already be over the content. */
+static inline void
+xtk_csd_resize_begin(Elm_Win_Move_Resize_Mode mode)
+{
+   xtk_press_mode = mode;
+   xtk_press_started = EINA_FALSE;
+   xtk_button_press();
+   if (!xtk_press_started)
+     xtk_fail("the press did not start a resize");
 }
 
 /* E moves and resizes only the composited frame during a drag; the X
  * window follows when the button is released. */
-static void
-xtk_csd_drag_end(Display *dpy)
+static inline void
+xtk_csd_drag_end(void)
 {
-   XTestFakeButtonEvent(dpy, 1, False, CurrentTime);
-   xtk_settle(dpy);
+   ecore_x_test_fake_mouse_up(1);
+   xtk_settle(0.3);
+   /* The window never sees that release, E took it: it learns the drag is
+    * over when the pointer comes back in, and refuses the next one until
+    * then. */
+   xtk_pointer_move_to(0, 0);
+   xtk_settle(0.1);
+}
+
+static inline void
+xtk_shutdown(Evas_Object *win)
+{
+   evas_object_del(win);
+   ecore_x_shutdown();
+   elm_shutdown();
 }
 
 #endif

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

Reply via email to