Reduce the difference of glfw/wl_* to 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-12 14:55:32 +02:00
parent da3e1a3730
commit 8be698681c
No known key found for this signature in database
GPG Key ID: 14140F703B7D8362
4 changed files with 43 additions and 32 deletions

7
glfw/wl_init.c vendored
View File

@ -46,7 +46,8 @@ static inline int min(int n1, int n2)
return n1 < n2 ? n1 : n2; return n1 < n2 ? n1 : n2;
} }
static _GLFWwindow* findWindowFromDecorationSurface(struct wl_surface* surface, int* which) static _GLFWwindow* findWindowFromDecorationSurface(struct wl_surface* surface,
int* which)
{ {
int focus; int focus;
_GLFWwindow* window = _glfw.windowListHead; _GLFWwindow* window = _glfw.windowListHead;
@ -174,7 +175,8 @@ static void pointerHandleMotion(void* data,
switch (window->wl.decorations.focus) switch (window->wl.decorations.focus)
{ {
case mainWindow: case mainWindow:
_glfwInputCursorPos(window, window->wl.cursorPosX, window->wl.cursorPosY); _glfwInputCursorPos(window,
window->wl.cursorPosX, window->wl.cursorPosY);
return; return;
case topDecoration: case topDecoration:
if (window->wl.cursorPosY < _GLFW_DECORATION_WIDTH) if (window->wl.cursorPosY < _GLFW_DECORATION_WIDTH)
@ -217,7 +219,6 @@ static void pointerHandleButton(void* data,
{ {
_GLFWwindow* window = _glfw.wl.pointerFocus; _GLFWwindow* window = _glfw.wl.pointerFocus;
int glfwButton; int glfwButton;
uint32_t edges = XDG_TOPLEVEL_RESIZE_EDGE_NONE; uint32_t edges = XDG_TOPLEVEL_RESIZE_EDGE_NONE;
if (!window) if (!window)

10
glfw/wl_monitor.c vendored
View File

@ -71,7 +71,7 @@ static void outputHandleMode(void* data,
mode.redBits = 8; mode.redBits = 8;
mode.greenBits = 8; mode.greenBits = 8;
mode.blueBits = 8; mode.blueBits = 8;
mode.refreshRate = (int)round(refresh / 1000.0); mode.refreshRate = (int) round(refresh / 1000.0);
monitor->modeCount++; monitor->modeCount++;
monitor->modes = monitor->modes =
@ -173,7 +173,9 @@ void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
*yscale = (float) monitor->wl.scale; *yscale = (float) monitor->wl.scale;
} }
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos, int *width, int *height) void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor,
int* xpos, int* ypos,
int* width, int* height)
{ {
if (xpos) if (xpos)
*xpos = monitor->wl.x; *xpos = monitor->wl.x;
@ -203,7 +205,8 @@ bool _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp)
return false; return false;
} }
void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor,
const GLFWgammaramp* ramp)
{ {
_glfwInputError(GLFW_PLATFORM_ERROR, _glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Gamma ramp access is not available"); "Wayland: Gamma ramp access is not available");
@ -220,3 +223,4 @@ GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* handle)
_GLFW_REQUIRE_INIT_OR_RETURN(NULL); _GLFW_REQUIRE_INIT_OR_RETURN(NULL);
return monitor->wl.output; return monitor->wl.output;
} }

1
glfw/wl_platform.h vendored
View File

@ -321,3 +321,4 @@ void _glfwSetupWaylandDataDevice(void);
void _glfwSetupWaylandPrimarySelectionDevice(void); void _glfwSetupWaylandPrimarySelectionDevice(void);
void animateCursorImage(id_type timer_id, void *data); void animateCursorImage(id_type timer_id, void *data);
struct wl_cursor* _glfwLoadCursor(GLFWCursorShape); struct wl_cursor* _glfwLoadCursor(GLFWCursorShape);

9
glfw/wl_window.c vendored
View File

@ -914,6 +914,7 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window)
destroyDecorations(window); destroyDecorations(window);
if (window->wl.xdg.decoration) if (window->wl.xdg.decoration)
zxdg_toplevel_decoration_v1_destroy(window->wl.xdg.decoration); zxdg_toplevel_decoration_v1_destroy(window->wl.xdg.decoration);
if (window->wl.decorations.buffer) if (window->wl.decorations.buffer)
wl_buffer_destroy(window->wl.decorations.buffer); wl_buffer_destroy(window->wl.decorations.buffer);
@ -1001,13 +1002,15 @@ void _glfwPlatformSetWindowSizeLimits(_GLFWwindow* window,
} }
} }
void _glfwPlatformSetWindowAspectRatio(_GLFWwindow* window, int numer, int denom) void _glfwPlatformSetWindowAspectRatio(_GLFWwindow* window,
int numer, int denom)
{ {
// TODO: find out how to trigger a resize. // TODO: find out how to trigger a resize.
// The actual limits are checked in the xdg_toplevel::configure handler. // The actual limits are checked in the xdg_toplevel::configure handler.
} }
void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height) void _glfwPlatformGetFramebufferSize(_GLFWwindow* window,
int* width, int* height)
{ {
_glfwPlatformGetWindowSize(window, width, height); _glfwPlatformGetWindowSize(window, width, height);
*width *= window->wl.scale; *width *= window->wl.scale;
@ -2001,6 +2004,7 @@ frame_handle_redraw(void *data, struct wl_callback *callback, uint32_t time) {
wl_callback_destroy(callback); wl_callback_destroy(callback);
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
////// GLFW native API ////// ////// GLFW native API //////
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
@ -2042,3 +2046,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);
} }