mirror of
https://github.com/0intro/wmii
synced 2024-11-21 21:31:33 +03:00
Fix some bugs.
This commit is contained in:
parent
7f57a9fd5a
commit
f36c830a49
@ -314,7 +314,7 @@ client_destroy(Client *c) {
|
||||
event("DestroyClient %#C\n", c);
|
||||
|
||||
event_flush(FocusChangeMask, true);
|
||||
free(c->w.hints);
|
||||
cleanupwindow(&c->w);
|
||||
free(c);
|
||||
}
|
||||
|
||||
|
@ -239,6 +239,7 @@ void changeproperty(Window*, char*, char*, int width, uchar*, int);
|
||||
void clientmessage(Window*, char*, long, int, ClientMessageData);
|
||||
void copyimage(Image*, Rectangle, Image*, Point);
|
||||
Window* createwindow(Window*, Rectangle, int depth, uint class, WinAttr*, int valuemask);
|
||||
void cleanupwindow(Window*);
|
||||
Window* createwindow_visual(Window*, Rectangle, int depth, Visual*, uint class, WinAttr*, int);
|
||||
void delproperty(Window*, char*);
|
||||
void destroywindow(Window*);
|
||||
|
@ -4,15 +4,21 @@
|
||||
#include "../x11.h"
|
||||
|
||||
void
|
||||
destroywindow(Window *w) {
|
||||
cleanupwindow(Window *w) {
|
||||
assert(w->type == WWindow);
|
||||
sethandler(w, nil);
|
||||
while(w->handler_link)
|
||||
pophandler(w, w->handler_link->handler);
|
||||
free(w->hints);
|
||||
if(w->xft)
|
||||
xft->drawdestroy(w->xft);
|
||||
if(w->gc)
|
||||
XFreeGC(display, w->gc);
|
||||
}
|
||||
|
||||
void
|
||||
destroywindow(Window *w) {
|
||||
cleanupwindow(w);
|
||||
XDestroyWindow(display, w->xid);
|
||||
free(w);
|
||||
}
|
||||
|
@ -2,13 +2,18 @@
|
||||
* See LICENSE file for license details.
|
||||
*/
|
||||
#include "../x11.h"
|
||||
#include <assert.h>
|
||||
|
||||
Window*
|
||||
findwin(XWindow w) {
|
||||
findwin(XWindow xw) {
|
||||
Window *w;
|
||||
void **e;
|
||||
|
||||
e = map_get(&windowmap, (ulong)w, false);
|
||||
if(e)
|
||||
return *e;
|
||||
e = map_get(&windowmap, (ulong)xw, false);
|
||||
if(e) {
|
||||
w = *e;
|
||||
assert(w->xid == xw);
|
||||
return w;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ Window*
|
||||
window(XWindow xw) {
|
||||
Window *w;
|
||||
|
||||
w = malloc(sizeof *w);
|
||||
w = emallocz(sizeof *w);
|
||||
w->type = WWindow;
|
||||
w->xid = xw;
|
||||
return freelater(w);
|
||||
|
Loading…
Reference in New Issue
Block a user