From b5cc53a8a8f2345fc3d51756dbaf101be7d2fe9e Mon Sep 17 00:00:00 2001 From: Window Maker Date: Sun, 24 May 2026 18:28:51 +0200 Subject: [PATCH] .gitignore: exclude generated wmaker-popup-v1 files; keep protocols/ Generated *-protocol.c and *-server-protocol.h files were accidentally committed in the previous commit. The .gitignore was also excluding the protocols/ source directory (where the XML lives). Fix both. --- .gitignore | 5 +- WINGs/wmaker-popup-v1-protocol.c | 72 --------------------- protocols/wmaker-popup-v1.xml | 103 +++++++++++++++++++++++++++++++ src/wmaker-popup-v1-protocol.c | 72 --------------------- 4 files changed, 107 insertions(+), 145 deletions(-) delete mode 100644 WINGs/wmaker-popup-v1-protocol.c create mode 100644 protocols/wmaker-popup-v1.xml delete mode 100644 src/wmaker-popup-v1-protocol.c diff --git a/.gitignore b/.gitignore index 7bc964e..49f8337 100644 --- a/.gitignore +++ b/.gitignore @@ -35,7 +35,6 @@ missing # Generated Wayland protocol headers *-protocol.h -protocols/ # Compiled binaries src/wmaker @@ -91,6 +90,10 @@ configure~ # WINGs Wayland-client backend: auto-generated by wayland-scanner WINGs/xdg-shell-protocol.c WINGs/xdg-shell-client-protocol.h +WINGs/wmaker-popup-v1-protocol.c +WINGs/wmaker-popup-v1-client-protocol.h +src/wmaker-popup-v1-protocol.c +src/wmaker-popup-v1-server-protocol.h # User scratch +cmd diff --git a/WINGs/wmaker-popup-v1-protocol.c b/WINGs/wmaker-popup-v1-protocol.c deleted file mode 100644 index f9f7ff5..0000000 --- a/WINGs/wmaker-popup-v1-protocol.c +++ /dev/null @@ -1,72 +0,0 @@ -/* Generated by wayland-scanner 1.24.0 */ - -/* - * Copyright © 2026 Window Maker Team - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#include -#include -#include -#include "wayland-util.h" - -#ifndef __has_attribute -# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */ -#endif - -#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4) -#define WL_PRIVATE __attribute__ ((visibility("hidden"))) -#else -#define WL_PRIVATE -#endif - -extern const struct wl_interface wmaker_popup_v1_interface; -extern const struct wl_interface xdg_toplevel_interface; - -static const struct wl_interface *wmaker_popup_v1_types[] = { - NULL, - NULL, - &wmaker_popup_v1_interface, - &xdg_toplevel_interface, -}; - -static const struct wl_message wmaker_popup_manager_v1_requests[] = { - { "destroy", "", wmaker_popup_v1_types + 0 }, - { "get_popup", "no", wmaker_popup_v1_types + 2 }, -}; - -WL_PRIVATE const struct wl_interface wmaker_popup_manager_v1_interface = { - "wmaker_popup_manager_v1", 1, - 2, wmaker_popup_manager_v1_requests, - 0, NULL, -}; - -static const struct wl_message wmaker_popup_v1_requests[] = { - { "destroy", "", wmaker_popup_v1_types + 0 }, - { "set_position", "ii", wmaker_popup_v1_types + 0 }, -}; - -WL_PRIVATE const struct wl_interface wmaker_popup_v1_interface = { - "wmaker_popup_v1", 1, - 2, wmaker_popup_v1_requests, - 0, NULL, -}; - diff --git a/protocols/wmaker-popup-v1.xml b/protocols/wmaker-popup-v1.xml new file mode 100644 index 0000000..0692811 --- /dev/null +++ b/protocols/wmaker-popup-v1.xml @@ -0,0 +1,103 @@ + + + + Copyright © 2026 Window Maker Team + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice (including the next + paragraph) shall be included in all copies or substantial portions of the + Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + + + This protocol allows Window Maker WINGs clients (such as WPrefs) to + request specific screen positions for borderless popup-style toplevel + windows (menu editor items, popup dropdown menus, tear-off menus). + + Standard xdg_shell does not allow clients to position toplevels — only + the compositor decides placement. This is correct for normal application + windows but breaks WINGs UI patterns that require client-driven positioning + (e.g., a dropdown menu must appear directly below its triggering button). + + A client wraps an xdg_toplevel with a wmaker_popup object and calls + set_position(x, y) before the surface is mapped. The compositor honours + the position when the surface becomes visible. Subsequent set_position + calls reposition the surface immediately. + + The popup loses no other xdg_toplevel features — it remains an ordinary + toplevel for input, focus, and lifetime purposes. The compositor is + additionally expected to omit decorations and skip taskbar/dock listing + for popup-wrapped toplevels (typically signalled via app_id). + + + + + Singleton global advertised by Window Maker compositors that support + client-driven popup positioning. Clients bind once and use it to wrap + xdg_toplevel objects. + + + + + Destroy the manager. Existing wmaker_popup objects remain valid. + + + + + + Wrap the given xdg_toplevel in a wmaker_popup object so the client + can drive its position. The toplevel must not yet be mapped. + Calling get_popup more than once for the same toplevel is a + protocol error. + + + + + + + + + Wrapper around an xdg_toplevel that lets the client drive screen + placement. Position is in compositor-global coordinates. + + + + + + + + + Destroying the popup reverts the toplevel to compositor-driven + placement. The underlying xdg_toplevel remains valid until the + client destroys it explicitly. + + + + + + Place the popup's top-left corner at (x, y) in compositor-global + coordinates. Takes effect on the next surface commit if the + toplevel is not yet mapped, or immediately if already mapped. + + + + + + diff --git a/src/wmaker-popup-v1-protocol.c b/src/wmaker-popup-v1-protocol.c deleted file mode 100644 index f9f7ff5..0000000 --- a/src/wmaker-popup-v1-protocol.c +++ /dev/null @@ -1,72 +0,0 @@ -/* Generated by wayland-scanner 1.24.0 */ - -/* - * Copyright © 2026 Window Maker Team - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#include -#include -#include -#include "wayland-util.h" - -#ifndef __has_attribute -# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */ -#endif - -#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4) -#define WL_PRIVATE __attribute__ ((visibility("hidden"))) -#else -#define WL_PRIVATE -#endif - -extern const struct wl_interface wmaker_popup_v1_interface; -extern const struct wl_interface xdg_toplevel_interface; - -static const struct wl_interface *wmaker_popup_v1_types[] = { - NULL, - NULL, - &wmaker_popup_v1_interface, - &xdg_toplevel_interface, -}; - -static const struct wl_message wmaker_popup_manager_v1_requests[] = { - { "destroy", "", wmaker_popup_v1_types + 0 }, - { "get_popup", "no", wmaker_popup_v1_types + 2 }, -}; - -WL_PRIVATE const struct wl_interface wmaker_popup_manager_v1_interface = { - "wmaker_popup_manager_v1", 1, - 2, wmaker_popup_manager_v1_requests, - 0, NULL, -}; - -static const struct wl_message wmaker_popup_v1_requests[] = { - { "destroy", "", wmaker_popup_v1_types + 0 }, - { "set_position", "ii", wmaker_popup_v1_types + 0 }, -}; - -WL_PRIVATE const struct wl_interface wmaker_popup_v1_interface = { - "wmaker_popup_v1", 1, - 2, wmaker_popup_v1_requests, - 0, NULL, -}; -