diff --git a/src/bin/e.h b/src/bin/e.h index 45f50c53e..b5893a355 100644 --- a/src/bin/e.h +++ b/src/bin/e.h @@ -221,4 +221,6 @@ extern EAPI int evil; extern EAPI int starting; extern EAPI int stopping; +extern EAPI unsigned long e_alert_composite_win; + #endif diff --git a/src/bin/e_alert.c b/src/bin/e_alert.c index f8df0a74a..e26126474 100644 --- a/src/bin/e_alert.c +++ b/src/bin/e_alert.c @@ -11,6 +11,7 @@ #include #include #include +#include #include /* local subsystem functions */ @@ -21,8 +22,10 @@ static char *title = NULL, *str1 = NULL, *str2 = NULL; 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 @@ -50,10 +53,13 @@ e_alert_init(const char *disp) 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); @@ -116,7 +122,21 @@ e_alert_show(const char *text) 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); diff --git a/src/modules/comp/e_mod_comp.c b/src/modules/comp/e_mod_comp.c index 977541d21..ecd12b3ef 100644 --- a/src/modules/comp/e_mod_comp.c +++ b/src/modules/comp/e_mod_comp.c @@ -183,7 +183,7 @@ _e_mod_comp_win_lower(Comp_Win *cw) 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; @@ -406,6 +406,7 @@ _e_mod_comp_add(E_Manager *man) 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); @@ -490,7 +491,7 @@ e_mod_comp_shutdown(void) while (c->wins) { - cw = c->wins; + cw = (Comp_Win *)(c->wins); _e_mod_comp_win_hide(cw); _e_mod_comp_win_del(cw); } @@ -498,6 +499,7 @@ e_mod_comp_shutdown(void) // 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); }