DisplayServer: better wayland feature detection

This commit is contained in:
李通洲
2023-05-29 13:35:45 +08:00
parent 53a61a8e58
commit 772de0ff97
+10 -6
View File
@@ -72,7 +72,7 @@ static void waylandOutputModeListener(void* data, struct wl_output* output, uint
display->refreshRate = refreshRate;
}
#if WAYLAND_VERSION_MINOR >= 2
#ifdef WL_OUTPUT_SCALE_SINCE_VERSION
static void waylandOutputScaleListener(void* data, struct wl_output* output, int32_t scale)
{
FF_UNUSED(output);
@@ -82,7 +82,7 @@ static void waylandOutputScaleListener(void* data, struct wl_output* output, int
}
#endif
#if WAYLAND_VERSION_MINOR >= 20
#ifdef WL_OUTPUT_NAME_SINCE_VERSION
static void waylandOutputNameListener(void *data, struct wl_output* output, const char *name)
{
FF_UNUSED(output);
@@ -110,15 +110,19 @@ static void waylandOutputHandler(WaylandData* wldata, struct wl_registry* regist
.mode = waylandOutputModeListener,
.geometry = (void*) stubListener,
//https://lists.freedesktop.org/archives/wayland-devel/2013-July/010278.html
#if WAYLAND_VERSION_MINOR >= 2
#ifdef WL_OUTPUT_DONE_SINCE_VERSION
.done = (void*) stubListener,
#endif
#ifdef WL_OUTPUT_SCALE_SINCE_VERSION
.scale = waylandOutputScaleListener,
#endif
//https://lists.freedesktop.org/archives/wayland-devel/2021-December/042064.html
#if WAYLAND_VERSION_MINOR >= 20
#ifdef WL_OUTPUT_NAME_SINCE_VERSION
.name = wldata->detectName ? waylandOutputNameListener : (void*) stubListener,
#endif
#ifdef WL_OUTPUT_DESCRIPTION_SINCE_VERSION
.description = (void*) stubListener,
#endif
};