wayland: Report unsupported operations as errors

This commit is contained in:
Emmanuel Gil Peyrot 2016-04-09 00:47:55 +01:00 committed by Camilla Berglund
parent c301a1e51a
commit 1e82832737
2 changed files with 17 additions and 12 deletions

View File

@ -244,13 +244,15 @@ void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode)
void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp)
{ {
// TODO // TODO
fprintf(stderr, "_glfwPlatformGetGammaRamp not implemented yet\n"); _glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Gamma ramp getting not supported yet");
} }
void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)
{ {
// TODO // TODO
fprintf(stderr, "_glfwPlatformSetGammaRamp not implemented yet\n"); _glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Gamma ramp setting not supported yet");
} }

View File

@ -444,8 +444,8 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
void _glfwPlatformSetWindowIcon(_GLFWwindow* window, void _glfwPlatformSetWindowIcon(_GLFWwindow* window,
int count, const GLFWimage* images) int count, const GLFWimage* images)
{ {
// TODO _glfwInputError(GLFW_PLATFORM_ERROR,
fprintf(stderr, "_glfwPlatformSetWindowIcon not implemented yet\n"); "Wayland: Setting window icon not supported");
} }
void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos) void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
@ -514,8 +514,9 @@ void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window,
void _glfwPlatformIconifyWindow(_GLFWwindow* window) void _glfwPlatformIconifyWindow(_GLFWwindow* window)
{ {
// TODO // TODO: move to xdg_shell instead of wl_shell.
fprintf(stderr, "_glfwPlatformIconifyWindow not implemented yet\n"); _glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Iconify window not supported");
} }
void _glfwPlatformRestoreWindow(_GLFWwindow* window) void _glfwPlatformRestoreWindow(_GLFWwindow* window)
@ -565,8 +566,8 @@ void _glfwPlatformHideWindow(_GLFWwindow* window)
void _glfwPlatformFocusWindow(_GLFWwindow* window) void _glfwPlatformFocusWindow(_GLFWwindow* window)
{ {
// TODO _glfwInputError(GLFW_PLATFORM_ERROR,
fprintf(stderr, "_glfwPlatformFocusWindow not implemented yet\n"); "Wayland: Focusing a window requires user interaction");
} }
void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, void _glfwPlatformSetWindowMonitor(_GLFWwindow* window,
@ -677,7 +678,7 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
if (fd < 0) if (fd < 0)
{ {
_glfwInputError(GLFW_PLATFORM_ERROR, _glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Creating a buffer file for %d B failed: %m\n", "Wayland: Creating a buffer file for %d B failed: %m",
length); length);
return GLFW_FALSE; return GLFW_FALSE;
} }
@ -686,7 +687,7 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
if (data == MAP_FAILED) if (data == MAP_FAILED)
{ {
_glfwInputError(GLFW_PLATFORM_ERROR, _glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Cursor mmap failed: %m\n"); "Wayland: Cursor mmap failed: %m");
close(fd); close(fd);
return GLFW_FALSE; return GLFW_FALSE;
} }
@ -925,13 +926,15 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor)
void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string) void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string)
{ {
// TODO // TODO
fprintf(stderr, "_glfwPlatformSetClipboardString not implemented yet\n"); _glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Clipboard setting not implemented yet");
} }
const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
{ {
// TODO // TODO
fprintf(stderr, "_glfwPlatformGetClipboardString not implemented yet\n"); _glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Clipboard getting not implemented yet");
return NULL; return NULL;
} }