Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Support for resize operation on borderless windows #991

wants to merge 4 commits into from

Conversation

felselva
Copy link
Contributor

@felselva felselva commented Apr 8, 2017

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.

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.
@felselva
Copy link
Contributor Author

felselva commented Apr 8, 2017

The Wayland implementation is fixed by #992.

@elmindreda elmindreda added enhancement Feature suggestions and PRs Wayland Windows Win32 specific (not Cygwin or WSL) X11 labels Apr 9, 2017
Copy link
Member

@jadahl jadahl left a 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.

Copy link
Member

@linkmauve linkmauve left a 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;
}
Copy link
Member

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;
}
Copy link
Member

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;
}
Copy link
Member

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.
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or touch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature suggestions and PRs Wayland Windows Win32 specific (not Cygwin or WSL) X11
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants