fix display leak

This commit is contained in:
NishiOwO
2025-12-05 13:08:27 +09:00
parent 3ec8ccf40f
commit cc05431879
2 changed files with 5 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ struct _MwLLX11 {
XIC xic;
int top;
int toplevel;
int grabbed;
int force_render;

View File

@@ -151,10 +151,12 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) {
r->x11.display = XOpenDisplay(NULL);
p = XRootWindow(r->x11.display, XDefaultScreen(r->x11.display));
r->x11.top = 1;
r->x11.toplevel = 1;
} else {
r->x11.display = parent->x11.display;
p = parent->x11.window;
r->x11.top = 0;
r->x11.toplevel = 0;
}
r->x11.window = XCreateSimpleWindow(r->x11.display, p, px, py, width, height, 0, 0, WhitePixel(r->x11.display, DefaultScreen(r->x11.display)));
sh.flags = PWinGravity;
@@ -252,6 +254,8 @@ static void MwLLDestroyImpl(MwLL handle) {
XSync(handle->x11.display, False);
if(handle->x11.toplevel) XCloseDisplay(handle->x11.display);
free(handle);
}