early-access version 2835
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@@ -32,44 +32,61 @@
|
||||
|
||||
struct SDL_WaylandInput;
|
||||
|
||||
typedef struct {
|
||||
struct xdg_surface *surface;
|
||||
union {
|
||||
struct xdg_toplevel *toplevel;
|
||||
struct xdg_popup *popup;
|
||||
} roleobj;
|
||||
SDL_bool initial_configure_seen;
|
||||
} SDL_xdg_shell_surface;
|
||||
|
||||
#ifdef HAVE_LIBDECOR_H
|
||||
typedef struct {
|
||||
struct libdecor_frame *frame;
|
||||
SDL_bool initial_configure_seen;
|
||||
} SDL_libdecor_surface;
|
||||
#endif
|
||||
/* TODO: Remove these helpers, they're from before we had shell_surface_type */
|
||||
#define WINDOW_IS_XDG_POPUP(window) \
|
||||
(((SDL_WindowData*) window->driverdata)->shell_surface_type == WAYLAND_SURFACE_XDG_POPUP)
|
||||
#define WINDOW_IS_LIBDECOR(ignoreme, window) \
|
||||
(((SDL_WindowData*) window->driverdata)->shell_surface_type == WAYLAND_SURFACE_LIBDECOR)
|
||||
|
||||
typedef struct {
|
||||
SDL_Window *sdlwindow;
|
||||
SDL_VideoData *waylandData;
|
||||
struct wl_surface *surface;
|
||||
struct wl_callback *frame_callback;
|
||||
struct wl_event_queue *frame_event_queue;
|
||||
struct wl_surface *frame_surface_wrapper;
|
||||
struct wl_callback *gles_swap_frame_callback;
|
||||
struct wl_event_queue *gles_swap_frame_event_queue;
|
||||
struct wl_surface *gles_swap_frame_surface_wrapper;
|
||||
struct wl_callback *surface_damage_frame_callback;
|
||||
|
||||
union {
|
||||
#ifdef HAVE_LIBDECOR_H
|
||||
SDL_libdecor_surface libdecor;
|
||||
struct {
|
||||
struct libdecor_frame *frame;
|
||||
SDL_bool initial_configure_seen;
|
||||
} libdecor;
|
||||
#endif
|
||||
SDL_xdg_shell_surface xdg;
|
||||
struct {
|
||||
struct xdg_surface *surface;
|
||||
union {
|
||||
struct xdg_toplevel *toplevel;
|
||||
struct {
|
||||
struct xdg_popup *popup;
|
||||
struct xdg_positioner *positioner;
|
||||
Uint32 parentID;
|
||||
SDL_Window *child;
|
||||
} popup;
|
||||
} roleobj;
|
||||
SDL_bool initial_configure_seen;
|
||||
} xdg;
|
||||
} shell_surface;
|
||||
enum {
|
||||
WAYLAND_SURFACE_UNKNOWN = 0,
|
||||
WAYLAND_SURFACE_XDG_TOPLEVEL,
|
||||
WAYLAND_SURFACE_XDG_POPUP,
|
||||
WAYLAND_SURFACE_LIBDECOR
|
||||
} shell_surface_type;
|
||||
|
||||
struct wl_egl_window *egl_window;
|
||||
struct SDL_WaylandInput *keyboard_device;
|
||||
#if SDL_VIDEO_OPENGL_EGL
|
||||
EGLSurface egl_surface;
|
||||
#endif
|
||||
struct zwp_locked_pointer_v1 *locked_pointer;
|
||||
struct zwp_confined_pointer_v1 *confined_pointer;
|
||||
struct zxdg_toplevel_decoration_v1 *server_decoration;
|
||||
struct zwp_keyboard_shortcuts_inhibitor_v1 *key_inhibitor;
|
||||
struct zwp_idle_inhibitor_v1 *idle_inhibitor;
|
||||
struct xdg_activation_token_v1 *activation_token;
|
||||
struct wp_viewport *draw_viewport;
|
||||
|
||||
/* floating dimensions for restoring from maximized and fullscreen */
|
||||
int floating_width, floating_height;
|
||||
@@ -84,6 +101,12 @@ typedef struct {
|
||||
int num_outputs;
|
||||
|
||||
float scale_factor;
|
||||
float pointer_scale_x;
|
||||
float pointer_scale_y;
|
||||
int drawable_width, drawable_height;
|
||||
SDL_Rect viewport_rect;
|
||||
SDL_bool needs_resize_event;
|
||||
SDL_bool floating_resize_pending;
|
||||
} SDL_WindowData;
|
||||
|
||||
extern void Wayland_ShowWindow(_THIS, SDL_Window *window);
|
||||
|
||||
Reference in New Issue
Block a user