glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
+void remove_window(CompositedScreen *screen, Window w)
+{
+ unsigned i;
+
+ for(i=0; i<screen->nwindows; ++i)
+ if(screen->windows[i].window==w)
+ {
+ glDeleteTextures(1, &screen->windows[i].texture);
+
+ --screen->nwindows;
+ for(; i<screen->nwindows; ++i)
+ screen->windows[i] = screen->windows[i+1];
+ }
+}
+
CompositedScreen *find_screen_by_root(Compositor *compositor, Window root)
{
unsigned i;
add_window(compositor, screen, event->window);
}
+void process_destroy_window_event(Compositor *compositor, XDestroyWindowEvent *event)
+{
+ CompositedScreen *screen = find_screen_by_root(compositor, event->event);
+ if(!screen)
+ return;
+
+ remove_window(screen, event->window);
+}
+
void process_map_event(Compositor *compositor, XMapEvent *event)
{
CompositedScreen *screen = find_screen_by_root(compositor, event->event);
case CreateNotify:
process_create_window_event(compositor, &event.xcreatewindow);
break;
+ case DestroyNotify:
+ process_destroy_window_event(compositor, &event.xdestroywindow);
+ break;
case MapNotify:
process_map_event(compositor, &event.xmap);
break;