summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b7cfb79)
When a reparenting window manager is in use, new windows appear on the
root window first and immediately get reparented. We must unredirect
them so the contents appear in the window manager frame.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
-void remove_window(CompositedScreen *screen, Window w)
+void remove_window(Compositor *compositor, CompositedScreen *screen, Window w, int destroyed)
if(screen->windows[i].window==w)
{
glDeleteTextures(1, &screen->windows[i].texture);
if(screen->windows[i].window==w)
{
glDeleteTextures(1, &screen->windows[i].texture);
+ if(!destroyed)
+ {
+ XDamageDestroy(compositor->display, screen->windows[i].damage);
+ if(screen->windows[i].pixmap)
+ {
+ glXDestroyPixmap(compositor->display, screen->windows[i].glx_pixmap);
+ XFreePixmap(compositor->display, screen->windows[i].pixmap);
+ }
+ XCompositeUnredirectWindow(compositor->display, screen->windows[i].window, CompositeRedirectManual);
+ }
--screen->nwindows;
for(; i<screen->nwindows; ++i)
--screen->nwindows;
for(; i<screen->nwindows; ++i)
- remove_window(screen, event->window);
+ remove_window(compositor, screen, event->window, 1);
}
void process_map_event(Compositor *compositor, XMapEvent *event)
}
void process_map_event(Compositor *compositor, XMapEvent *event)
window->map_state = IsUnviewable;
}
window->map_state = IsUnviewable;
}
+void process_reparent_event(Compositor *compositor, XReparentEvent *event)
+{
+ CompositedScreen *screen = find_screen_by_root(compositor, event->event);
+ if(!screen)
+ return;
+
+ if(event->parent==screen->root)
+ add_window(compositor, screen, event->window);
+ else
+ remove_window(compositor, screen, event->window, 0);
+}
+
void process_damage_event(Compositor *compositor, XDamageNotifyEvent *event)
{
CompositedScreen *screen = find_screen_by_window(compositor, event->drawable);
void process_damage_event(Compositor *compositor, XDamageNotifyEvent *event)
{
CompositedScreen *screen = find_screen_by_window(compositor, event->drawable);
case UnmapNotify:
process_unmap_event(compositor, &event.xunmap);
break;
case UnmapNotify:
process_unmap_event(compositor, &event.xunmap);
break;
+ case ReparentNotify:
+ process_reparent_event(compositor, &event.xreparent);
+ break;
default:
if(event.type==compositor->damage_event+XDamageNotify)
process_damage_event(compositor, (XDamageNotifyEvent *)&event);
default:
if(event.type==compositor->damage_event+XDamageNotify)
process_damage_event(compositor, (XDamageNotifyEvent *)&event);