cleanup: remove debug wwarning/fprintf output

Remove diagnostic output from wl_framebuf.c (hit debug), wl_handlers.c
(button routing), wl_grabstate.c (grab/ungrab), wl_client.c (reparent),
wl_xdg.c (toplevel unmap), window.c (wWindowMap), wview_wl.c
(map/unmap), superfluous.c (MakeGhostIcon), and appicon.c (move loop).

Also simplify the wl_unmap logic in wview_wl.c.
This commit is contained in:
lkn 2026-06-21 17:25:06 +02:00
parent bf552c9be2
commit c027f092c0
9 changed files with 3 additions and 56 deletions

View File

@ -210,25 +210,11 @@ static void wl_unmap(void *vctx, W_View *view)
{
(void)vctx;
view->flags.mapped = 0;
wwarning("wl_unmap: id=0x%lx topLevel=%d popup=%d parent=0x%lx mapped=%d",
(unsigned long)view->window, view->flags.topLevel,
view->flags.popup,
view->parent ? (unsigned long)view->parent->window : 0,
view->parent ? view->parent->flags.mapped : 0);
if (W_ViewSceneNodeSetEnabledFn) {
wwarning("wl_unmap: calling set_enabled id=0x%lx enabled=0",
(unsigned long)view->window);
W_ViewSceneNodeSetEnabledFn((unsigned long)view->window, 0);
} else
wwarning("wl_unmap: W_ViewSceneNodeSetEnabledFn is NULL");
/* Scene node disabled in the diagnostic block above. */
/* W_ViewSceneNodeSetEnabledFn is NULL in client-only builds (e.g.
* WPrefs) because the compositor-side function is not linked into
* the client process. Fall back to the standard Wayland unmap:
* attach NULL + commit. This triggers a fresh xdg_surface.configure
* which wl_client_toplevel_commit_locked will await via configured=0. */
if (view->flags.topLevel && view->flags.popup
&& !W_ViewSceneNodeSetEnabledFn) {
} else if (view->flags.topLevel && view->flags.popup) {
/* W_ViewSceneNodeSetEnabledFn is NULL in client-only builds (e.g.
* WPrefs). Fall back to the standard Wayland unmap. */
extern void wl_client_view_unmap(WNativeWindow id);
wl_client_view_unmap((WNativeWindow)view->window);
}
@ -344,7 +330,6 @@ static void wl_map(void *vctx, W_View *view)
/* Dispatch any pending Wayland events (e.g. the configure
* from a NULL-buffer unmap) so the next commit succeeds. */
extern void W_WLClientDispatchPending(void);
wwarning("wl_map: dispatch pending events");
W_WLClientDispatchPending();
return;
}

View File

@ -812,7 +812,6 @@ Bool wHandleAppIconMove(WAppIcon *aicon, WMEvent *event)
while (1) {
WMMaskEvent(scr->wmscreen, WM_EVMASK_POINTER_MOTION | WM_EVMASK_BUTTON_RELEASE | WM_EVMASK_BUTTON_PRESS
| WM_EVMASK_BUTTON_MOTION | WM_EVMASK_EXPOSURE | WM_EVMASK_ENTER_WINDOW, &ev);
wwarning("wHandleAppIconMove: got event type=%d", ev.type);
switch (ev.type) {
case WME_EXPOSE:
WMHandleEvent(&ev);

View File

@ -176,17 +176,6 @@ wl_client_reparent(WNativeWindow client, WNativeWindow new_parent, int x, int y)
else if (client >= 0x10000000 && new_parent >= 0x10000000) {
struct wl_frame_buf *fb = frame_buf_find(client);
struct wl_frame_buf *parent_fb = frame_buf_find(new_parent);
fprintf(stderr, "reparent_framebuf: client=0x%lx fb=%p new_parent=0x%lx parent_fb=%p\n",
(unsigned long)client, (void*)fb,
(unsigned long)new_parent, (void*)parent_fb);
if (fb) fprintf(stderr, " fb: tree=%p scene_buf=%p pos=(%d,%d)\n",
(void*)fb->tree, (void*)fb->scene_buf,
fb->tree ? fb->tree->node.x : -1,
fb->tree ? fb->tree->node.y : -1);
if (parent_fb) fprintf(stderr, " parent_fb: tree=%p pos=(%d,%d)\n",
(void*)parent_fb->tree,
parent_fb->tree ? parent_fb->tree->node.x : -1,
parent_fb->tree ? parent_fb->tree->node.y : -1);
if (fb && parent_fb) {
fb->parent_id = new_parent;
fb->rel_x = x;
@ -331,7 +320,6 @@ wl_view_scene_node_set_enabled(unsigned long id, int enabled)
* wlr_surface resource ID for scene node enable/disable. */
uint32_t proxy_id = wlc_top_get_surface_id((WNativeWindow)id);
if (!proxy_id) {
wwarning("set_enabled: no proxy for id=0x%lx", id);
return;
}
struct wl_toplevel_view *v;

View File

@ -320,7 +320,6 @@ frame_buf_hit(int px, int py)
fb = best_child;
}
wl_dump_hit_debug(px, py, fb);
return fb;
}
@ -828,7 +827,6 @@ wl_frame_paint_button(WCoreWindow *button, WTexture *texture,
(void)texture; (void)image;
WFrameWindow *fwin = (WFrameWindow *)button->descriptor.parent;
if (!fwin || !fwin->core) {
wwarning("btn: no fwin");
return;
}
struct wl_frame_buf *btn_fb = frame_buf_find(button->window);

View File

@ -21,8 +21,6 @@ wl_pointer_grab(WNativeWindow grab_win, WNativeWindow confine_to,
{
(void)confine_to; (void)event_mask;
(void)timestamp; (void)grab_win;
wwarning("wl_pointer_grab: win=0x%lx owner_events=%d cursor_id=%d grab_type_before=%d",
grab_win, owner_events, cursor_id, wl_state.grab_type);
/* Only set up a WM policy grab (type 3) for actual drags (owner_events=True).
* Brief protective grabs (e.g., during icon creation) don't need to suppress
* pointer focus — they just need to return success. */
@ -52,7 +50,6 @@ wl_pointer_grab(WNativeWindow grab_win, WNativeWindow confine_to,
void wl_pointer_ungrab(unsigned long timestamp)
{
(void)timestamp;
wwarning("wl_pointer_ungrab: grab_type=%d", wl_state.grab_type);
if (wl_state.grab_type == 3) {
wl_state.grab_type = 0;
wl_state.grab_view = NULL;

View File

@ -135,11 +135,6 @@ handle_pointer_button(struct wl_listener *listener, void *data)
{
(void)listener;
struct wlr_pointer_button_event *ev = data;
wwarning("ptr-button: dev=%p output=%s button=%u state=%u ptr=(%d,%d) grab=%d",
(void*)&ev->pointer->base,
ev->pointer->output_name ? ev->pointer->output_name : "(none)",
ev->button, (unsigned)ev->state,
wl_state.pointer_x, wl_state.pointer_y, wl_state.grab_type);
if (!wl_state.seat)
return;
/* any button release ends an active compositor grab (move/resize).
@ -242,11 +237,6 @@ handle_pointer_button(struct wl_listener *listener, void *data)
wev.u.button.window = fb->id;
wev.u.button.x = wl_state.pointer_x - fb->x;
wev.u.button.y = wl_state.pointer_y - fb->y;
wwarning("btn-route: ptr=(%d,%d) fb=0x%lx abs=(%d,%d) final=0x%lx local=(%d,%d)",
wl_state.pointer_x, wl_state.pointer_y,
(unsigned long)fb->id, fb->x, fb->y,
(unsigned long)wev.window,
wev.u.button.x, wev.u.button.y);
} else {
WScreen *scr0 = wScreenWithNumber(0);
WNativeWindow root = scr0 ? scr0->root_win : (WNativeWindow)0x0FFFFFFF;

View File

@ -378,7 +378,6 @@ handle_toplevel_unmap(struct wl_listener *listener, void *data)
struct wl_toplevel_view *view = VIEW_FROM_LISTENER(listener, unmap_listener);
(void)data;
wwarning("wl_backend: toplevel unmapped id=0x%lx", view->id);
/* destroy the foreign toplevel handle so taskbars stop
* showing this window in their list. */

View File

@ -63,10 +63,8 @@ WMNativePixmap MakeGhostIcon(WScreen * scr, WMDrawable drawable)
back = (RImage *)wm_backend->create_rimage_from_drawable(scr->rcontext, drawable);
if (!back) {
wwarning("MakeGhostIcon: create_rimage_from_drawable failed for drawable=0x%lx", (unsigned long)drawable);
return WM_NATIVE_NONE;
}
wwarning("MakeGhostIcon: got RImage %dx%d from drawable=0x%lx", back->width, back->height, (unsigned long)drawable);
color.red = 0xff;
color.green = 0xff;
@ -75,11 +73,9 @@ WMNativePixmap MakeGhostIcon(WScreen * scr, WMDrawable drawable)
RClearImage(back, &color);
if (!RConvertImage(scr->rcontext, back, &pixmap)) {
wwarning("MakeGhostIcon: RConvertImage failed");
RReleaseImage(back);
return WM_NATIVE_NONE;
}
wwarning("MakeGhostIcon: converted to pixmap=0x%lx", (unsigned long)pixmap);
RReleaseImage(back);

View File

@ -1649,11 +1649,6 @@ void wWindowMap(WWindow *wwin)
wwin->event_mask & ~WM_EVMASK_STRUCTURE_NOTIFY);
wm_backend->window_map(wwin->client_win);
wm_backend->window_select_events(wwin->client_win, wwin->event_mask);
fprintf(stderr, "wWindowMap: client_win=0x%lx frame_win=0x%lx top_width=%d\n",
(unsigned long)wwin->client_win,
(unsigned long)wwin->frame->core->window,
wwin->frame->top_width);
/* Reparent fake_leader into frame tree on Wayland so dialog
* content renders at the correct position within the frame. */
if (wwin->frame && wwin->client_win >= 0x10000000)