Skip to content

Commit bc76ebf

Browse files
Wayland: add stub listeners
1 parent c2da7b1 commit bc76ebf

File tree

1 file changed

+51
-2
lines changed

1 file changed

+51
-2
lines changed

src/detection/displayserver/wayland.c

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,39 @@ static void waylandDetectWM(int fd, FFDisplayServerResult* result)
3636
ffStrbufDestroy(&procPath);
3737
}
3838

39+
static void waylandOutputGeometryListener(void* data, struct wl_output* wl_output, int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, int32_t subpixel, const char* make, const char* model, int32_t transform)
40+
{
41+
FF_UNUSED(data, wl_output, x, y, physical_width, physical_height, subpixel, make, model, transform);
42+
}
43+
44+
#if WAYLAND_VERSION_MINOR >= 2
45+
46+
static void waylandOutputDoneListener(void* data, struct wl_output* wl_output)
47+
{
48+
FF_UNUSED(data, wl_output);
49+
}
50+
51+
static void waylandOutputScaleListener(void* data, struct wl_output* wl_output, int32_t factor)
52+
{
53+
FF_UNUSED(data, wl_output, factor);
54+
}
55+
56+
#endif
57+
58+
#if WAYLAND_VERSION_MINOR >= 4
59+
60+
static void waylandOutputNameListener(void *data, struct wl_output *wl_output, const char *name)
61+
{
62+
FF_UNUSED(data, wl_output, name);
63+
}
64+
65+
static void waylandOutputDescriptionListener(void *data, struct wl_output *wl_output, const char *description)
66+
{
67+
FF_UNUSED(data, wl_output, description);
68+
}
69+
70+
#endif
71+
3972
static void waylandOutputModeListener(void* data, struct wl_output* output, uint32_t flags, int32_t width, int32_t height, int32_t refreshRate)
4073
{
4174
WaylandData* wldata = data;
@@ -57,6 +90,10 @@ static void waylandOutputModeListener(void* data, struct wl_output* output, uint
5790
result->refreshRate = ffdsParseRefreshRate(refreshRate / 1000);
5891
}
5992

93+
static void waylandGlobalRemoveListener(void* data, struct wl_registry* wl_registry, uint32_t name){
94+
FF_UNUSED(data, wl_registry, name);
95+
}
96+
6097
static void waylandGlobalAddListener(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version)
6198
{
6299
WaylandData* wldata = data;
@@ -69,7 +106,18 @@ static void waylandGlobalAddListener(void* data, struct wl_registry* registry, u
69106

70107
//Needs to be static, because the scope of the function will already be lost when calling the listener
71108
static struct wl_output_listener outputListener = {
72-
.mode = waylandOutputModeListener
109+
.mode = waylandOutputModeListener, //This is the only one we really need
110+
.geometry = waylandOutputGeometryListener,
111+
112+
#if WAYLAND_VERSION_MINOR >= 2
113+
.done = waylandOutputDoneListener,
114+
.scale = waylandOutputScaleListener,
115+
#endif
116+
117+
#if WAYLAND_VERSION_MINOR >= 4
118+
.name = waylandOutputNameListener,
119+
.description = waylandOutputDescriptionListener,
120+
#endif
73121
};
74122

75123
wldata->ffwl_proxy_add_listener(output, (void(**)(void)) &outputListener, data);
@@ -115,7 +163,8 @@ bool detectWayland(const FFinstance* instance, FFDisplayServerResult* result)
115163
data.results = &result->resolutions;
116164

117165
struct wl_registry_listener registry_listener = {
118-
.global = waylandGlobalAddListener
166+
.global = waylandGlobalAddListener,
167+
.global_remove = waylandGlobalRemoveListener
119168
};
120169

121170
data.ffwl_proxy_add_listener(registry, (void(**)(void)) &registry_listener, &data);

0 commit comments

Comments
 (0)