Create x11_window_destroy

This commit is contained in:
twinaphex 2015-11-19 11:49:09 +01:00
parent d113f218a2
commit 48495980ba
5 changed files with 14 additions and 8 deletions

View File

@ -548,3 +548,12 @@ void x11_input_ctx_destroy(void)
{
x11_destroy_input_context(&g_x11_xim, &g_x11_xic);
}
void x11_window_destroy(bool fullscreen)
{
if (g_x11_win)
XUnmapWindow(g_x11_dpy, g_x11_win);
if (!fullscreen)
XDestroyWindow(g_x11_dpy, g_x11_win);
g_x11_win = 0;
}

View File

@ -85,5 +85,7 @@ bool x11_input_ctx_new(void);
void x11_input_ctx_destroy(void);
void x11_window_destroy(bool fullscreen);
#endif

View File

@ -826,8 +826,7 @@ static void xv_free(void *data)
shmctl(xv->shminfo.shmid, IPC_RMID, NULL);
XFree(xv->image);
if (g_x11_win)
XUnmapWindow(g_x11_dpy, g_x11_win);
x11_window_destroy(true);
if (xv->colormap)
XFreeColormap(g_x11_dpy, xv->colormap);

View File

@ -124,9 +124,7 @@ static void ctx_glx_destroy_resources(gfx_ctx_glx_data_t *glx)
}
#endif
XUnmapWindow(g_x11_dpy, g_x11_win);
XDestroyWindow(g_x11_dpy, g_x11_win);
g_x11_win = None;
x11_window_destroy(false);
}
if (glx->g_cmap)

View File

@ -533,9 +533,7 @@ static void gfx_ctx_xegl_destroy(void *data)
RARCH_LOG("[X/EGL]: Saved monitor #%u.\n", g_screen);
#endif
XUnmapWindow(g_x11_dpy, g_x11_win);
XDestroyWindow(g_x11_dpy, g_x11_win);
g_x11_win = None;
x11_window_destroy(false);
}
if (g_cmap)