Reduce the difference of glfw/x11_* to glfw upstream

This only changes some formatting, whitespace, etc.. There are no
changes to the functionality.
Let me know if you don't like some of those changes.
This commit is contained in:
Luflosi 2019-06-11 17:57:36 +02:00
parent 7d385849fb
commit bada795320
No known key found for this signature in database
GPG Key ID: 14140F703B7D8362
4 changed files with 32 additions and 21 deletions

1
glfw/x11_init.c vendored
View File

@ -611,6 +611,7 @@ Cursor _glfwCreateCursorX11(const GLFWimage* image, int xhot, int yhot)
return cursor; return cursor;
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
////// GLFW platform API ////// ////// GLFW platform API //////
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////

6
glfw/x11_monitor.c vendored
View File

@ -349,7 +349,7 @@ void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
*yscale = _glfw.x11.contentScaleY; *yscale = _glfw.x11.contentScaleY;
} }
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos, int *width, int *height) void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height)
{ {
int areaX = 0, areaY = 0, areaWidth = 0, areaHeight = 0; int areaX = 0, areaY = 0, areaWidth = 0, areaHeight = 0;
@ -595,7 +595,8 @@ void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)
(unsigned short*) ramp->green, (unsigned short*) ramp->green,
(unsigned short*) ramp->blue); (unsigned short*) ramp->blue);
} }
else { else
{
_glfwInputError(GLFW_PLATFORM_ERROR, _glfwInputError(GLFW_PLATFORM_ERROR,
"X11: Gamma ramp access not supported by server"); "X11: Gamma ramp access not supported by server");
} }
@ -619,3 +620,4 @@ GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* handle)
_GLFW_REQUIRE_INIT_OR_RETURN(None); _GLFW_REQUIRE_INIT_OR_RETURN(None);
return monitor->x11.output; return monitor->x11.output;
} }

2
glfw/x11_platform.h vendored
View File

@ -406,6 +406,7 @@ typedef struct _GLFWcursorX11
} _GLFWcursorX11; } _GLFWcursorX11;
void _glfwPollMonitorsX11(void); void _glfwPollMonitorsX11(void);
void _glfwSetVideoModeX11(_GLFWmonitor* monitor, const GLFWvidmode* desired); void _glfwSetVideoModeX11(_GLFWmonitor* monitor, const GLFWvidmode* desired);
void _glfwRestoreVideoModeX11(_GLFWmonitor* monitor); void _glfwRestoreVideoModeX11(_GLFWmonitor* monitor);
@ -424,3 +425,4 @@ void _glfwInputErrorX11(int error, const char* message);
void _glfwGetSystemContentScaleX11(float* xscale, float* yscale, bool bypass_cache); void _glfwGetSystemContentScaleX11(float* xscale, float* yscale, bool bypass_cache);
void _glfwPushSelectionToManagerX11(void); void _glfwPushSelectionToManagerX11(void);

6
glfw/x11_window.c vendored
View File

@ -51,6 +51,7 @@
#define _GLFW_XDND_VERSION 5 #define _GLFW_XDND_VERSION 5
// Wait for data to arrive using poll // Wait for data to arrive using poll
// This avoids blocking other threads via the per-display Xlib lock that also // This avoids blocking other threads via the per-display Xlib lock that also
// covers GLX functions // covers GLX functions
@ -2250,6 +2251,7 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window,
XMapRaised(_glfw.x11.display, window->x11.handle); XMapRaised(_glfw.x11.display, window->x11.handle);
waitForVisibilityNotify(window); waitForVisibilityNotify(window);
} }
updateWindowMode(window); updateWindowMode(window);
acquireMonitor(window); acquireMonitor(window);
} }
@ -2294,10 +2296,13 @@ int _glfwPlatformWindowMaximized(_GLFWwindow* window)
Atom* states; Atom* states;
unsigned long i; unsigned long i;
bool maximized = false; bool maximized = false;
if (!_glfw.x11.NET_WM_STATE || if (!_glfw.x11.NET_WM_STATE ||
!_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT || !_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT ||
!_glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ) !_glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ)
{
return maximized; return maximized;
}
const unsigned long count = const unsigned long count =
_glfwGetWindowPropertyX11(window->x11.handle, _glfwGetWindowPropertyX11(window->x11.handle,
_glfw.x11.NET_WM_STATE, _glfw.x11.NET_WM_STATE,
@ -2891,3 +2896,4 @@ GLFWAPI unsigned long long glfwDBusUserNotify(const char *app_name, const char*
GLFWAPI void glfwDBusSetUserNotificationHandler(GLFWDBusnotificationactivatedfun handler) { GLFWAPI void glfwDBusSetUserNotificationHandler(GLFWDBusnotificationactivatedfun handler) {
glfw_dbus_set_user_notification_activated_handler(handler); glfw_dbus_set_user_notification_activated_handler(handler);
} }