mirror of
https://github.com/glfw/glfw
synced 2026-09-26 16:18:21 +03:00
First test of overrideRedirect
This commit is contained in:
parent
92dcf4ce74
commit
b56520c434
5 changed files with 1210 additions and 1176 deletions
667
docs/window.md
667
docs/window.md
File diff suppressed because it is too large
Load diff
1701
include/GLFW/glfw3.h
1701
include/GLFW/glfw3.h
File diff suppressed because it is too large
Load diff
|
|
@ -421,6 +421,7 @@ struct _GLFWwndconfig
|
|||
struct {
|
||||
char className[256];
|
||||
char instanceName[256];
|
||||
bool overrideRedirect;
|
||||
} x11;
|
||||
struct {
|
||||
bool keymenu;
|
||||
|
|
@ -1020,4 +1021,3 @@ int _glfw_max(int a, int b);
|
|||
void* _glfw_calloc(size_t count, size_t size);
|
||||
void* _glfw_realloc(void* pointer, size_t size);
|
||||
void _glfw_free(void* pointer);
|
||||
|
||||
|
|
|
|||
|
|
@ -430,6 +430,9 @@ GLFWAPI void glfwWindowHint(int hint, int value)
|
|||
case GLFW_REFRESH_RATE:
|
||||
_glfw.hints.refreshRate = value;
|
||||
return;
|
||||
case GLFW_X11_OVERRIDE_REDIRECT:
|
||||
_glfw.hints.window.x11.overrideRedirect = value;
|
||||
return;
|
||||
}
|
||||
|
||||
_glfwInputError(GLFW_INVALID_ENUM, "Invalid window hint 0x%08X", hint);
|
||||
|
|
@ -1195,4 +1198,3 @@ GLFWAPI void glfwPostEmptyEvent(void)
|
|||
_GLFW_REQUIRE_INIT();
|
||||
_glfw.platform.postEmptyEvent();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -597,12 +597,21 @@ static GLFWbool createNativeWindow(_GLFWwindow* window,
|
|||
window->x11.transparent = _glfwIsVisualTransparentX11(visual);
|
||||
|
||||
XSetWindowAttributes wa = { 0 };
|
||||
|
||||
unsigned long wamask = CWBorderPixel | CWColormap | CWEventMask;
|
||||
|
||||
wa.colormap = window->x11.colormap;
|
||||
wa.event_mask = StructureNotifyMask | KeyPressMask | KeyReleaseMask |
|
||||
PointerMotionMask | ButtonPressMask | ButtonReleaseMask |
|
||||
ExposureMask | FocusChangeMask | VisibilityChangeMask |
|
||||
EnterWindowMask | LeaveWindowMask | PropertyChangeMask;
|
||||
|
||||
if (_glfw.hints.window.x11.overrideRedirect)
|
||||
{
|
||||
wa.override_redirect = True;
|
||||
wamask |= CWOverrideRedirect;
|
||||
}
|
||||
|
||||
_glfwGrabErrorHandlerX11();
|
||||
|
||||
window->x11.parent = _glfw.x11.root;
|
||||
|
|
@ -614,7 +623,7 @@ static GLFWbool createNativeWindow(_GLFWwindow* window,
|
|||
depth, // Color depth
|
||||
InputOutput,
|
||||
visual,
|
||||
CWBorderPixel | CWColormap | CWEventMask,
|
||||
wamask,
|
||||
&wa);
|
||||
|
||||
_glfwReleaseErrorHandlerX11();
|
||||
|
|
@ -3384,4 +3393,3 @@ GLFWAPI const char* glfwGetX11SelectionString(void)
|
|||
}
|
||||
|
||||
#endif // _GLFW_X11
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue