E: Re-enable Alert window when composite module is running.

SVN revision: 62182
This commit is contained in:
Christopher Michael 2011-08-07 14:03:21 +00:00
parent 29dffc306c
commit 750dbdf926
5 changed files with 32 additions and 20 deletions

View File

@ -467,6 +467,7 @@ PKG_CHECK_MODULES(E_INIT, [
PKG_CHECK_MODULES(E_ALERT, [
xcb
xcb-shape
eina >= 1.0.999
ecore >= 1.0.999
ecore-ipc >= 1.0.999

View File

@ -239,6 +239,6 @@ extern EAPI Eina_Bool restart;
extern EAPI Eina_Bool e_precache_end;
extern EAPI Eina_Bool x_fatal;
//extern EAPI unsigned long e_alert_composite_win;
extern EAPI unsigned long e_alert_composite_win;
#endif

View File

@ -7,6 +7,9 @@ static Eina_Bool _e_alert_cb_exe_del(void *data __UNUSED__, int type __UNUSED__,
static Ecore_Exe *alert_exe = NULL;
static Ecore_Event_Handler *alert_exe_hdl = NULL;
/* public variables */
EAPI unsigned long e_alert_composite_win = 0;
EINTERN int
e_alert_init(void)
{
@ -33,8 +36,8 @@ e_alert_show(int sig)
char buf[8192];
snprintf(buf, sizeof(buf),
"%s/enlightenment/utils/enlightenment_alert %d %d",
e_prefix_lib_get(), sig, getpid());
"%s/enlightenment/utils/enlightenment_alert %d %d %d",
e_prefix_lib_get(), sig, getpid(), e_alert_composite_win);
alert_exe = ecore_exe_run(buf, NULL);
pause();

View File

@ -10,6 +10,7 @@
#include <Ecore.h>
#include <Ecore_Ipc.h>
#include <xcb/xcb.h>
#include <xcb/shape.h>
#define WINDOW_WIDTH 320
#define WINDOW_HEIGHT 240
@ -43,7 +44,7 @@ static Ecore_Ipc_Server *_ipc_server = NULL;
static Ecore_Ipc_Server *_server = NULL;
static xcb_connection_t *conn = NULL;
static xcb_screen_t *screen = NULL;
static xcb_window_t win = 0;
static xcb_window_t win = 0, comp_win = 0;
static xcb_window_t btn1 = 0;
static xcb_window_t btn2 = 0;
static xcb_font_t font = 0;
@ -73,6 +74,8 @@ main(int argc, char **argv)
sig = atoi(argv[i]); // signal
else if ((i == 2))
pid = atoi(argv[i]); // E's pid
else if ((i == 3))
comp_win = atoi(argv[i]); // Composite Alert Window
}
if (!ecore_init()) return EXIT_FAILURE;
@ -253,21 +256,25 @@ _e_alert_display(void)
_e_alert_button_move_resize(btn2, x, WINDOW_HEIGHT - 20 - (fh + 20),
w, (fh + 20));
/* FIXME: May need e_alert_composite_win here and checks for shapedinput */
/* if (e_alert_composite_win) */
/* { */
/* #ifdef ShapeInput */
/* XRectangle rect; */
if (comp_win)
{
xcb_rectangle_t rect;
int wx = 0, wy = 0;
/* 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); */
/* } */
wx = ((sw - WINDOW_WIDTH) / 2);
wy = ((sh - WINDOW_HEIGHT) / 2);
rect.x = wx;
rect.y = wy;
rect.width = WINDOW_WIDTH;
rect.height = WINDOW_HEIGHT;
xcb_shape_rectangles(conn, XCB_SHAPE_SO_SET,
XCB_SHAPE_SK_INPUT, XCB_CLIP_ORDERING_UNSORTED,
comp_win, 0, 0, 1, &rect);
xcb_reparent_window(conn, win, comp_win, wx, wy);
}
/* map and raise main window */
xcb_map_window(conn, win);
@ -332,6 +339,7 @@ _e_alert_shutdown(void)
xcb_destroy_window(conn, btn1);
xcb_destroy_window(conn, btn2);
xcb_destroy_window(conn, win);
if (comp_win) xcb_destroy_window(conn, comp_win);
xcb_free_gc(conn, gc);
xcb_disconnect(conn);
}

View File

@ -3140,7 +3140,7 @@ _e_mod_comp_add(E_Manager *man)
}
ecore_x_screen_is_composited_set(c->man->num, c->cm_selection);
// if (c->man->num == 0) e_alert_composite_win = c->win;
if (c->man->num == 0) e_alert_composite_win = c->win;
if (_comp_mod->conf->engine == E_EVAS_ENGINE_GL_X11)
{
@ -3310,7 +3310,7 @@ _e_mod_comp_del(E_Comp *c)
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;
if (c->man->num == 0) e_alert_composite_win = 0;
if (c->render_animator) ecore_animator_del(c->render_animator);
if (c->new_up_timer) ecore_timer_del(c->new_up_timer);
if (c->update_job) ecore_job_del(c->update_job);