mirror of
https://github.com/glfw/glfw.git
synced 2025-12-20 14:11:55 +00:00
Compare commits
11 Commits
00679ca5fc
...
8437607736
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8437607736 | ||
|
|
ac10768495 | ||
|
|
c371f4cb7d | ||
|
|
845f0bd901 | ||
|
|
955e8b0fa4 | ||
|
|
8c3f416c3b | ||
|
|
77fae536a9 | ||
|
|
1b5c120205 | ||
|
|
bb4ba846da | ||
|
|
618532218e | ||
|
|
98019fbe98 |
@ -133,6 +133,7 @@ information on what to include when reporting a bug.
|
|||||||
- [Wayland] Bugfix: A drag entering a non-GLFW surface could cause a segfault
|
- [Wayland] Bugfix: A drag entering a non-GLFW surface could cause a segfault
|
||||||
- [Wayland] Bugfix: Ignore key repeat events when no window has keyboard focus (#2727)
|
- [Wayland] Bugfix: Ignore key repeat events when no window has keyboard focus (#2727)
|
||||||
- [Wayland] Bugfix: Reset key repeat timer when window destroyed (#2741,#2727)
|
- [Wayland] Bugfix: Reset key repeat timer when window destroyed (#2741,#2727)
|
||||||
|
- [Wayland] Bugfix: Memory would leak if reading a data offer failed midway
|
||||||
- [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)
|
||||||
- [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`
|
||||||
|
|||||||
@ -1102,6 +1102,7 @@ extern "C" {
|
|||||||
* [window hint](@ref GLFW_SCALE_FRAMEBUFFER_hint).
|
* [window hint](@ref GLFW_SCALE_FRAMEBUFFER_hint).
|
||||||
*/
|
*/
|
||||||
#define GLFW_SCALE_FRAMEBUFFER 0x0002200D
|
#define GLFW_SCALE_FRAMEBUFFER 0x0002200D
|
||||||
|
#define GLFW_FULLSCREEN 0x0002200E
|
||||||
/*! @brief Legacy name for compatibility.
|
/*! @brief Legacy name for compatibility.
|
||||||
*
|
*
|
||||||
* This is an alias for the
|
* This is an alias for the
|
||||||
|
|||||||
@ -555,6 +555,7 @@ GLFWbool _glfwConnectCocoa(int platformID, _GLFWplatform* platform)
|
|||||||
.setWindowFloating = _glfwSetWindowFloatingCocoa,
|
.setWindowFloating = _glfwSetWindowFloatingCocoa,
|
||||||
.setWindowOpacity = _glfwSetWindowOpacityCocoa,
|
.setWindowOpacity = _glfwSetWindowOpacityCocoa,
|
||||||
.setWindowMousePassthrough = _glfwSetWindowMousePassthroughCocoa,
|
.setWindowMousePassthrough = _glfwSetWindowMousePassthroughCocoa,
|
||||||
|
.getWindowIsFullscreen = _glfwGetWindowIsFullscreenNull,
|
||||||
.pollEvents = _glfwPollEventsCocoa,
|
.pollEvents = _glfwPollEventsCocoa,
|
||||||
.waitEvents = _glfwWaitEventsCocoa,
|
.waitEvents = _glfwWaitEventsCocoa,
|
||||||
.waitEventsTimeout = _glfwWaitEventsTimeoutCocoa,
|
.waitEventsTimeout = _glfwWaitEventsTimeoutCocoa,
|
||||||
|
|||||||
@ -247,6 +247,7 @@ void _glfwSetWindowFloatingCocoa(_GLFWwindow* window, GLFWbool enabled);
|
|||||||
float _glfwGetWindowOpacityCocoa(_GLFWwindow* window);
|
float _glfwGetWindowOpacityCocoa(_GLFWwindow* window);
|
||||||
void _glfwSetWindowOpacityCocoa(_GLFWwindow* window, float opacity);
|
void _glfwSetWindowOpacityCocoa(_GLFWwindow* window, float opacity);
|
||||||
void _glfwSetWindowMousePassthroughCocoa(_GLFWwindow* window, GLFWbool enabled);
|
void _glfwSetWindowMousePassthroughCocoa(_GLFWwindow* window, GLFWbool enabled);
|
||||||
|
GLFWbool _glfwGetWindowIsFullscreenCocoa(_GLFWwindow* window);
|
||||||
|
|
||||||
void _glfwSetRawMouseMotionCocoa(_GLFWwindow *window, GLFWbool enabled);
|
void _glfwSetRawMouseMotionCocoa(_GLFWwindow *window, GLFWbool enabled);
|
||||||
GLFWbool _glfwRawMouseMotionSupportedCocoa(void);
|
GLFWbool _glfwRawMouseMotionSupportedCocoa(void);
|
||||||
|
|||||||
@ -747,6 +747,7 @@ struct _GLFWplatform
|
|||||||
void (*setWindowFloating)(_GLFWwindow*,GLFWbool);
|
void (*setWindowFloating)(_GLFWwindow*,GLFWbool);
|
||||||
void (*setWindowOpacity)(_GLFWwindow*,float);
|
void (*setWindowOpacity)(_GLFWwindow*,float);
|
||||||
void (*setWindowMousePassthrough)(_GLFWwindow*,GLFWbool);
|
void (*setWindowMousePassthrough)(_GLFWwindow*,GLFWbool);
|
||||||
|
GLFWbool (*getWindowIsFullscreen) (_GLFWwindow*);
|
||||||
void (*pollEvents)(void);
|
void (*pollEvents)(void);
|
||||||
void (*waitEvents)(void);
|
void (*waitEvents)(void);
|
||||||
void (*waitEventsTimeout)(double);
|
void (*waitEventsTimeout)(double);
|
||||||
|
|||||||
@ -243,6 +243,8 @@ void _glfwSetWindowResizableNull(_GLFWwindow* window, GLFWbool enabled);
|
|||||||
void _glfwSetWindowDecoratedNull(_GLFWwindow* window, GLFWbool enabled);
|
void _glfwSetWindowDecoratedNull(_GLFWwindow* window, GLFWbool enabled);
|
||||||
void _glfwSetWindowFloatingNull(_GLFWwindow* window, GLFWbool enabled);
|
void _glfwSetWindowFloatingNull(_GLFWwindow* window, GLFWbool enabled);
|
||||||
void _glfwSetWindowMousePassthroughNull(_GLFWwindow* window, GLFWbool enabled);
|
void _glfwSetWindowMousePassthroughNull(_GLFWwindow* window, GLFWbool enabled);
|
||||||
|
GLFWbool _glfwGetWindowIsFullscreenNull(_GLFWwindow* window);
|
||||||
|
|
||||||
float _glfwGetWindowOpacityNull(_GLFWwindow* window);
|
float _glfwGetWindowOpacityNull(_GLFWwindow* window);
|
||||||
void _glfwSetWindowOpacityNull(_GLFWwindow* window, float opacity);
|
void _glfwSetWindowOpacityNull(_GLFWwindow* window, float opacity);
|
||||||
void _glfwSetRawMouseMotionNull(_GLFWwindow *window, GLFWbool enabled);
|
void _glfwSetRawMouseMotionNull(_GLFWwindow *window, GLFWbool enabled);
|
||||||
|
|||||||
@ -408,6 +408,11 @@ void _glfwSetWindowMousePassthroughNull(_GLFWwindow* window, GLFWbool enabled)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GLFWbool _glfwGetWindowIsFullscreenNull(_GLFWwindow* window)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
float _glfwGetWindowOpacityNull(_GLFWwindow* window)
|
float _glfwGetWindowOpacityNull(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
return window->null.opacity;
|
return window->null.opacity;
|
||||||
|
|||||||
@ -660,6 +660,7 @@ GLFWbool _glfwConnectWin32(int platformID, _GLFWplatform* platform)
|
|||||||
.setWindowFloating = _glfwSetWindowFloatingWin32,
|
.setWindowFloating = _glfwSetWindowFloatingWin32,
|
||||||
.setWindowOpacity = _glfwSetWindowOpacityWin32,
|
.setWindowOpacity = _glfwSetWindowOpacityWin32,
|
||||||
.setWindowMousePassthrough = _glfwSetWindowMousePassthroughWin32,
|
.setWindowMousePassthrough = _glfwSetWindowMousePassthroughWin32,
|
||||||
|
.getWindowIsFullscreen = _glfwGetWindowIsFullscreenNull,
|
||||||
.pollEvents = _glfwPollEventsWin32,
|
.pollEvents = _glfwPollEventsWin32,
|
||||||
.waitEvents = _glfwWaitEventsWin32,
|
.waitEvents = _glfwWaitEventsWin32,
|
||||||
.waitEventsTimeout = _glfwWaitEventsTimeoutWin32,
|
.waitEventsTimeout = _glfwWaitEventsTimeoutWin32,
|
||||||
|
|||||||
@ -513,6 +513,7 @@ void _glfwSetWindowResizableWin32(_GLFWwindow* window, GLFWbool enabled);
|
|||||||
void _glfwSetWindowDecoratedWin32(_GLFWwindow* window, GLFWbool enabled);
|
void _glfwSetWindowDecoratedWin32(_GLFWwindow* window, GLFWbool enabled);
|
||||||
void _glfwSetWindowFloatingWin32(_GLFWwindow* window, GLFWbool enabled);
|
void _glfwSetWindowFloatingWin32(_GLFWwindow* window, GLFWbool enabled);
|
||||||
void _glfwSetWindowMousePassthroughWin32(_GLFWwindow* window, GLFWbool enabled);
|
void _glfwSetWindowMousePassthroughWin32(_GLFWwindow* window, GLFWbool enabled);
|
||||||
|
GLFWbool _glfwGetWindowIsFullscreenWin32(_GLFWwindow* window);
|
||||||
float _glfwGetWindowOpacityWin32(_GLFWwindow* window);
|
float _glfwGetWindowOpacityWin32(_GLFWwindow* window);
|
||||||
void _glfwSetWindowOpacityWin32(_GLFWwindow* window, float opacity);
|
void _glfwSetWindowOpacityWin32(_GLFWwindow* window, float opacity);
|
||||||
|
|
||||||
|
|||||||
@ -900,6 +900,8 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib)
|
|||||||
return window->focusOnShow;
|
return window->focusOnShow;
|
||||||
case GLFW_MOUSE_PASSTHROUGH:
|
case GLFW_MOUSE_PASSTHROUGH:
|
||||||
return window->mousePassthrough;
|
return window->mousePassthrough;
|
||||||
|
case GLFW_FULLSCREEN:
|
||||||
|
return _glfw.platform.getWindowIsFullscreen(window);
|
||||||
case GLFW_TRANSPARENT_FRAMEBUFFER:
|
case GLFW_TRANSPARENT_FRAMEBUFFER:
|
||||||
return _glfw.platform.framebufferTransparent(window);
|
return _glfw.platform.framebufferTransparent(window);
|
||||||
case GLFW_RESIZABLE:
|
case GLFW_RESIZABLE:
|
||||||
|
|||||||
@ -506,6 +506,7 @@ GLFWbool _glfwConnectWayland(int platformID, _GLFWplatform* platform)
|
|||||||
.setWindowFloating = _glfwSetWindowFloatingWayland,
|
.setWindowFloating = _glfwSetWindowFloatingWayland,
|
||||||
.setWindowOpacity = _glfwSetWindowOpacityWayland,
|
.setWindowOpacity = _glfwSetWindowOpacityWayland,
|
||||||
.setWindowMousePassthrough = _glfwSetWindowMousePassthroughWayland,
|
.setWindowMousePassthrough = _glfwSetWindowMousePassthroughWayland,
|
||||||
|
.getWindowIsFullscreen = _glfwGetWindowIsFullscreenNull,
|
||||||
.pollEvents = _glfwPollEventsWayland,
|
.pollEvents = _glfwPollEventsWayland,
|
||||||
.waitEvents = _glfwWaitEventsWayland,
|
.waitEvents = _glfwWaitEventsWayland,
|
||||||
.waitEventsTimeout = _glfwWaitEventsTimeoutWayland,
|
.waitEventsTimeout = _glfwWaitEventsTimeoutWayland,
|
||||||
|
|||||||
@ -648,6 +648,7 @@ void _glfwSetWindowFloatingWayland(_GLFWwindow* window, GLFWbool enabled);
|
|||||||
float _glfwGetWindowOpacityWayland(_GLFWwindow* window);
|
float _glfwGetWindowOpacityWayland(_GLFWwindow* window);
|
||||||
void _glfwSetWindowOpacityWayland(_GLFWwindow* window, float opacity);
|
void _glfwSetWindowOpacityWayland(_GLFWwindow* window, float opacity);
|
||||||
void _glfwSetWindowMousePassthroughWayland(_GLFWwindow* window, GLFWbool enabled);
|
void _glfwSetWindowMousePassthroughWayland(_GLFWwindow* window, GLFWbool enabled);
|
||||||
|
GLFWbool _glfwGetWindowIsFullscreenWayland(_GLFWwindow* window);
|
||||||
|
|
||||||
void _glfwSetRawMouseMotionWayland(_GLFWwindow* window, GLFWbool enabled);
|
void _glfwSetRawMouseMotionWayland(_GLFWwindow* window, GLFWbool enabled);
|
||||||
GLFWbool _glfwRawMouseMotionSupportedWayland(void);
|
GLFWbool _glfwRawMouseMotionSupportedWayland(void);
|
||||||
|
|||||||
@ -1333,6 +1333,7 @@ static char* readDataOfferAsString(struct wl_data_offer* offer, const char* mime
|
|||||||
if (!longer)
|
if (!longer)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_OUT_OF_MEMORY, NULL);
|
_glfwInputError(GLFW_OUT_OF_MEMORY, NULL);
|
||||||
|
_glfw_free(string);
|
||||||
close(fds[0]);
|
close(fds[0]);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -1352,6 +1353,7 @@ static char* readDataOfferAsString(struct wl_data_offer* offer, const char* mime
|
|||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Wayland: Failed to read from data offer pipe: %s",
|
"Wayland: Failed to read from data offer pipe: %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
_glfw_free(string);
|
||||||
close(fds[0]);
|
close(fds[0]);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1237,6 +1237,7 @@ GLFWbool _glfwConnectX11(int platformID, _GLFWplatform* platform)
|
|||||||
.setWindowFloating = _glfwSetWindowFloatingX11,
|
.setWindowFloating = _glfwSetWindowFloatingX11,
|
||||||
.setWindowOpacity = _glfwSetWindowOpacityX11,
|
.setWindowOpacity = _glfwSetWindowOpacityX11,
|
||||||
.setWindowMousePassthrough = _glfwSetWindowMousePassthroughX11,
|
.setWindowMousePassthrough = _glfwSetWindowMousePassthroughX11,
|
||||||
|
.getWindowIsFullscreen = _glfwGetWindowIsFullscreenX11,
|
||||||
.pollEvents = _glfwPollEventsX11,
|
.pollEvents = _glfwPollEventsX11,
|
||||||
.waitEvents = _glfwWaitEventsX11,
|
.waitEvents = _glfwWaitEventsX11,
|
||||||
.waitEventsTimeout = _glfwWaitEventsTimeoutX11,
|
.waitEventsTimeout = _glfwWaitEventsTimeoutX11,
|
||||||
|
|||||||
@ -934,6 +934,7 @@ void _glfwSetWindowFloatingX11(_GLFWwindow* window, GLFWbool enabled);
|
|||||||
float _glfwGetWindowOpacityX11(_GLFWwindow* window);
|
float _glfwGetWindowOpacityX11(_GLFWwindow* window);
|
||||||
void _glfwSetWindowOpacityX11(_GLFWwindow* window, float opacity);
|
void _glfwSetWindowOpacityX11(_GLFWwindow* window, float opacity);
|
||||||
void _glfwSetWindowMousePassthroughX11(_GLFWwindow* window, GLFWbool enabled);
|
void _glfwSetWindowMousePassthroughX11(_GLFWwindow* window, GLFWbool enabled);
|
||||||
|
GLFWbool _glfwGetWindowIsFullscreenX11(_GLFWwindow* window);
|
||||||
|
|
||||||
void _glfwSetRawMouseMotionX11(_GLFWwindow *window, GLFWbool enabled);
|
void _glfwSetRawMouseMotionX11(_GLFWwindow *window, GLFWbool enabled);
|
||||||
GLFWbool _glfwRawMouseMotionSupportedX11(void);
|
GLFWbool _glfwRawMouseMotionSupportedX11(void);
|
||||||
|
|||||||
@ -2729,6 +2729,51 @@ void _glfwSetWindowMousePassthroughX11(_GLFWwindow* window, GLFWbool enabled)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GLFWbool _glfwGetWindowIsFullscreenX11(_GLFWwindow* window)
|
||||||
|
{
|
||||||
|
Atom wm_state = XInternAtom(_glfw.x11.display, "_NET_WM_STATE", True);
|
||||||
|
Atom wm_state_fullscreen = XInternAtom(_glfw.x11.display, "_NET_WM_STATE_FULLSCREEN", True);
|
||||||
|
|
||||||
|
Atom type = XA_ATOM;
|
||||||
|
int format;
|
||||||
|
size_t nItems;
|
||||||
|
size_t bytesAfterReturn;
|
||||||
|
Atom* prop;
|
||||||
|
|
||||||
|
int result = XGetWindowProperty(
|
||||||
|
_glfw.x11.display,
|
||||||
|
window->x11.handle,
|
||||||
|
wm_state,
|
||||||
|
0,
|
||||||
|
~0L,
|
||||||
|
False,
|
||||||
|
AnyPropertyType,
|
||||||
|
&type,
|
||||||
|
&format,
|
||||||
|
&nItems,
|
||||||
|
&bytesAfterReturn,
|
||||||
|
(unsigned char**)&prop
|
||||||
|
);
|
||||||
|
|
||||||
|
assert(result == Success);
|
||||||
|
assert(nItems > 0);
|
||||||
|
|
||||||
|
if (!prop) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
GLFWbool isFullscreen = 0;
|
||||||
|
for (int i = 0; i < nItems; i++) {
|
||||||
|
if (prop[i] == wm_state_fullscreen) {
|
||||||
|
isFullscreen = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
XFree(prop);
|
||||||
|
|
||||||
|
return isFullscreen;
|
||||||
|
}
|
||||||
|
|
||||||
float _glfwGetWindowOpacityX11(_GLFWwindow* window)
|
float _glfwGetWindowOpacityX11(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
float opacity = 1.f;
|
float opacity = 1.f;
|
||||||
|
|||||||
@ -441,6 +441,7 @@ int main(int argc, char** argv)
|
|||||||
nk_value_bool(nk, "Visible", glfwGetWindowAttrib(window, GLFW_VISIBLE));
|
nk_value_bool(nk, "Visible", glfwGetWindowAttrib(window, GLFW_VISIBLE));
|
||||||
nk_value_bool(nk, "Iconified", glfwGetWindowAttrib(window, GLFW_ICONIFIED));
|
nk_value_bool(nk, "Iconified", glfwGetWindowAttrib(window, GLFW_ICONIFIED));
|
||||||
nk_value_bool(nk, "Maximized", glfwGetWindowAttrib(window, GLFW_MAXIMIZED));
|
nk_value_bool(nk, "Maximized", glfwGetWindowAttrib(window, GLFW_MAXIMIZED));
|
||||||
|
nk_value_bool(nk, "Fullscreen", glfwGetWindowAttrib(window, GLFW_FULLSCREEN));
|
||||||
}
|
}
|
||||||
nk_end(nk);
|
nk_end(nk);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user