mirror of
https://github.com/glfw/glfw.git
synced 2025-12-19 21:51:56 +00:00
Compare commits
5 Commits
1909c866df
...
399d877b9a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
399d877b9a | ||
|
|
936307558e | ||
|
|
4df5129529 | ||
|
|
6de70d8252 | ||
|
|
6d94c6792b |
@ -282,10 +282,12 @@ video tutorials.
|
|||||||
- Corentin Wallez
|
- Corentin Wallez
|
||||||
- Torsten Walluhn
|
- Torsten Walluhn
|
||||||
- Patrick Walton
|
- Patrick Walton
|
||||||
|
- Ivor Wanders
|
||||||
- Jim Wang
|
- Jim Wang
|
||||||
- Xo Wang
|
- Xo Wang
|
||||||
- Andre Weissflog
|
- Andre Weissflog
|
||||||
- Jay Weisskopf
|
- Jay Weisskopf
|
||||||
|
- Drew Weymouth
|
||||||
- Frank Wille
|
- Frank Wille
|
||||||
- Andy Williams
|
- Andy Williams
|
||||||
- Joel Winarske
|
- Joel Winarske
|
||||||
|
|||||||
@ -145,6 +145,10 @@ information on what to include when reporting a bug.
|
|||||||
- [Wayland] Bugfix: The cursor position was not updated when clicking through
|
- [Wayland] Bugfix: The cursor position was not updated when clicking through
|
||||||
from a modal to the content area
|
from a modal to the content area
|
||||||
- [X11] Bugfix: Running without a WM could trigger an assert (#2593,#2601,#2631)
|
- [X11] Bugfix: Running without a WM could trigger an assert (#2593,#2601,#2631)
|
||||||
|
- [X11] Bugfix: Occasional crash when an idle display awakes (#2766)
|
||||||
|
- [X11] Bugfix: Prevent BadWindow when creating small windows with a content scale
|
||||||
|
less than 1 (#2754)
|
||||||
|
- [X11] Bugfix: Clamp width and height to >= 1 to prevent BadValue error and app exit
|
||||||
- [Null] Added Vulkan 'window' surface creation via `VK_EXT_headless_surface`
|
- [Null] Added Vulkan 'window' surface creation via `VK_EXT_headless_surface`
|
||||||
- [Null] Added EGL context creation on Mesa via `EGL_MESA_platform_surfaceless`
|
- [Null] Added EGL context creation on Mesa via `EGL_MESA_platform_surfaceless`
|
||||||
- [EGL] Allowed native access on Wayland with `GLFW_CONTEXT_CREATION_API` set to
|
- [EGL] Allowed native access on Wayland with `GLFW_CONTEXT_CREATION_API` set to
|
||||||
|
|||||||
@ -1016,48 +1016,57 @@ static GLFWbool createLibdecorFrame(_GLFWwindow* window)
|
|||||||
|
|
||||||
static void updateXdgSizeLimits(_GLFWwindow* window)
|
static void updateXdgSizeLimits(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
int minwidth, minheight, maxwidth, maxheight;
|
int minwidth = 0, minheight = 0;
|
||||||
|
int maxwidth = 0, maxheight = 0;
|
||||||
|
GLFWbool setMin = GLFW_FALSE, setMax = GLFW_FALSE;
|
||||||
|
|
||||||
if (window->resizable)
|
if (window->resizable)
|
||||||
{
|
{
|
||||||
if (window->minwidth == GLFW_DONT_CARE || window->minheight == GLFW_DONT_CARE)
|
if (window->minwidth != GLFW_DONT_CARE && window->minheight != GLFW_DONT_CARE)
|
||||||
minwidth = minheight = 0;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
minwidth = window->minwidth;
|
minwidth = window->minwidth;
|
||||||
minheight = window->minheight;
|
minheight = window->minheight;
|
||||||
|
setMin = GLFW_TRUE;
|
||||||
if (window->wl.fallback.decorations)
|
|
||||||
{
|
|
||||||
minwidth += GLFW_BORDER_SIZE * 2;
|
|
||||||
minheight += GLFW_CAPTION_HEIGHT + GLFW_BORDER_SIZE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window->maxwidth == GLFW_DONT_CARE || window->maxheight == GLFW_DONT_CARE)
|
if (window->maxwidth != GLFW_DONT_CARE && window->maxheight != GLFW_DONT_CARE)
|
||||||
maxwidth = maxheight = 0;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
maxwidth = window->maxwidth;
|
maxwidth = window->maxwidth;
|
||||||
maxheight = window->maxheight;
|
maxheight = window->maxheight;
|
||||||
|
setMax = GLFW_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (window->wl.fallback.decorations)
|
if (window->wl.fallback.decorations)
|
||||||
|
{
|
||||||
|
if (setMin)
|
||||||
{
|
{
|
||||||
maxwidth += GLFW_BORDER_SIZE * 2;
|
minwidth += GLFW_BORDER_SIZE * 2;
|
||||||
|
minheight += GLFW_CAPTION_HEIGHT + GLFW_BORDER_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (setMax)
|
||||||
|
{
|
||||||
|
maxwidth += GLFW_BORDER_SIZE * 2;
|
||||||
maxheight += GLFW_CAPTION_HEIGHT + GLFW_BORDER_SIZE;
|
maxheight += GLFW_CAPTION_HEIGHT + GLFW_BORDER_SIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Non-resizable: lock to current size
|
||||||
minwidth = maxwidth = window->wl.width;
|
minwidth = maxwidth = window->wl.width;
|
||||||
minheight = maxheight = window->wl.height;
|
minheight = maxheight = window->wl.height;
|
||||||
|
setMin = setMax = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
xdg_toplevel_set_min_size(window->wl.xdg.toplevel, minwidth, minheight);
|
if (setMin)
|
||||||
xdg_toplevel_set_max_size(window->wl.xdg.toplevel, maxwidth, maxheight);
|
xdg_toplevel_set_min_size(window->wl.xdg.toplevel, minwidth, minheight);
|
||||||
|
|
||||||
|
if (setMax)
|
||||||
|
xdg_toplevel_set_max_size(window->wl.xdg.toplevel, maxwidth, maxheight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static GLFWbool createXdgShellObjects(_GLFWwindow* window)
|
static GLFWbool createXdgShellObjects(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
window->wl.xdg.surface = xdg_wm_base_get_xdg_surface(_glfw.wl.wmBase,
|
window->wl.xdg.surface = xdg_wm_base_get_xdg_surface(_glfw.wl.wmBase,
|
||||||
|
|||||||
@ -151,6 +151,11 @@ void _glfwPollMonitorsX11(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
XRRCrtcInfo* ci = XRRGetCrtcInfo(_glfw.x11.display, sr, oi->crtc);
|
XRRCrtcInfo* ci = XRRGetCrtcInfo(_glfw.x11.display, sr, oi->crtc);
|
||||||
|
if (!ci) {
|
||||||
|
XRRFreeOutputInfo(oi);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (ci->rotation == RR_Rotate_90 || ci->rotation == RR_Rotate_270)
|
if (ci->rotation == RR_Rotate_90 || ci->rotation == RR_Rotate_270)
|
||||||
{
|
{
|
||||||
widthMM = oi->mm_height;
|
widthMM = oi->mm_height;
|
||||||
|
|||||||
@ -576,6 +576,10 @@ static GLFWbool createNativeWindow(_GLFWwindow* window,
|
|||||||
height *= _glfw.x11.contentScaleY;
|
height *= _glfw.x11.contentScaleY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The dimensions must be nonzero, or a BadValue error results.
|
||||||
|
width = _glfw_max(1, width);
|
||||||
|
height = _glfw_max(1, height);
|
||||||
|
|
||||||
int xpos = 0, ypos = 0;
|
int xpos = 0, ypos = 0;
|
||||||
|
|
||||||
if (wndconfig->xpos != GLFW_ANY_POSITION && wndconfig->ypos != GLFW_ANY_POSITION)
|
if (wndconfig->xpos != GLFW_ANY_POSITION && wndconfig->ypos != GLFW_ANY_POSITION)
|
||||||
@ -2203,6 +2207,10 @@ void _glfwGetWindowSizeX11(_GLFWwindow* window, int* width, int* height)
|
|||||||
|
|
||||||
void _glfwSetWindowSizeX11(_GLFWwindow* window, int width, int height)
|
void _glfwSetWindowSizeX11(_GLFWwindow* window, int width, int height)
|
||||||
{
|
{
|
||||||
|
// The dimensions must be nonzero, or a BadValue error results.
|
||||||
|
width = _glfw_max(1, width);
|
||||||
|
height = _glfw_max(1, height);
|
||||||
|
|
||||||
if (window->monitor)
|
if (window->monitor)
|
||||||
{
|
{
|
||||||
if (window->monitor->window == window)
|
if (window->monitor->window == window)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user