mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-11 03:43:29 +00:00
fix display leak
This commit is contained in:
@@ -33,6 +33,7 @@ struct _MwLLX11 {
|
|||||||
XIC xic;
|
XIC xic;
|
||||||
|
|
||||||
int top;
|
int top;
|
||||||
|
int toplevel;
|
||||||
int grabbed;
|
int grabbed;
|
||||||
int force_render;
|
int force_render;
|
||||||
|
|
||||||
|
|||||||
@@ -151,10 +151,12 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) {
|
|||||||
r->x11.display = XOpenDisplay(NULL);
|
r->x11.display = XOpenDisplay(NULL);
|
||||||
p = XRootWindow(r->x11.display, XDefaultScreen(r->x11.display));
|
p = XRootWindow(r->x11.display, XDefaultScreen(r->x11.display));
|
||||||
r->x11.top = 1;
|
r->x11.top = 1;
|
||||||
|
r->x11.toplevel = 1;
|
||||||
} else {
|
} else {
|
||||||
r->x11.display = parent->x11.display;
|
r->x11.display = parent->x11.display;
|
||||||
p = parent->x11.window;
|
p = parent->x11.window;
|
||||||
r->x11.top = 0;
|
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)));
|
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;
|
sh.flags = PWinGravity;
|
||||||
@@ -252,6 +254,8 @@ static void MwLLDestroyImpl(MwLL handle) {
|
|||||||
|
|
||||||
XSync(handle->x11.display, False);
|
XSync(handle->x11.display, False);
|
||||||
|
|
||||||
|
if(handle->x11.toplevel) XCloseDisplay(handle->x11.display);
|
||||||
|
|
||||||
free(handle);
|
free(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user