xfFloatbar* xf_floatbar_new(xfContext* xfc, Window window, const char* name, DWORD flags) { xfFloatbar* floatbar; /* Floatbar not enabled */ if ((flags & 0x0001) == 0) return NULL; if (!xfc) return NULL; /* Force disable with remote app */ if (xfc->remote_app) return NULL; floatbar = (xfFloatbar*) calloc(1, sizeof(xfFloatbar)); if (!floatbar) return NULL; floatbar->title = _strdup(name); if (!floatbar->title) goto fail; floatbar->root_window = window; floatbar->flags = flags; floatbar->xfc = xfc; floatbar->locked = flags & 0x0002; xf_floatbar_toggle_fullscreen(floatbar, FALSE); return floatbar; fail: xf_floatbar_free(floatbar); return NULL; }
void xf_DestroyDesktopWindow(xfContext* xfc, xfWindow* window) { if (!window) return; if (xfc->window == window) xfc->window = NULL; xf_floatbar_free(window->floatbar); if (window->gc) XFreeGC(xfc->display, window->gc); if (window->handle) { XUnmapWindow(xfc->display, window->handle); XDestroyWindow(xfc->display, window->handle); } if (window->xfwin) munmap(0, sizeof(*window->xfwin)); if (window->shmid >= 0) close(window->shmid); shm_unlink(get_shm_id()); window->xfwin = (Window*) - 1; window->shmid = -1; free(window); }