|
@@ -741,7 +741,7 @@ static const struct wl_callback_listener gles_swap_frame_listener = {
|
|
gles_swap_frame_done
|
|
gles_swap_frame_done
|
|
};
|
|
};
|
|
|
|
|
|
-static void handle_configure_xdg_shell_surface(void *data, struct xdg_surface *xdg, uint32_t serial)
|
|
|
|
|
|
+static void handle_xdg_surface_configure(void *data, struct xdg_surface *xdg, uint32_t serial)
|
|
{
|
|
{
|
|
SDL_WindowData *wind = (SDL_WindowData *)data;
|
|
SDL_WindowData *wind = (SDL_WindowData *)data;
|
|
SDL_Window *window = wind->sdlwindow;
|
|
SDL_Window *window = wind->sdlwindow;
|
|
@@ -755,11 +755,11 @@ static void handle_configure_xdg_shell_surface(void *data, struct xdg_surface *x
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-static const struct xdg_surface_listener shell_surface_listener_xdg = {
|
|
|
|
- handle_configure_xdg_shell_surface
|
|
|
|
|
|
+static const struct xdg_surface_listener _xdg_surface_listener = {
|
|
|
|
+ handle_xdg_surface_configure
|
|
};
|
|
};
|
|
|
|
|
|
-static void handle_configure_xdg_toplevel(void *data,
|
|
|
|
|
|
+static void handle_xdg_toplevel_configure(void *data,
|
|
struct xdg_toplevel *xdg_toplevel,
|
|
struct xdg_toplevel *xdg_toplevel,
|
|
int32_t width,
|
|
int32_t width,
|
|
int32_t height,
|
|
int32_t height,
|
|
@@ -984,13 +984,13 @@ static void handle_configure_xdg_toplevel(void *data,
|
|
wind->resizing = resizing;
|
|
wind->resizing = resizing;
|
|
}
|
|
}
|
|
|
|
|
|
-static void handle_close_xdg_toplevel(void *data, struct xdg_toplevel *xdg_toplevel)
|
|
|
|
|
|
+static void handle_xdg_toplevel_close(void *data, struct xdg_toplevel *xdg_toplevel)
|
|
{
|
|
{
|
|
SDL_WindowData *window = (SDL_WindowData *)data;
|
|
SDL_WindowData *window = (SDL_WindowData *)data;
|
|
SDL_SendWindowEvent(window->sdlwindow, SDL_EVENT_WINDOW_CLOSE_REQUESTED, 0, 0);
|
|
SDL_SendWindowEvent(window->sdlwindow, SDL_EVENT_WINDOW_CLOSE_REQUESTED, 0, 0);
|
|
}
|
|
}
|
|
|
|
|
|
-static void handle_xdg_configure_toplevel_bounds(void *data,
|
|
|
|
|
|
+static void handle_xdg_toplevel_configure_bounds(void *data,
|
|
struct xdg_toplevel *xdg_toplevel,
|
|
struct xdg_toplevel *xdg_toplevel,
|
|
int32_t width, int32_t height)
|
|
int32_t width, int32_t height)
|
|
{
|
|
{
|
|
@@ -1029,13 +1029,13 @@ static void handle_xdg_toplevel_wm_capabilities(void *data,
|
|
}
|
|
}
|
|
|
|
|
|
static const struct xdg_toplevel_listener toplevel_listener_xdg = {
|
|
static const struct xdg_toplevel_listener toplevel_listener_xdg = {
|
|
- handle_configure_xdg_toplevel,
|
|
|
|
- handle_close_xdg_toplevel,
|
|
|
|
- handle_xdg_configure_toplevel_bounds, // Version 4
|
|
|
|
|
|
+ handle_xdg_toplevel_configure,
|
|
|
|
+ handle_xdg_toplevel_close,
|
|
|
|
+ handle_xdg_toplevel_configure_bounds, // Version 4
|
|
handle_xdg_toplevel_wm_capabilities // Version 5
|
|
handle_xdg_toplevel_wm_capabilities // Version 5
|
|
};
|
|
};
|
|
|
|
|
|
-static void handle_configure_xdg_popup(void *data,
|
|
|
|
|
|
+static void handle_xdg_popup_configure(void *data,
|
|
struct xdg_popup *xdg_popup,
|
|
struct xdg_popup *xdg_popup,
|
|
int32_t x,
|
|
int32_t x,
|
|
int32_t y,
|
|
int32_t y,
|
|
@@ -1086,28 +1086,28 @@ static void handle_configure_xdg_popup(void *data,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-static void handle_done_xdg_popup(void *data, struct xdg_popup *xdg_popup)
|
|
|
|
|
|
+static void handle_xdg_popup_done(void *data, struct xdg_popup *xdg_popup)
|
|
{
|
|
{
|
|
SDL_WindowData *window = (SDL_WindowData *)data;
|
|
SDL_WindowData *window = (SDL_WindowData *)data;
|
|
SDL_SendWindowEvent(window->sdlwindow, SDL_EVENT_WINDOW_CLOSE_REQUESTED, 0, 0);
|
|
SDL_SendWindowEvent(window->sdlwindow, SDL_EVENT_WINDOW_CLOSE_REQUESTED, 0, 0);
|
|
}
|
|
}
|
|
|
|
|
|
-static void handle_repositioned_xdg_popup(void *data,
|
|
|
|
|
|
+static void handle_xdg_popup_repositioned(void *data,
|
|
struct xdg_popup *xdg_popup,
|
|
struct xdg_popup *xdg_popup,
|
|
uint32_t token)
|
|
uint32_t token)
|
|
{
|
|
{
|
|
// No-op, configure does all the work we care about
|
|
// No-op, configure does all the work we care about
|
|
}
|
|
}
|
|
|
|
|
|
-static const struct xdg_popup_listener popup_listener_xdg = {
|
|
|
|
- handle_configure_xdg_popup,
|
|
|
|
- handle_done_xdg_popup,
|
|
|
|
- handle_repositioned_xdg_popup
|
|
|
|
|
|
+static const struct xdg_popup_listener _xdg_popup_listener = {
|
|
|
|
+ handle_xdg_popup_configure,
|
|
|
|
+ handle_xdg_popup_done,
|
|
|
|
+ handle_xdg_popup_repositioned
|
|
};
|
|
};
|
|
|
|
|
|
-static void handle_configure_zxdg_decoration(void *data,
|
|
|
|
- struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1,
|
|
|
|
- uint32_t mode)
|
|
|
|
|
|
+static void handle_xdg_toplevel_decoration_configure(void *data,
|
|
|
|
+ struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1,
|
|
|
|
+ uint32_t mode)
|
|
{
|
|
{
|
|
SDL_Window *window = (SDL_Window *)data;
|
|
SDL_Window *window = (SDL_Window *)data;
|
|
SDL_WindowData *internal = window->internal;
|
|
SDL_WindowData *internal = window->internal;
|
|
@@ -1135,8 +1135,8 @@ static void handle_configure_zxdg_decoration(void *data,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-static const struct zxdg_toplevel_decoration_v1_listener decoration_listener = {
|
|
|
|
- handle_configure_zxdg_decoration
|
|
|
|
|
|
+static const struct zxdg_toplevel_decoration_v1_listener xdg_toplevel_decoration_listener = {
|
|
|
|
+ handle_xdg_toplevel_decoration_configure
|
|
};
|
|
};
|
|
|
|
|
|
#ifdef HAVE_LIBDECOR_H
|
|
#ifdef HAVE_LIBDECOR_H
|
|
@@ -1621,7 +1621,7 @@ static void handle_surface_leave(void *data, struct wl_surface *surface, struct
|
|
Wayland_RemoveOutputFromWindow(window, (SDL_DisplayData *)wl_output_get_user_data(output));
|
|
Wayland_RemoveOutputFromWindow(window, (SDL_DisplayData *)wl_output_get_user_data(output));
|
|
}
|
|
}
|
|
|
|
|
|
-static void handle_preferred_buffer_scale(void *data, struct wl_surface *wl_surface, int32_t factor)
|
|
|
|
|
|
+static void handle_surface_preferred_buffer_scale(void *data, struct wl_surface *wl_surface, int32_t factor)
|
|
{
|
|
{
|
|
SDL_WindowData *wind = data;
|
|
SDL_WindowData *wind = data;
|
|
|
|
|
|
@@ -1634,7 +1634,7 @@ static void handle_preferred_buffer_scale(void *data, struct wl_surface *wl_surf
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-static void handle_preferred_buffer_transform(void *data, struct wl_surface *wl_surface, uint32_t transform)
|
|
|
|
|
|
+static void handle_surface_preferred_buffer_transform(void *data, struct wl_surface *wl_surface, uint32_t transform)
|
|
{
|
|
{
|
|
// Nothing to do here.
|
|
// Nothing to do here.
|
|
}
|
|
}
|
|
@@ -1642,18 +1642,18 @@ static void handle_preferred_buffer_transform(void *data, struct wl_surface *wl_
|
|
static const struct wl_surface_listener surface_listener = {
|
|
static const struct wl_surface_listener surface_listener = {
|
|
handle_surface_enter,
|
|
handle_surface_enter,
|
|
handle_surface_leave,
|
|
handle_surface_leave,
|
|
- handle_preferred_buffer_scale,
|
|
|
|
- handle_preferred_buffer_transform
|
|
|
|
|
|
+ handle_surface_preferred_buffer_scale,
|
|
|
|
+ handle_surface_preferred_buffer_transform
|
|
};
|
|
};
|
|
|
|
|
|
-static void handle_preferred_fractional_scale(void *data, struct wp_fractional_scale_v1 *wp_fractional_scale_v1, uint32_t scale)
|
|
|
|
|
|
+static void handle_fractional_scale_preferred(void *data, struct wp_fractional_scale_v1 *wp_fractional_scale_v1, uint32_t scale)
|
|
{
|
|
{
|
|
const double factor = (double)scale / 120.; // 120 is a magic number defined in the spec as a common denominator
|
|
const double factor = (double)scale / 120.; // 120 is a magic number defined in the spec as a common denominator
|
|
Wayland_HandlePreferredScaleChanged(data, factor);
|
|
Wayland_HandlePreferredScaleChanged(data, factor);
|
|
}
|
|
}
|
|
|
|
|
|
static const struct wp_fractional_scale_v1_listener fractional_scale_listener = {
|
|
static const struct wp_fractional_scale_v1_listener fractional_scale_listener = {
|
|
- handle_preferred_fractional_scale
|
|
|
|
|
|
+ handle_fractional_scale_preferred
|
|
};
|
|
};
|
|
|
|
|
|
static void frog_preferred_metadata_handler(void *data, struct frog_color_managed_surface *frog_color_managed_surface, uint32_t transfer_function,
|
|
static void frog_preferred_metadata_handler(void *data, struct frog_color_managed_surface *frog_color_managed_surface, uint32_t transfer_function,
|
|
@@ -1697,16 +1697,16 @@ static const struct frog_color_managed_surface_listener frog_surface_listener =
|
|
frog_preferred_metadata_handler
|
|
frog_preferred_metadata_handler
|
|
};
|
|
};
|
|
|
|
|
|
-static void feedback_surface_preferred_changed(void *data,
|
|
|
|
- struct wp_color_management_surface_feedback_v1 *wp_color_management_surface_feedback_v1,
|
|
|
|
- uint32_t identity)
|
|
|
|
|
|
+static void handle_surface_feedback_preferred_changed(void *data,
|
|
|
|
+ struct wp_color_management_surface_feedback_v1 *wp_color_management_surface_feedback_v1,
|
|
|
|
+ uint32_t identity)
|
|
{
|
|
{
|
|
SDL_WindowData *wind = (SDL_WindowData *)data;
|
|
SDL_WindowData *wind = (SDL_WindowData *)data;
|
|
Wayland_GetColorInfoForWindow(wind, false);
|
|
Wayland_GetColorInfoForWindow(wind, false);
|
|
}
|
|
}
|
|
|
|
|
|
static const struct wp_color_management_surface_feedback_v1_listener color_management_surface_feedback_listener = {
|
|
static const struct wp_color_management_surface_feedback_v1_listener color_management_surface_feedback_listener = {
|
|
- feedback_surface_preferred_changed
|
|
|
|
|
|
+ handle_surface_feedback_preferred_changed
|
|
};
|
|
};
|
|
|
|
|
|
static void Wayland_SetKeyboardFocus(SDL_Window *window, bool set_focus)
|
|
static void Wayland_SetKeyboardFocus(SDL_Window *window, bool set_focus)
|
|
@@ -1922,7 +1922,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
|
if (data->shell_surface_type == WAYLAND_SHELL_SURFACE_TYPE_XDG_TOPLEVEL || data->shell_surface_type == WAYLAND_SHELL_SURFACE_TYPE_XDG_POPUP) {
|
|
if (data->shell_surface_type == WAYLAND_SHELL_SURFACE_TYPE_XDG_TOPLEVEL || data->shell_surface_type == WAYLAND_SHELL_SURFACE_TYPE_XDG_POPUP) {
|
|
data->shell_surface.xdg.surface = xdg_wm_base_get_xdg_surface(c->shell.xdg, data->surface);
|
|
data->shell_surface.xdg.surface = xdg_wm_base_get_xdg_surface(c->shell.xdg, data->surface);
|
|
xdg_surface_set_user_data(data->shell_surface.xdg.surface, data);
|
|
xdg_surface_set_user_data(data->shell_surface.xdg.surface, data);
|
|
- xdg_surface_add_listener(data->shell_surface.xdg.surface, &shell_surface_listener_xdg, data);
|
|
|
|
|
|
+ xdg_surface_add_listener(data->shell_surface.xdg.surface, &_xdg_surface_listener, data);
|
|
SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, data->shell_surface.xdg.surface);
|
|
SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, data->shell_surface.xdg.surface);
|
|
|
|
|
|
if (data->shell_surface_type == WAYLAND_SHELL_SURFACE_TYPE_XDG_POPUP) {
|
|
if (data->shell_surface_type == WAYLAND_SHELL_SURFACE_TYPE_XDG_POPUP) {
|
|
@@ -1967,7 +1967,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
|
data->shell_surface.xdg.popup.xdg_popup = xdg_surface_get_popup(data->shell_surface.xdg.surface,
|
|
data->shell_surface.xdg.popup.xdg_popup = xdg_surface_get_popup(data->shell_surface.xdg.surface,
|
|
parent_xdg_surface,
|
|
parent_xdg_surface,
|
|
data->shell_surface.xdg.popup.xdg_positioner);
|
|
data->shell_surface.xdg.popup.xdg_positioner);
|
|
- xdg_popup_add_listener(data->shell_surface.xdg.popup.xdg_popup, &popup_listener_xdg, data);
|
|
|
|
|
|
+ xdg_popup_add_listener(data->shell_surface.xdg.popup.xdg_popup, &_xdg_popup_listener, data);
|
|
|
|
|
|
if (window->flags & SDL_WINDOW_TOOLTIP) {
|
|
if (window->flags & SDL_WINDOW_TOOLTIP) {
|
|
struct wl_region *region;
|
|
struct wl_region *region;
|
|
@@ -1991,7 +1991,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
|
// Create the window decorations
|
|
// Create the window decorations
|
|
if (c->decoration_manager) {
|
|
if (c->decoration_manager) {
|
|
data->server_decoration = zxdg_decoration_manager_v1_get_toplevel_decoration(c->decoration_manager, data->shell_surface.xdg.toplevel.xdg_toplevel);
|
|
data->server_decoration = zxdg_decoration_manager_v1_get_toplevel_decoration(c->decoration_manager, data->shell_surface.xdg.toplevel.xdg_toplevel);
|
|
- zxdg_toplevel_decoration_v1_add_listener(data->server_decoration, &decoration_listener, window);
|
|
|
|
|
|
+ zxdg_toplevel_decoration_v1_add_listener(data->server_decoration, &xdg_toplevel_decoration_listener, window);
|
|
const enum zxdg_toplevel_decoration_v1_mode mode = !(window->flags & SDL_WINDOW_BORDERLESS) ? ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE : ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE;
|
|
const enum zxdg_toplevel_decoration_v1_mode mode = !(window->flags & SDL_WINDOW_BORDERLESS) ? ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE : ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE;
|
|
zxdg_toplevel_decoration_v1_set_mode(data->server_decoration, mode);
|
|
zxdg_toplevel_decoration_v1_set_mode(data->server_decoration, mode);
|
|
}
|
|
}
|
|
@@ -2227,7 +2227,7 @@ static void handle_xdg_activation_done(void *data,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-static const struct xdg_activation_token_v1_listener activation_listener_xdg = {
|
|
|
|
|
|
+static const struct xdg_activation_token_v1_listener xdg_activation_listener = {
|
|
handle_xdg_activation_done
|
|
handle_xdg_activation_done
|
|
};
|
|
};
|
|
|
|
|
|
@@ -2273,7 +2273,7 @@ static void Wayland_activate_window(SDL_VideoData *data, SDL_WindowData *target_
|
|
|
|
|
|
target_wind->activation_token = xdg_activation_v1_get_activation_token(data->activation_manager);
|
|
target_wind->activation_token = xdg_activation_v1_get_activation_token(data->activation_manager);
|
|
xdg_activation_token_v1_add_listener(target_wind->activation_token,
|
|
xdg_activation_token_v1_add_listener(target_wind->activation_token,
|
|
- &activation_listener_xdg,
|
|
|
|
|
|
+ &xdg_activation_listener,
|
|
target_wind);
|
|
target_wind);
|
|
|
|
|
|
/* Note that we are not setting the app_id here.
|
|
/* Note that we are not setting the app_id here.
|