Linux: Don't free colormap before the window is destroyed
This commit is contained in:
parent
25c8f8c313
commit
60c4e0a778
|
@ -59,6 +59,7 @@ static GLXContext context = NULL; // OpenGL rendering context
|
||||||
static GLXWindow glx_window;
|
static GLXWindow glx_window;
|
||||||
|
|
||||||
static Atom delete_atom;
|
static Atom delete_atom;
|
||||||
|
static Colormap cmap;
|
||||||
static Window current_win;
|
static Window current_win;
|
||||||
static int current_screen;
|
static int current_screen;
|
||||||
static bool current_fullscreen;
|
static bool current_fullscreen;
|
||||||
|
@ -246,7 +247,6 @@ static void createWindow(JNIEnv* env, int screen, XVisualInfo *vis_info, jstring
|
||||||
Window root_win;
|
Window root_win;
|
||||||
Window win;
|
Window win;
|
||||||
XSetWindowAttributes attribs;
|
XSetWindowAttributes attribs;
|
||||||
Colormap cmap;
|
|
||||||
int attribmask;
|
int attribmask;
|
||||||
|
|
||||||
current_screen = screen;
|
current_screen = screen;
|
||||||
|
@ -262,11 +262,11 @@ static void createWindow(JNIEnv* env, int screen, XVisualInfo *vis_info, jstring
|
||||||
attribs.background_pixel = 0xFF000000;
|
attribs.background_pixel = 0xFF000000;
|
||||||
attribmask = CWColormap | CWBackPixel | CWEventMask;
|
attribmask = CWColormap | CWBackPixel | CWEventMask;
|
||||||
if (fullscreen || undecorated) {
|
if (fullscreen || undecorated) {
|
||||||
|
printf("Depth: %d\n", vis_info->depth);
|
||||||
attribmask |= CWOverrideRedirect;
|
attribmask |= CWOverrideRedirect;
|
||||||
attribs.override_redirect = True;
|
attribs.override_redirect = True;
|
||||||
}
|
}
|
||||||
win = XCreateWindow(getDisplay(), root_win, x, y, width, height, 0, vis_info->depth, InputOutput, vis_info->visual, attribmask, &attribs);
|
win = XCreateWindow(getDisplay(), root_win, x, y, width, height, 0, vis_info->depth, InputOutput, vis_info->visual, attribmask, &attribs);
|
||||||
XFreeColormap(getDisplay(), cmap);
|
|
||||||
printfDebug("Created window\n");
|
printfDebug("Created window\n");
|
||||||
current_win = win;
|
current_win = win;
|
||||||
Java_org_lwjgl_opengl_Window_nSetTitle(env, NULL, title);
|
Java_org_lwjgl_opengl_Window_nSetTitle(env, NULL, title);
|
||||||
|
@ -289,6 +289,7 @@ static void createWindow(JNIEnv* env, int screen, XVisualInfo *vis_info, jstring
|
||||||
|
|
||||||
static void destroyWindow() {
|
static void destroyWindow() {
|
||||||
XDestroyWindow(getDisplay(), current_win);
|
XDestroyWindow(getDisplay(), current_win);
|
||||||
|
XFreeColormap(getDisplay(), cmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
int getCurrentScreen(void) {
|
int getCurrentScreen(void) {
|
||||||
|
|
Loading…
Reference in New Issue