First test of overrideRedirect

This commit is contained in:
Sooly890 2026-09-01 19:14:23 +12:00
parent 92dcf4ce74
commit b56520c434
No known key found for this signature in database
GPG key ID: 56CBDEA30B5C8DA2
5 changed files with 1210 additions and 1176 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -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);

View file

@ -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();
}

View file

@ -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