cleanup: remove stale Phase planning comments and DBG/DBG1 debug macros from all wayland backend source files

This commit is contained in:
Window Maker 2026-06-04 21:34:37 +02:00
parent 01c2664b2f
commit 3eaf2bc499
12 changed files with 284 additions and 95 deletions

View File

@ -21,10 +21,6 @@
#include <time.h>
#include <pthread.h>
/* debug helper for __func__ */
#define DBG() wwarning("DEBUG %s:%d: %s", __FILE__, __LINE__, __func__)
#define DBG1(fmt, ...) wwarning("DEBUG %s:%d: " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
#include <wayland-server-core.h>
#include <wlr/backend.h>
#include <wlr/backend/headless.h>
@ -148,7 +144,7 @@ struct wl_frame_buf *frame_buf_find(WNativeWindow id);
/*
* Phase 37: Wayland event loop timer — drives client frame callbacks.
* Wayland event loop timer — drives client frame callbacks.
*/
/* Called from within the event loop when the shutdown self-pipe becomes
* readable. Calling wl_display_terminate() here is safe because we are
@ -357,7 +353,7 @@ wl_display_open(const char *name)
return NULL;
}
/* Phase 18: choose backend — nested Wayland if WMAKER_WAYLAND_NESTED=1
/* choose backend — nested Wayland if WMAKER_WAYLAND_NESTED=1
* is set (run inside an existing Wayland compositor), otherwise headless.
* Both modes always include a headless backend (headless_inner) so that
* wlr_headless_add_input_device works regardless of nesting. */
@ -448,12 +444,12 @@ wl_display_open(const char *name)
if (!wl_state.allocator)
wwarning("wl_backend: allocator unavailable; wlr_output_init_render will be skipped");
/* Phase 34: output layout for multi-head geometry tracking.
/* output layout for multi-head geometry tracking.
* Must be created before backend start so handle_backend_new_output
* can add the output to the layout when it fires. */
wl_state.output_layout = wlr_output_layout_create(wl_state.display);
/* Phase 23: create hardware cursor tracker and load xcursor theme.
/* create hardware cursor tracker and load xcursor theme.
* wlr_cursor tracks the logical cursor position across the output
* layout and communicates cursor image changes to each output.
* In nested Wayland mode this calls wl_pointer.set_cursor on the host
@ -477,7 +473,7 @@ wl_display_open(const char *name)
wwarning("wl_backend: wlr_cursor_create failed; cursor will be invisible");
}
/* Phase 18: scene graph — MUST be created before wlr_backend_start so
/* scene graph — MUST be created before wlr_backend_start so
* that handle_backend_new_output can create the scene_output immediately
* when the output fires (for nested Wayland, new_output fires during
* wlr_backend_start via the host compositor roundtrip). */
@ -523,7 +519,7 @@ wl_display_open(const char *name)
} else
wwarning("wl_backend: wlr_scene_create failed (no compositing)");
/* Phase 20: wire new_input BEFORE starting the backend so that real
/* wire new_input BEFORE starting the backend so that real
* input devices from the nested Wayland backend (fired during
* wlr_backend_start) are captured before the headless devices are
* added explicitly below. */
@ -587,7 +583,7 @@ wl_display_open(const char *name)
wl_signal_add(&wl_state.seat->events.request_set_cursor,
&wl_state.seat_request_cursor_listener);
}
/* Phase 25: handle clipboard set-selection requests on the seat so
/* handle clipboard set-selection requests on the seat so
* Ctrl-C / copy operations from clients propagate to the seat selection
* and become available for paste in other clients. */
if (wl_state.seat) {
@ -604,7 +600,7 @@ wl_display_open(const char *name)
wwarning("wl_backend: DND start_drag wired");
}
/* Phase 26: primary selection (middle-click paste) via
/* primary selection (middle-click paste) via
* zwp_primary_selection_device_manager_v1. */
wl_state.primary_selection_mgr =
wlr_primary_selection_v1_device_manager_create(wl_state.display);
@ -616,7 +612,7 @@ wl_display_open(const char *name)
wwarning("wl_backend: primary selection (middle-click) wired");
}
/* Phase 27: xdg-output — panels and HiDPI apps query logical output
/* xdg-output — panels and HiDPI apps query logical output
* geometry via zxdg_output_manager_v1. Requires output_layout. */
if (wl_state.output_layout) {
wl_state.xdg_output_mgr =
@ -626,7 +622,7 @@ wl_display_open(const char *name)
wwarning("wl_backend: xdg-output-manager created");
}
/* Phase 28: idle-inhibit — video players and games create inhibitor
/* idle-inhibit — video players and games create inhibitor
* objects to suppress screen blanking while active. */
wl_state.idle_inhibit_mgr =
wlr_idle_inhibit_v1_create(wl_state.display);
@ -637,7 +633,7 @@ wl_display_open(const char *name)
wwarning("wl_backend: idle-inhibit manager created");
}
/* Phase 29: wp_viewporter — hardware video scaling and subsurface damage
/* wp_viewporter — hardware video scaling and subsurface damage
* subset used by mpv, Chromium, Firefox, SDL2. */
wl_state.viewporter = wlr_viewporter_create(wl_state.display);
if (wl_state.viewporter)
@ -659,7 +655,7 @@ wl_display_open(const char *name)
wwarning("wl_backend: pointer-constraints created");
}
/* Phase 31: keyboard shortcuts inhibitor — fullscreen apps / remote desktop
/* keyboard shortcuts inhibitor — fullscreen apps / remote desktop
* request to suppress WM keyboard shortcuts. */
wl_state.shortcuts_inhibit_mgr =
wlr_keyboard_shortcuts_inhibit_v1_create(wl_state.display);
@ -670,7 +666,7 @@ wl_display_open(const char *name)
&wl_state.new_shortcuts_inhibitor_listener);
wwarning("wl_backend: keyboard-shortcuts-inhibit created");
}
/* Phase 32: GPU zero-copy (linux-dmabuf), screencopy, export-dmabuf.
/* GPU zero-copy (linux-dmabuf), screencopy, export-dmabuf.
* All three are purely passive globals: wlroots handles the protocol
* implementation internally; no event listeners are required. */
wl_state.linux_dmabuf =
@ -688,7 +684,7 @@ wl_display_open(const char *name)
if (wl_state.export_dmabuf_mgr)
wwarning("wl_backend: export-dmabuf manager created (zwlr_export_dmabuf_manager_v1)");
/* Phase 33: output management (wlr-output-management), output power (DPMS),
/* output management (wlr-output-management), output power (DPMS),
* gamma control (Night Light / redshift), and presentation time feedback. */
wl_state.output_mgr = wlr_output_manager_v1_create(wl_state.display);
if (wl_state.output_mgr) {
@ -714,7 +710,7 @@ wl_display_open(const char *name)
if (wl_state.presentation)
wwarning("wl_backend: presentation-time created (wp_presentation)");
/* Phase 34: text input v3, input method v2, virtual keyboard v1.
/* text input v3, input method v2, virtual keyboard v1.
* All three are passive globals for IME / on-screen keyboard support. */
wl_state.text_input_mgr =
wlr_text_input_manager_v3_create(wl_state.display);
@ -741,7 +737,7 @@ wl_display_open(const char *name)
wwarning("wl_backend: virtual-keyboard-v1 created (zwp_virtual_keyboard_manager_v1)");
}
/* Phase 35: foreign toplevel management — lets taskbars enumerate windows.
/* foreign toplevel management — lets taskbars enumerate windows.
* xdg_activation — focus-token protocol replacing _NET_ACTIVE_WINDOW. */
wl_state.foreign_toplevel_mgr =
wlr_foreign_toplevel_manager_v1_create(wl_state.display);
@ -764,7 +760,7 @@ wl_display_open(const char *name)
wwarning("wl_backend: layer-shell created (zwlr_layer_shell_v1)");
}
/* Phase 37: clipboard manager (wl-clipboard/cliphist), input inhibitor
/* clipboard manager (wl-clipboard/cliphist), input inhibitor
* (lock screen input gating), virtual pointer (remote desktop / VNC),
* KDE idle protocol, xdg-foreign v2 (cross-client window embedding). */
wl_state.data_control_mgr =
@ -805,7 +801,7 @@ wl_display_open(const char *name)
if (wl_state.wmaker_popup_manager)
wwarning("wl_backend: wmaker-popup-v1 manager created");
/* Phase 64: advertise zxdg_decoration_manager_v1 so clients that
/* advertise zxdg_decoration_manager_v1 so clients that
* support server-side decorations can negotiate; we respond with
* CLIENT_SIDE since the Wayland path has no X11 frame rendering. */
wl_state.decoration_manager =
@ -820,7 +816,7 @@ wl_display_open(const char *name)
wlr_renderer_init_wl_shm(wl_state.renderer, wl_state.display);
/* wl_output global is created in handle_backend_new_output. */
/* Phase 43/53: In wlroots 0.19, the headless backend has no input devices.
/* 53: In wlroots 0.19, the headless backend has no input devices.
* Real keyboard/pointer devices arrive via handle_backend_new_input when
* the nested Wayland backend starts. We pre-create the default XKB keymap
* here so wl_keysym_to_keycode() can resolve key bindings during StartUp()
@ -911,7 +907,7 @@ wl_display_open(const char *name)
wwarning("wl_backend: XWayland unavailable (X11 clients will not work)");
}
/* Phase 37: periodic timer to drive client frame callbacks at ~60 fps.
/* periodic timer to drive client frame callbacks at ~60 fps.
* Using a timer avoids the swapchain/allocator complexity of the full
* render pipeline while still keeping Wayland clients unblocked. */
{
@ -950,7 +946,7 @@ wl_display_open(const char *name)
wwarning("wl_backend: shutdown pipe creation failed; SIGTERM may crash");
}
/* Phase 20: if a real keyboard was found from the nested backend
/* if a real keyboard was found from the nested backend
* (captured in handle_backend_new_input during wlr_backend_start),
* switch the seat to it now so keyboard focus notifications use the
* correct keymap and modifier state from the host compositor. This
@ -1016,7 +1012,7 @@ wl_display_close(void)
wl_state.x_display = NULL;
}
/* Phase 17: shut down XWayland.
/* shut down XWayland.
*
* wlroots 0.15 bug: wlr_xwayland_server_destroy() calls wl_client_destroy()
* on the XWayland Wayland client. After any Wayland client has connected
@ -1339,7 +1335,7 @@ wl_event_loop_run(void)
getenv("DISPLAY") ? getenv("DISPLAY") : "(unset)",
getenv("WAYLAND_DISPLAY") ? getenv("WAYLAND_DISPLAY") : "(unset)");
/* Phase A: register compositor dispatch callback so WINGs modal loops
/* register compositor dispatch callback so WINGs modal loops
* (WMRunModalLoop, color panels, etc.) can tick the event loop. */
{
WMScreen *wmscr = wl_get_wmscreen();
@ -1445,7 +1441,7 @@ wl_event_loop_terminate(void)
/*
* Phase 25: seat request_set_selection — client calls wl_data_device.set_selection
* seat request_set_selection — client calls wl_data_device.set_selection
* (i.e. Ctrl-C or other clipboard write). Forward to wlr_seat so the
* selection becomes available to the next client that reads it.
*/
@ -1461,7 +1457,7 @@ handle_seat_request_set_selection(struct wl_listener *listener, void *data)
/*
* Phase 26: seat request_set_primary_selection — client writes to the
* seat request_set_primary_selection — client writes to the
* primary selection buffer (e.g. by selecting text). Forward to
* wlr_seat so middle-click paste works in other clients.
*/
@ -1476,7 +1472,7 @@ handle_seat_request_primary_selection(struct wl_listener *listener, void *data)
}
/*
* Phase 28: idle_inhibit new_inhibitor — a client (e.g. mpv, a game) created
* idle_inhibit new_inhibitor — a client (e.g. mpv, a game) created
* an idle-inhibit object. wlroots tracks the inhibitor list internally;
* the compositor can query wl_state.idle_inhibit_mgr->inhibitors to decide
* whether to suppress screen blanking. For now we just log the event so
@ -1492,14 +1488,14 @@ handle_idle_new_inhibitor(struct wl_listener *listener, void *data)
}
/*
* Phase 29 (fix): scroll-wheel axis event handler.
* scroll-wheel axis event handler.
* wlr_event_pointer_axis carries orientation (vertical/horizontal), delta,
* delta_discrete (notches), and source (wheel vs finger). Forward directly
* to the seat so the focused Wayland client receives wl_pointer.axis events.
* Without this, scrolling is silently dropped in every Wayland client.
*/
/*
* Phase 30: new pointer constraint — a client requested pointer lock or
* new pointer constraint — a client requested pointer lock or
* pointer confinement (e.g. a game locking the cursor to its window).
* We activate the constraint immediately so the client gets confirmed.
* In headless mode the pointer is virtual so there is nothing physically
@ -1518,7 +1514,7 @@ handle_new_pointer_constraint(struct wl_listener *listener, void *data)
}
/*
* Phase 31: new keyboard shortcuts inhibitor — a fullscreen app or remote
* new keyboard shortcuts inhibitor — a fullscreen app or remote
* desktop client wants to suppress WM keyboard shortcuts.
* Activate the inhibitor immediately so the client knows it is granted.
* The existing wWaylandKeyPress() dispatcher in handle_keyboard_key already
@ -1911,14 +1907,14 @@ wl_screen_create_internals(WScreen *scr)
}
}
/* Phase 30: dock/clip now uses XWayland windows for rendering.
/* dock/clip now uses XWayland windows for rendering.
* The WM's dock logic (dock.c) creates X11 windows on the XWayland
* Display* and draws on them with Xlib — the compositor composites
* them like any other XWayland surface. */
/* wPreferences.flags.noclip = 1; */
/* wPreferences.flags.nodock = 1; */
/* Phase 30: dock creation is deferred to wl_event_loop_run() (after the
/* dock creation is deferred to wl_event_loop_run() (after the
* startup pump thread stops). wm_dock_create() calls wlr_scene_buffer_create
* which is not thread-safe — calling it here races with the pump thread's
* frame-timer callback that calls wlr_scene_output_commit on the same scene.
@ -2030,14 +2026,12 @@ static int parse_color_to_rcolor(WScreen *scr, const char *name, RColor *out)
void wl_set_desktop_background(WScreen *scr, const char *texture_desc)
{
DBG1("texture_desc=%s output=%p", texture_desc, wl_state.output);
if (!scr || !texture_desc)
return;
if (!wl_state.output) {
/* Output not ready yet — cache the background for later */
wfree(wl_state.pending_background);
wl_state.pending_background = wstrdup(texture_desc);
DBG1("output not ready, cached pending_background=%s", texture_desc);
return;
}
@ -2046,14 +2040,11 @@ static int parse_color_to_rcolor(WScreen *scr, const char *name, RColor *out)
int height = wl_state.output->height;
/* Parse the texture proplist */
DBG();
WMPropList *texpl = WMCreatePropListFromDescription(texture_desc);
if (!texpl) {
DBG1("WMCreatePropListFromDescription returned NULL");
return;
}
DBG();
/* Render the texture to an RImage using wrlib */
RContext *rc = scr->rcontext;
RImage *bg = NULL;
@ -2062,7 +2053,6 @@ static int parse_color_to_rcolor(WScreen *scr, const char *name, RColor *out)
WMPropList *type_pl = WMGetFromPLArray(texpl, 0);
const char *type = type_pl ? WMGetFromPLString(type_pl) : "";
DBG1("type=%s", type);
if (strcasecmp(type, "solid") == 0 && WMGetPropListItemCount(texpl) >= 2) {
const char *colorstr = WMGetFromPLString(WMGetFromPLArray(texpl, 1));
RColor color = {0x50, 0x50, 0x75, 0xFF};
@ -2129,7 +2119,6 @@ static int parse_color_to_rcolor(WScreen *scr, const char *name, RColor *out)
if (cstr) parse_color_to_rcolor(scr, cstr, &bgcolor);
}
if (path) {
DBG1("loading image: %s", path);
/* Try the path as-is first, then search pixmap_path */
RImage *img = RLoadImage(rc, path, 0);
if (!img && path[0] != '/') {
@ -2138,15 +2127,12 @@ static int parse_color_to_rcolor(WScreen *scr, const char *name, RColor *out)
for (int _pi = 0; search_paths[_pi]; _pi++) {
char _full[PATH_MAX];
snprintf(_full, sizeof(_full), "%s/%s", search_paths[_pi], path);
DBG1("trying: %s", _full);
img = RLoadImage(rc, _full, 0);
if (img) break;
}
}
if (!img) {
DBG1("RLoadImage failed: %s", RMessageForError(RErrorCode));
} else {
DBG1("image loaded: %dx%d fmt=%d", img->width, img->height, img->format);
/* Combine with background color if image has alpha */
if (img->format == RRGBAFormat)
@ -2238,13 +2224,10 @@ static int parse_color_to_rcolor(WScreen *scr, const char *name, RColor *out)
WMReleasePropList(texpl);
if (!bg) {
DBG1("bg is NULL after processing");
return;
}
DBG1("bg created: %dx%d fmt=%d", bg->width, bg->height, bg->format);
DBG1("converting RImage to pixman buffer (width=%d height=%d)", width, height);
/* Convert RImage to pixman_image and set as scene buffer */
struct wl_bg_buffer *buf = calloc(1, sizeof(*buf));
if (!buf) { RReleaseImage(bg); return; }
@ -2277,16 +2260,13 @@ static int parse_color_to_rcolor(WScreen *scr, const char *name, RColor *out)
if (wl_state.bg_rect)
wlr_scene_node_set_enabled(&wl_state.bg_rect->node, false);
DBG1("bg_image=%p bg_rect=%p level_tree=%p", wl_state.bg_image, wl_state.bg_rect, wl_state.level_trees[WL_LAYER_BACKGROUND]);
/* Replace or create the background scene buffer */
if (wl_state.bg_image) {
wlr_scene_buffer_set_buffer(wl_state.bg_image, &buf->base);
wlr_scene_node_set_enabled(&wl_state.bg_image->node, true);
DBG1("updated existing bg_image");
} else {
wl_state.bg_image = wlr_scene_buffer_create(
wl_state.level_trees[WL_LAYER_BACKGROUND], &buf->base);
DBG1("created new bg_image=%p", wl_state.bg_image);
}
/* Release old buffer, keep new one */

View File

@ -27,8 +27,8 @@ struct wl_toplevel_view *wl_find_view_by_id(WNativeWindow id);
int
wl_window_get_client_attrs(WNativeWindow win, WClientAttributes *out)
{
/* Phase 42: return real map_state and geometry from XDG surface.
* Phase 17: XWayland path uses xw_surface->mapped and width/height. */
/* return real map_state and geometry from XDG surface.
* XWayland path uses xw_surface->mapped and width/height. */
struct wl_toplevel_view *v = wl_find_view_by_id(win);
memset(out, 0, sizeof(*out));
if (v && v->xw_surface) {
@ -345,10 +345,10 @@ wl_client_synth_configure(WNativeWindow client_win,
int x, int y, int width, int height,
int border_width, WNativeWindow above)
{
/* Phase 44: send an XDG configure with the new size to the client.
* Phase 13: also record the WM-assigned position in the view so
/* send an XDG configure with the new size to the client.
* also record the WM-assigned position in the view so
* pointer hit-testing (view_surface_at) uses current coordinates.
* Phase 17: XWayland uses wlr_xwayland_surface_configure instead. */
* XWayland uses wlr_xwayland_surface_configure instead. */
(void)border_width; (void)above;
struct wl_toplevel_view *v = wl_find_view_by_id(client_win);
if (!v) return;
@ -389,8 +389,8 @@ void wl_client_remove_from_save_set(WNativeWindow win) { (void)win; }
void
wl_client_close(WNativeWindow win)
{
/* Phase 46: ask the surface to close.
* Phase 17: XWayland uses wlr_xwayland_surface_close. */
/* ask the surface to close.
* XWayland uses wlr_xwayland_surface_close. */
struct wl_toplevel_view *v = wl_find_view_by_id(win);
if (!v) return;
if (v->xw_surface) {

View File

@ -35,7 +35,7 @@ handle_seat_request_set_selection(struct wl_listener *listener, void *data)
/*
* Phase 26: seat request_set_primary_selection — client writes to the
* seat request_set_primary_selection — client writes to the
* primary selection buffer (e.g. by selecting text). Forward to
* wlr_seat so middle-click paste works in other clients.
*/
@ -50,7 +50,7 @@ handle_seat_request_primary_selection(struct wl_listener *listener, void *data)
}
/*
* Phase 28: idle_inhibit new_inhibitor — a client (e.g. mpv, a game) created
* idle_inhibit new_inhibitor — a client (e.g. mpv, a game) created
* an idle-inhibit object. wlroots tracks the inhibitor list internally;
* the compositor can query wl_state.idle_inhibit_mgr->inhibitors to decide
* whether to suppress screen blanking. For now we just log the event so
@ -66,7 +66,7 @@ handle_idle_new_inhibitor(struct wl_listener *listener, void *data)
}
/*
* Phase 29 (fix): scroll-wheel axis event handler.
* scroll-wheel axis event handler.
* wlr_event_pointer_axis carries orientation (vertical/horizontal), delta,
* delta_discrete (notches), and source (wheel vs finger). Forward directly
* to the seat so the focused Wayland client receives wl_pointer.axis events.
@ -93,7 +93,7 @@ handle_pointer_axis(struct wl_listener *listener, void *data)
}
/*
* Phase 30: new pointer constraint — a client requested pointer lock or
* new pointer constraint — a client requested pointer lock or
* pointer confinement (e.g. a game locking the cursor to its window).
* We activate the constraint immediately so the client gets confirmed.
* In headless mode the pointer is virtual so there is nothing physically
@ -112,7 +112,7 @@ handle_new_pointer_constraint(struct wl_listener *listener, void *data)
}
/*
* Phase 31: new keyboard shortcuts inhibitor — a fullscreen app or remote
* new keyboard shortcuts inhibitor — a fullscreen app or remote
* desktop client wants to suppress WM keyboard shortcuts.
* Activate the inhibitor immediately so the client knows it is granted.
* The existing wWaylandKeyPress() dispatcher in handle_keyboard_key already
@ -137,7 +137,7 @@ handle_pointer_button(struct wl_listener *listener, void *data)
struct wlr_pointer_button_event *ev = data;
if (!wl_state.seat)
return;
/* Phase 22: any button release ends an active compositor grab (move/resize).
/* any button release ends an active compositor grab (move/resize).
* Type 3 (WM policy grab) is NOT ended here — the policy code calls
* pointer_ungrab itself after processing the button release event. */
if (wl_state.grab_type && wl_state.grab_type != 3 &&
@ -147,7 +147,7 @@ handle_pointer_button(struct wl_listener *listener, void *data)
wl_update_pointer_focus(ev->time_msec);
return;
}
/* Phase 24: click-to-focus — on button press, find the view under the
/* click-to-focus — on button press, find the view under the
* pointer and focus + raise it via the WM policy layer.
* This mirrors what the X11 backend does via ButtonPress on frame windows. */
if (ev->state == WLR_BUTTON_PRESSED) {

View File

@ -34,7 +34,7 @@ wl_icccm_set_command(WNativeWindow win, char **argv, int argc)
int
wl_icccm_get_command(WNativeWindow win, char ***argv_out, int *argc_out)
{
/* Phase 57: return a NULL-terminated copy of the stored WM_COMMAND.
/* return a NULL-terminated copy of the stored WM_COMMAND.
* Caller frees with wl_icccm_free_command. */
struct wl_toplevel_view *v = wl_find_view_by_id(win);
int i;

View File

@ -143,7 +143,7 @@ wl_update_pointer_focus(uint32_t time_msec)
if (!wl_state.grab_type)
wl_set_cursor_image("left_ptr");
}
/* Phase 29 (FFP): focus-follows-pointer — when the pointer enters a new
/* focus-follows-pointer — when the pointer enters a new
* managed view, deliver WM keyboard focus without raising.
* Only fires when wPreferences.focus_mode == WKF_SLOPPY. */
{

View File

@ -125,7 +125,7 @@ handle_pointer_motion_absolute(struct wl_listener *listener, void *data)
{
(void)listener;
struct wlr_pointer_motion_absolute_event *ev = data;
/* Phase 23: use wlr_cursor_warp_absolute so wlroots maps the 0..1
/* use wlr_cursor_warp_absolute so wlroots maps the 0..1
* device-normalized coordinates to layout pixels and updates the
* hardware cursor in the nested window automatically. */
if (wl_state.cursor) {
@ -202,7 +202,7 @@ handle_pointer_motion_absolute(struct wl_listener *listener, void *data)
}
/*
* Phase 24: seat request_set_cursor — client wants to set a custom cursor
* seat request_set_cursor — client wants to set a custom cursor
* image (e.g. I-beam in a text field, hand over a link). Validate that
* the request comes from the currently focused pointer client, then hand
* the surface to wlr_cursor so the hardware cursor is updated on all

View File

@ -19,8 +19,8 @@ struct wl_toplevel_view *wl_find_view_by_xdg_surface(struct wlr_xdg_surface *sur
int
wl_prop_get_normal_hints(WNativeWindow win, WNormalHints *out, int *pre_icccm)
{
/* Phase 47: populate size constraints from XDG toplevel.
* Phase 17: also handles XWayland size_hints. */
/* populate size constraints from XDG toplevel.
* also handles XWayland size_hints. */
struct wl_toplevel_view *v = wl_find_view_by_id(win);
memset(out, 0, sizeof(*out));
*pre_icccm = 0;
@ -113,7 +113,7 @@ wl_prop_get_wmaker_menu(WNativeWindow win,
WNativeWindow
wl_prop_get_transient_for(WNativeWindow win)
{
/* Phase 65: return the synthetic ID of the parent XDG toplevel, or
/* return the synthetic ID of the parent XDG toplevel, or
* WNATIVE_NONE if this surface has no parent. The wlroots XDG
* implementation stores the parent as xdg_surface->toplevel->parent
* (a wlr_xdg_surface *). We walk the view list to find its ID. */

View File

@ -28,8 +28,7 @@
* wm_shm_surface_destroy — tear down scene node + drop wlr_buffer ref
* (shm_buf_destroy frees memory when ref = 0)
*
* Update model (Phase 29): surfaces are static after first commit.
* A re-draw path (drop + recreate scene node) will be added in Phase 30
* surfaces are static after first commit (no re-draw path yet)
* once the dock and title-bar code drives it.
*/

View File

@ -156,7 +156,7 @@ int
wl_stacking_query(WNativeWindow root,
WNativeWindow **out, unsigned int *count)
{
/* Phase 58: return synthetic IDs in Z-order (top to bottom).
/* return synthetic IDs in Z-order (top to bottom).
* RemakeStackList will find no WM_CTX_STACK entries for them
* and set window_count=0, but returning 1 avoids the "could not
* get window list" warning. */

View File

@ -56,7 +56,7 @@ wl_find_view_by_xdg_surface(struct wlr_xdg_surface *surf)
}
/*
* Phase 46: XDG toplevel title changed — update wwin->wm_instance.
* XDG toplevel title changed — update wwin->wm_instance.
*/
static void
handle_toplevel_title(struct wl_listener *listener, void *data)
@ -84,7 +84,7 @@ handle_toplevel_title(struct wl_listener *listener, void *data)
}
/*
* Phase 23: set the cursor image by name from the loaded xcursor theme.
* set the cursor image by name from the loaded xcursor theme.
* No-op if cursor or xcursor_mgr was not initialised.
*/
void
@ -98,8 +98,8 @@ wl_set_cursor_image(const char *name)
/*
* Phase 15/22: xdg_toplevel request_move — client requests interactive move.
* Phase 22: starts a compositor-side move grab.
* 22: xdg_toplevel request_move — client requests interactive move.
* starts a compositor-side move grab.
*/
static void
handle_toplevel_request_move(struct wl_listener *listener, void *data)
@ -110,8 +110,8 @@ handle_toplevel_request_move(struct wl_listener *listener, void *data)
}
/*
* Phase 15/22: xdg_toplevel request_resize — client requests interactive resize.
* Phase 22: starts a compositor-side resize grab.
* 22: xdg_toplevel request_resize — client requests interactive resize.
* starts a compositor-side resize grab.
*/
static void
handle_toplevel_request_resize(struct wl_listener *listener, void *data)
@ -122,7 +122,7 @@ handle_toplevel_request_resize(struct wl_listener *listener, void *data)
}
/*
* Phase 16: xdg_toplevel request_maximize — toggle maximize state.
* xdg_toplevel request_maximize — toggle maximize state.
*/
static void
handle_toplevel_request_maximize(struct wl_listener *listener, void *data)
@ -140,7 +140,7 @@ handle_toplevel_request_maximize(struct wl_listener *listener, void *data)
}
/*
* Phase 16: xdg_toplevel request_fullscreen.
* xdg_toplevel request_fullscreen.
*/
static void
handle_toplevel_request_fullscreen(struct wl_listener *listener, void *data)
@ -156,7 +156,7 @@ handle_toplevel_request_fullscreen(struct wl_listener *listener, void *data)
}
/*
* Phase 16: xdg_toplevel request_minimize — iconify the window.
* xdg_toplevel request_minimize — iconify the window.
*/
static void
handle_toplevel_request_minimize(struct wl_listener *listener, void *data)
@ -172,7 +172,7 @@ handle_toplevel_request_minimize(struct wl_listener *listener, void *data)
}
/*
* Phase 16: xdg_toplevel set_app_id — update wm_class.
* xdg_toplevel set_app_id — update wm_class.
*/
static void
handle_toplevel_set_app_id(struct wl_listener *listener, void *data)
@ -192,7 +192,7 @@ handle_toplevel_set_app_id(struct wl_listener *listener, void *data)
}
/*
* Phase 38: toplevel map — surface is ready to be managed.
* toplevel map — surface is ready to be managed.
*/
void
handle_toplevel_scene_destroy(struct wl_listener *listener, void *data)
@ -279,7 +279,7 @@ handle_toplevel_map(struct wl_listener *listener, void *data)
}
}
/* Phase 18: add XDG surface to the scene graph.
/* add XDG surface to the scene graph.
*
* ORDERING: wManageWindow (above) calls wl_client_reparent
* which sets view->frame_id but cannot reparent the scene
@ -315,7 +315,7 @@ handle_toplevel_map(struct wl_listener *listener, void *data)
}
}
/* Phase 13: warp virtual pointer to the centre of the
/* warp virtual pointer to the centre of the
* newly managed window so pointer focus is immediately
* delivered to its surface. The warp calls
* wl_update_pointer_focus() internally. */
@ -325,7 +325,7 @@ handle_toplevel_map(struct wl_listener *listener, void *data)
wl_pointer_warp_to(cx, cy);
}
/* Phase 35: create a foreign toplevel handle so taskbars
/* create a foreign toplevel handle so taskbars
* and docks (e.g. wlr-taskbar, waybar) can enumerate and
* control this window. */
if (wwin && wl_state.foreign_toplevel_mgr && !view->ft_handle) {
@ -351,7 +351,7 @@ handle_toplevel_map(struct wl_listener *listener, void *data)
}
/*
* Phase 40: toplevel unmap — surface hidden or destroyed; unmanage the window.
* toplevel unmap — surface hidden or destroyed; unmanage the window.
*/
static void
handle_toplevel_unmap(struct wl_listener *listener, void *data)
@ -361,7 +361,7 @@ handle_toplevel_unmap(struct wl_listener *listener, void *data)
wwarning("wl_backend: toplevel unmapped id=0x%lx", view->id);
/* Phase 35: destroy the foreign toplevel handle so taskbars stop
/* destroy the foreign toplevel handle so taskbars stop
* showing this window in their list. */
if (view->ft_handle) {
wlr_foreign_toplevel_handle_v1_destroy(view->ft_handle);
@ -381,7 +381,7 @@ handle_toplevel_unmap(struct wl_listener *listener, void *data)
}
/*
* Phase 38: toplevel destroy — free the view.
* toplevel destroy — free the view.
*/
static void
handle_toplevel_destroy(struct wl_listener *listener, void *data)
@ -426,7 +426,7 @@ handle_toplevel_destroy(struct wl_listener *listener, void *data)
}
/*
* Phase 64: new_toplevel_decoration listener.
* new_toplevel_decoration listener.
* Respond with CLIENT_SIDE so clients draw their own decorations.
* Must defer until the surface is initialized (wlroots 0.19).
*/
@ -541,7 +541,7 @@ handle_toplevel_commit(struct wl_listener *listener, void *data)
}
/*
* Phase 36 / 38: new XDG toplevel listener (wlroots 0.19+).
* new XDG toplevel listener (wlroots 0.19+).
* Fires when the client calls get_toplevel on an xdg_surface.
* Allocates a wl_toplevel_view, assigns a synthetic Window ID,
* wires lifecycle listeners, and sets up the initial commit handler.

View File

@ -11,7 +11,7 @@
WKeyCode
wl_keysym_to_keycode(unsigned long keysym)
{
/* Phase 77: scan the XKB keymap to find the first keycode that produces
/* scan the XKB keymap to find the first keycode that produces
* the given keysym at any level/layout. The XKB keycode ==
* evdev_scancode + 8, which equals the X11 keycode — so the values stored
* in wKeyBindings are directly compatible.

210
src/wmaker.old Executable file
View File

@ -0,0 +1,210 @@
#! /bin/sh
# wmaker - temporary wrapper script for .libs/wmaker
# Generated by libtool (GNU libtool) 2.5.4
#
# The wmaker program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
fi
BIN_SH=xpg4; export BIN_SH # for Tru64
DUALCASE=1; export DUALCASE # for MKS sh
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
relink_command=""
# This environment variable determines our operation mode.
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
# install mode needs the following variables:
generated_by_libtool_version='2.5.4'
notinst_deplibs=' ../WINGs/libWINGs.la /home/lkn/src/wmaker/WINGs/libWUtil.la /home/lkn/src/wmaker/wrlib/libwraster.la ../WINGs/libWUtil.la ../wrlib/libwraster.la'
else
# When we are sourced in execute mode, $file and $ECHO are already set.
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
file="$0"
# A function that is used when there is no print builtin or printf.
func_fallback_echo ()
{
eval 'cat <<_LTECHO_EOF
$1
_LTECHO_EOF'
}
ECHO="printf %s\\n"
fi
# Very basic option parsing. These options are (a) specific to
# the libtool wrapper, (b) are identical between the wrapper
# /script/ and the wrapper /executable/ that is used only on
# windows platforms, and (c) all begin with the string --lt-
# (application programs are unlikely to have options that match
# this pattern).
#
# There are only two supported options: --lt-debug and
# --lt-dump-script. There is, deliberately, no --lt-help.
#
# The first argument to this parsing function should be the
# script's ../libtool value, followed by no.
lt_option_debug=
func_parse_lt_options ()
{
lt_script_arg0=$0
shift
for lt_opt
do
case "$lt_opt" in
--lt-debug) lt_option_debug=1 ;;
--lt-dump-script)
lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'`
test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=.
lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'`
cat "$lt_dump_D/$lt_dump_F"
exit 0
;;
--lt-*)
$ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2
exit 1
;;
esac
done
# Print the debug banner immediately:
if test -n "$lt_option_debug"; then
echo "wmaker:wmaker:$LINENO: libtool wrapper (GNU libtool) 2.5.4" 1>&2
fi
}
# Used when --lt-debug. Prints its arguments to stdout
# (redirection is the responsibility of the caller)
func_lt_dump_args ()
{
lt_dump_args_N=1;
for lt_arg
do
$ECHO "wmaker:wmaker:$LINENO: newargv[$lt_dump_args_N]: $lt_arg"
lt_dump_args_N=`expr $lt_dump_args_N + 1`
done
}
# Core function for launching the target application
func_exec_program_core ()
{
if test -n "$lt_option_debug"; then
$ECHO "wmaker:wmaker:$LINENO: newargv[0]: $progdir/$program" 1>&2
func_lt_dump_args ${1+"$@"} 1>&2
fi
exec "$progdir/$program" ${1+"$@"}
$ECHO "$0: cannot exec $program $*" 1>&2
exit 1
}
# A function to encapsulate launching the target application
# Strips options in the --lt-* namespace from $@ and
# launches target application with the remaining arguments.
func_exec_program ()
{
case " $* " in
*\ --lt-*)
for lt_wr_arg
do
case $lt_wr_arg in
--lt-*) ;;
*) set x "$@" "$lt_wr_arg"; shift;;
esac
shift
done ;;
esac
func_exec_program_core ${1+"$@"}
}
# Parse options
func_parse_lt_options "$0" ${1+"$@"}
# Find the directory that this script lives in.
thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'`
test "x$thisdir" = "x$file" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'`
while test -n "$file"; do
destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'`
# If there was a directory component, then change thisdir.
if test "x$destdir" != "x$file"; then
case "$destdir" in
[\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
*) thisdir="$thisdir/$destdir" ;;
esac
fi
file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'`
file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'`
done
# Usually 'no', except on cygwin/mingw/windows when embedded into
# the cwrapper.
WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
# special case for '.'
if test "$thisdir" = "."; then
thisdir=`pwd`
fi
# remove .libs from thisdir
case "$thisdir" in
*[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;;
.libs ) thisdir=. ;;
esac
fi
# Try to get the absolute directory name.
absdir=`cd "$thisdir" && pwd`
test -n "$absdir" && thisdir="$absdir"
program='wmaker'
progdir="$thisdir/.libs"
if test -f "$progdir/$program"; then
# Add our own library path to LD_LIBRARY_PATH
LD_LIBRARY_PATH="/home/lkn/src/wmaker/WINGs/.libs:/home/lkn/src/wmaker/wrlib/.libs:$LD_LIBRARY_PATH"
# Some systems cannot cope with colon-terminated LD_LIBRARY_PATH
# The second colon is a workaround for a bug in BeOS R4 sed
LD_LIBRARY_PATH=`$ECHO "$LD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'`
export LD_LIBRARY_PATH
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
# Run the actual program with our arguments.
func_exec_program ${1+"$@"}
fi
else
# The program doesn't exist.
$ECHO "$0: error: '$progdir/$program' does not exist" 1>&2
$ECHO "This script is just a wrapper for $program." 1>&2
$ECHO "See the libtool documentation for more information." 1>&2
exit 1
fi
fi