|
|
|
@ -55,7 +55,8 @@ static void outputHandleGeometry(void* userData, |
|
|
|
|
monitor->widthMM = physicalWidth; |
|
|
|
|
monitor->heightMM = physicalHeight; |
|
|
|
|
|
|
|
|
|
snprintf(monitor->name, sizeof(monitor->name), "%s %s", make, model); |
|
|
|
|
if (strlen(monitor->name) == 0) |
|
|
|
|
snprintf(monitor->name, sizeof(monitor->name), "%s %s", make, model); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void outputHandleMode(void* userData, |
|
|
|
@ -108,12 +109,33 @@ static void outputHandleScale(void* userData, |
|
|
|
|
monitor->wl.scale = factor; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifdef WL_OUTPUT_NAME_SINCE_VERSION |
|
|
|
|
|
|
|
|
|
void outputHandleName(void* userData, struct wl_output* wl_output, const char* name) |
|
|
|
|
{ |
|
|
|
|
struct _GLFWmonitor* monitor = userData; |
|
|
|
|
|
|
|
|
|
strncpy(monitor->name, name, sizeof(monitor->name) - 1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void outputHandleDescription(void* userData, |
|
|
|
|
struct wl_output* wl_output, |
|
|
|
|
const char* description) |
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endif // WL_OUTPUT_NAME_SINCE_VERSION
|
|
|
|
|
|
|
|
|
|
static const struct wl_output_listener outputListener = |
|
|
|
|
{ |
|
|
|
|
outputHandleGeometry, |
|
|
|
|
outputHandleMode, |
|
|
|
|
outputHandleDone, |
|
|
|
|
outputHandleScale, |
|
|
|
|
#ifdef WL_OUTPUT_NAME_SINCE_VERSION |
|
|
|
|
outputHandleName, |
|
|
|
|
outputHandleDescription, |
|
|
|
|
#endif |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -130,10 +152,16 @@ void _glfwAddOutputWayland(uint32_t name, uint32_t version) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifdef WL_OUTPUT_NAME_SINCE_VERSION |
|
|
|
|
version = _glfw_min(version, WL_OUTPUT_NAME_SINCE_VERSION); |
|
|
|
|
#else |
|
|
|
|
version = 2; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
struct wl_output* output = wl_registry_bind(_glfw.wl.registry, |
|
|
|
|
name, |
|
|
|
|
&wl_output_interface, |
|
|
|
|
2); |
|
|
|
|
version); |
|
|
|
|
if (!output) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|