-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for resize operation on borderless windows #991
base: master
Are you sure you want to change the base?
Conversation
This adds the function ```glfwResizeWindow```, that allows to resize windows without borders.
The function ```glfwResizeWindow``` now supports the Windows platform.
This is an initial implementation and still isn't working.
The Wayland implementation is fixed by #992. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Will need to be updated for touch support, but wl_shell doesn't support that so can only wait for xdg_shell for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR!
break; | ||
case GLFW_WINDOW_BOTTOMRIGHT: | ||
wlBorder = WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The absence of a default case will make compilers yell at you for having wlBorder
potentially uninitialised, you should either initialise it at declaration, or (better imo) add a default case which assert(GLFW_FALSE)
to tell the compiler this can never happen.
break; | ||
case GLFW_WINDOW_BOTTOMRIGHT: | ||
wBorder = HTBOTTOMRIGHT; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
break; | ||
case GLFW_WINDOW_BOTTOMRIGHT: | ||
xclient.data.l[2] = _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
/*! @brief Starts a resize operation with the specified window. | ||
* | ||
* This function starts a resize operation on one of the borders of the | ||
* specified window. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add a mention that this function must be called from a pointer event callback, otherwise it risks reacting to a different event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or touch.
This patch adds the functionality to resize a borderless window, by specifying the region relative to the resize operation:
GLFW_WINDOW_LEFT
GLFW_WINDOW_TOP
GLFW_WINDOW_RIGHT
GLFW_WINDOW_BOTTOM
GLFW_WINDOW_TOPLEFT
GLFW_WINDOW_TOPRIGHT
GLFW_WINDOW_BOTTOMLEFT
GLFW_WINDOW_BOTTOMRIGHT
This is related with the issue #990.