int i, value, has_alpha;
for (i = 0; i < count; i++) {
-
vi = glXGetVisualFromFBConfig(obt_display, in[i]);
if (vi == NULL)
continue;
memset(&obcomp.PixmapConfig, 0, sizeof(obcomp.PixmapConfig));
- for (i = 0; i < MAX_DEPTH + 1; i++) {
+ for (i = 1; i < MAX_DEPTH + 1; i++) {
get_best_fbcon(fbcs, count, i, &obcomp.PixmapConfig[i]);
}
// for (it = stacking_list; it; it = g_list_next(it)) {
for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) {
win = it->data;
- if (win->type != OB_WINDOW_CLASS_CLIENT)
+ if (win->type == OB_WINDOW_CLASS_PROMPT)
continue;
- client = WINDOW_AS_CLIENT(win);
- if (client->desktop != screen_desktop)
+ if (!win->mapped)
continue;
+ if (win->type == OB_WINDOW_CLASS_CLIENT) {
+ client = WINDOW_AS_CLIENT(win);
+ if (client->desktop != screen_desktop)
+ continue;
+ }
+
if (win->depth == 32)
attribs[1] = GLX_TEXTURE_FORMAT_RGBA_EXT;
else
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
- glVertex3f(client->frame->area.x, client->frame->area.y, 0.0);
+ glVertex3f(win->comp_area.x, win->comp_area.y, 0.0);
glTexCoord2f(0, 1);
- glVertex3f(client->frame->area.x, client->frame->area.y + client->frame->area.height, 0.0);
+ glVertex3f(win->comp_area.x, win->comp_area.y + win->comp_area.height, 0.0);
glTexCoord2f(1, 1);
- glVertex3f(client->frame->area.x + client->frame->area.width, client->frame->area.y + client->frame->area.height, 0.0);
+ glVertex3f(win->comp_area.x + win->comp_area.width, win->comp_area.y + win->comp_area.height, 0.0);
glTexCoord2f(1, 0);
- glVertex3f(client->frame->area.x + client->frame->area.width, client->frame->area.y, 0.0);
+ glVertex3f(win->comp_area.x + win->comp_area.width, win->comp_area.y, 0.0);
glEnd();
}
glXSwapBuffers(obt_display, obcomp.overlay);
#include "obt/xqueue.h"
#include "obt/prop.h"
#include "obt/keyboard.h"
-
+#include "geom.h"
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <glib.h>
frame_adjust_focus(client->frame, FALSE);
}
#ifdef USE_COMPOSITING
- else if ((e->type == ConfigureNotify || e->type == MapNotify)
+ else if ((e->type == CreateNotify) && obwin
+ && obwin->type != OB_WINDOW_CLASS_PROMPT) {
+ XCreateWindowEvent const *xe = &e->xcreatewindow;
+ if (xe->window == window_top(obwin)) {
+ obwin->mapped = 0;
+ RECT_SET(obwin->comp_area, xe->x, xe->y, xe->width, xe->height);
+ }
+ } else if ((e->type == ConfigureNotify || e->type == MapNotify)
&& obwin && obwin->type != OB_WINDOW_CLASS_PROMPT) {
- if (obwin->pixmap != None) {
- XFreePixmap(obt_display, obwin->pixmap);
- obwin->pixmap = None;
+ gboolean pixchange = FALSE;
+
+ if (e->type == ConfigureNotify) {
+ XConfigureEvent const *xe = &e->xconfigure;
+ if (xe->window == window_top(obwin)) {
+ if ((obwin->comp_area.width != xe->width)
+ || (obwin->comp_area.height != xe->height))
+ pixchange = TRUE;
+ RECT_SET(obwin->comp_area, xe->x, xe->y, xe->width, xe->height);
+ }
}
- if (obwin->gpixmap != None) {
- glXDestroyGLXPixmap(obt_display, obwin->gpixmap);
- obwin->gpixmap = None;
+
+ if (e->type == MapNotify) {
+ XMapEvent const *xe = &e->xmap;
+ if (xe->window == window_top(obwin)) {
+ pixchange = TRUE;
+ obwin->mapped = TRUE;
+ }
}
-//XXX actually need to check if this was just a move and not re-make the pmap!
-//printf("win %d has pixmap %d\n", window_top(obwin), obwin->pixmap);
+ if (pixchange) {
+ if (obwin->pixmap != None) {
+ XFreePixmap(obt_display, obwin->pixmap);
+ obwin->pixmap = None;
+ }
+ if (obwin->gpixmap != None) {
+ glXDestroyGLXPixmap(obt_display, obwin->gpixmap);
+ obwin->gpixmap = None;
+ }
+ }
+ } else if ((e->type == UnmapNotify) && obwin
+ && obwin->type != OB_WINDOW_CLASS_PROMPT) {
+ if (e->xunmap.window == window_top(obwin))
+ obwin->mapped = FALSE;
}
#endif
else if (client)