#include <signal.h>
#include <X11/Xlib.h>
#include <X11/X.h>
+#include <X11/extensions/shape.h>
#include <Ecore.h>
/* local subsystem functions */
static Font font = 0;
static XFontStruct *fs = NULL;
static GC gc = 0;
-static Window win = 0, b1 = 0, b2 = 0;
-static int ww = 320, hh = 240;
+static Window cwin = 0, win = 0, b1 = 0, b2 = 0;
+static int ww = 320, hh = 240, wx = 20, wy = 20;
+
+EAPI unsigned long e_alert_composite_win = 0;
/* externally accessible functions */
EAPI int
att.override_redirect = True;
mask = CWBackPixel | CWBorderPixel | CWOverrideRedirect;
+ wx = (wid - ww) / 2;
+ wy = (hih - hh) / 2;
+
win = XCreateWindow(dd, DefaultRootWindow(dd),
- (wid - ww) / 2, (hih - hh) / 2, ww, hh, 0,
- CopyFromParent, InputOutput,
- CopyFromParent, mask, &att);
+ wx, wy, ww, hh, 0,
+ CopyFromParent, InputOutput,
+ CopyFromParent, mask, &att);
b1 = XCreateWindow(dd, win, -100, -100, 1, 1, 0, CopyFromParent,
InputOutput, CopyFromParent, mask, &att);
XMoveResizeWindow(dd, b2, w, hh - 15 - fh, mh + 10, fh + 10);
XSelectInput(dd, b2, ButtonPressMask | ButtonReleaseMask | ExposureMask);
- XMapWindow(dd, win);
+ if (e_alert_composite_win)
+ {
+#ifdef ShapeInput
+ XRectangle rect;
+
+ rect.x = wx;
+ rect.y = wy;
+ rect.width = ww;
+ rect.height = hh;
+ XShapeCombineRectangles(dd, e_alert_composite_win, ShapeInput,
+ 0, 0, &rect, 1, ShapeSet, Unsorted);
+#endif
+ XReparentWindow(dd, win, e_alert_composite_win, wx, wy);
+ }
+ XMapRaised(dd, win);
XGrabPointer(dd, win, True, ButtonPressMask | ButtonReleaseMask,
GrabModeAsync, GrabModeAsync, None, None, CurrentTime);
XGrabKeyboard(dd, win, False, GrabModeAsync, GrabModeAsync, CurrentTime);
static void
_e_mod_comp_win_configure(Comp_Win *cw, int x, int y, int w, int h, int border)
{
- if (!((x == cw->c) && (y == cw->y)))
+ if (!((x == cw->x) && (y == cw->y)))
{
cw->x = x;
cw->y = y;
if (!c) return NULL;
c->man = man;
c->win = ecore_x_composite_render_window_enable(man->root);
+ if (c->man->num == 0) e_alert_composite_win = c->win;
c->ee = ecore_evas_software_x11_new(NULL, c->win, 0, 0, man->w, man->h);
c->evas = ecore_evas_get(c->ee);
ecore_evas_show(c->ee);
while (c->wins)
{
- cw = c->wins;
+ cw = (Comp_Win *)(c->wins);
_e_mod_comp_win_hide(cw);
_e_mod_comp_win_del(cw);
}
// ecore_x_composite_unredirect_subwindows
// (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL);
ecore_x_composite_render_window_disable(c->win);
+ if (c->man->num == 0) e_alert_composite_win = 0;
free(c);
}