decompose wl_backend.c: extract wl_atom.c

This commit is contained in:
Window Maker 2026-06-02 10:42:28 +02:00
parent e47b44ccd0
commit 33f686c79f
4 changed files with 18 additions and 10 deletions

View File

@ -166,7 +166,8 @@ wmaker_SOURCES += \
backend/wayland/wl_props.c \
backend/wayland/wl_client.c \
backend/wayland/wl_icccm.c \
backend/wayland/wl_framebuf.c
backend/wayland/wl_framebuf.c \
backend/wayland/wl_atom.c
endif
if USE_NESTED_FUNC

View File

@ -0,0 +1,15 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <X11/Xlib.h>
#include "wl_types.h"
unsigned long
wl_atom_intern(const char *name)
{
/* The WM's own UI runs on XWayland — it needs real X11 atoms for
* property operations (WM_STATE, WM_PROTOCOLS, etc.). */
if (wl_state.x_display)
return (unsigned long)XInternAtom(wl_state.x_display, name, False);
return 0;
}

View File

@ -3110,15 +3110,6 @@ wl_display_default_screen(void)
return 0;
}
static unsigned long
wl_atom_intern(const char *name)
{
/* The WM's own UI runs on XWayland — it needs real X11 atoms for
* property operations (WM_STATE, WM_PROTOCOLS, etc.). */
if (wl_state.x_display)
return (unsigned long)XInternAtom(wl_state.x_display, name, False);
return 0;
}
/* ------------------------------------------------------------------ */
/* Phase 29+: signalfd-based signal handling */

View File

@ -498,3 +498,4 @@ extern const struct wlr_buffer_impl frame_buf_impl;
void fb_attach_tree_listener(struct wl_frame_buf *fb);
void fb_attach_scene_buf_listener(struct wl_frame_buf *fb);
void wl_frame_paint_button(WCoreWindow *button, WTexture *texture, unsigned long color, WPixmap *image, int pushed);
unsigned long wl_atom_intern(const char *name);