decompose wl_backend.c: extract wl_wings.c
This commit is contained in:
parent
5e5e4dbd02
commit
bce1aaa62c
|
|
@ -176,7 +176,8 @@ wmaker_SOURCES += \
|
|||
backend/wayland/wl_events.c \
|
||||
backend/wayland/wl_focus.c \
|
||||
backend/wayland/wl_screen.c \
|
||||
backend/wayland/wl_shm.c
|
||||
backend/wayland/wl_shm.c \
|
||||
backend/wayland/wl_wings.c
|
||||
endif
|
||||
|
||||
if USE_NESTED_FUNC
|
||||
|
|
|
|||
|
|
@ -242,38 +242,6 @@ int level_to_bucket(int level);
|
|||
struct wlr_scene_tree *level_tree_for(int level);
|
||||
struct wl_frame_buf *frame_buf_find(WNativeWindow id);
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Phase A: WINGs event backend wiring helpers */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
/*
|
||||
* Get the WMScreen (W_Screen) for screen 0. Returns NULL if StartUp()
|
||||
* hasn't initialised the screen yet.
|
||||
*/
|
||||
static WMScreen *
|
||||
wl_get_wmscreen(void)
|
||||
{
|
||||
if (w_global.screen_count == 0)
|
||||
return NULL;
|
||||
WScreen *scr = wScreenWithNumber(0);
|
||||
return scr ? scr->wmscreen : NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Dispatch callback for W_WL_SetLoopDispatch — ticks the Wayland compositor
|
||||
* event loop so clients stay responsive during WINGs modal loops.
|
||||
*/
|
||||
static void
|
||||
wl_wings_dispatch(int timeout_ms, void *ud)
|
||||
{
|
||||
(void)ud;
|
||||
if (!wl_state.display)
|
||||
return;
|
||||
struct wl_event_loop *loop = wl_display_get_event_loop(wl_state.display);
|
||||
wl_display_flush_clients(wl_state.display);
|
||||
wl_event_loop_dispatch(loop, timeout_ms);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Phase 36 / 37 / 38: XDG surface lifecycle, frame loop, view mgmt */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
|
|
|||
|
|
@ -552,3 +552,5 @@ struct wm_shm_surface *wm_shm_surface_create(int width, int height);
|
|||
void wm_shm_surface_fill(struct wm_shm_surface *s, int x, int y, int w, int h, uint32_t argb);
|
||||
void wm_shm_surface_commit(struct wm_shm_surface *s, struct wlr_scene_tree *parent, int x, int y);
|
||||
void wm_shm_surface_destroy(struct wm_shm_surface *s);
|
||||
WMScreen *wl_get_wmscreen(void);
|
||||
void wl_wings_dispatch(int timeout_ms, void *ud);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#include <wayland-server-core.h>
|
||||
#include "../../screen.h"
|
||||
#include "wl_types.h"
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Phase A: WINGs event backend wiring helpers */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
/*
|
||||
* Get the WMScreen (W_Screen) for screen 0. Returns NULL if StartUp()
|
||||
* hasn't initialised the screen yet.
|
||||
*/
|
||||
WMScreen *
|
||||
wl_get_wmscreen(void)
|
||||
{
|
||||
if (w_global.screen_count == 0)
|
||||
return NULL;
|
||||
WScreen *scr = wScreenWithNumber(0);
|
||||
return scr ? scr->wmscreen : NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Dispatch callback for W_WL_SetLoopDispatch — ticks the Wayland compositor
|
||||
* event loop so clients stay responsive during WINGs modal loops.
|
||||
*/
|
||||
void
|
||||
wl_wings_dispatch(int timeout_ms, void *ud)
|
||||
{
|
||||
(void)ud;
|
||||
if (!wl_state.display)
|
||||
return;
|
||||
struct wl_event_loop *loop = wl_display_get_event_loop(wl_state.display);
|
||||
wl_display_flush_clients(wl_state.display);
|
||||
wl_event_loop_dispatch(loop, timeout_ms);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue