mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-29 09:52:29 +01:00
wrlib: Implemented functions to allow clean-up of Contexts
The function 'RDestroyContext' have been defined in the API for a long time but did not have an implementation, this patch fixes it.
This commit is contained in:
committed by
Carlos R. Mafra
parent
64e4019614
commit
283286e0cd
@@ -688,6 +688,21 @@ RContext *RCreateContext(Display * dpy, int screen_number, const RContextAttribu
|
|||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RDestroyContext(RContext *context)
|
||||||
|
{
|
||||||
|
if (context) {
|
||||||
|
if (context->copy_gc)
|
||||||
|
XFreeGC(context->dpy, context->copy_gc);
|
||||||
|
if (context->attribs) {
|
||||||
|
if ((context->attribs->flags & RC_VisualID) &&
|
||||||
|
!(context->attribs->flags & RC_DefaultVisual))
|
||||||
|
XDestroyWindow(context->dpy, context->drawable);
|
||||||
|
free(context->attribs);
|
||||||
|
}
|
||||||
|
free(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static Bool bestContext(Display * dpy, int screen_number, RContext * context)
|
static Bool bestContext(Display * dpy, int screen_number, RContext * context)
|
||||||
{
|
{
|
||||||
XVisualInfo *vinfo = NULL, rvinfo;
|
XVisualInfo *vinfo = NULL, rvinfo;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ LIBWRASTER3
|
|||||||
RConvertImageMask;
|
RConvertImageMask;
|
||||||
RCopyArea;
|
RCopyArea;
|
||||||
RCreateContext;
|
RCreateContext;
|
||||||
|
RDestroyContext;
|
||||||
RCreateImage;
|
RCreateImage;
|
||||||
RCreateImageFromDrawable;
|
RCreateImageFromDrawable;
|
||||||
RCreateImageFromXImage;
|
RCreateImageFromXImage;
|
||||||
|
|||||||
Reference in New Issue
Block a user