summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/e_popup.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/bin/e_popup.c b/src/bin/e_popup.c
index 752089dd8..b9b129d86 100644
--- a/src/bin/e_popup.c
+++ b/src/bin/e_popup.c
@@ -18,8 +18,9 @@ static Eina_Hash *_e_popup_hash = NULL;
18EAPI int 18EAPI int
19e_popup_init(void) 19e_popup_init(void)
20{ 20{
21 _e_popup_window_shape_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHAPE, 21 _e_popup_window_shape_handler =
22 _e_popup_cb_window_shape, NULL); 22 ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHAPE,
23 _e_popup_cb_window_shape, NULL);
23 if (!_e_popup_hash) _e_popup_hash = eina_hash_string_superfast_new(NULL); 24 if (!_e_popup_hash) _e_popup_hash = eina_hash_string_superfast_new(NULL);
24 return 1; 25 return 1;
25} 26}
@@ -40,7 +41,7 @@ EAPI E_Popup *
40e_popup_new(E_Zone *zone, int x, int y, int w, int h) 41e_popup_new(E_Zone *zone, int x, int y, int w, int h)
41{ 42{
42 E_Popup *pop; 43 E_Popup *pop;
43 44
44 pop = E_OBJECT_ALLOC(E_Popup, E_POPUP_TYPE, _e_popup_free); 45 pop = E_OBJECT_ALLOC(E_Popup, E_POPUP_TYPE, _e_popup_free);
45 if (!pop) return NULL; 46 if (!pop) return NULL;
46 pop->zone = zone; 47 pop->zone = zone;
@@ -54,7 +55,7 @@ e_popup_new(E_Zone *zone, int x, int y, int w, int h)
54 &(pop->evas_win)); 55 &(pop->evas_win));
55 /* avoid excess exposes when shaped - set damage avoid to 1 */ 56 /* avoid excess exposes when shaped - set damage avoid to 1 */
56// ecore_evas_avoid_damage_set(pop->ecore_evas, 1); 57// ecore_evas_avoid_damage_set(pop->ecore_evas, 1);
57 58
58 e_canvas_add(pop->ecore_evas); 59 e_canvas_add(pop->ecore_evas);
59 pop->shape = e_container_shape_add(pop->zone->container); 60 pop->shape = e_container_shape_add(pop->zone->container);
60 e_container_shape_move(pop->shape, pop->zone->x + pop->x, pop->zone->y + pop->y); 61 e_container_shape_move(pop->shape, pop->zone->x + pop->x, pop->zone->y + pop->y);
@@ -85,7 +86,7 @@ e_popup_show(E_Popup *pop)
85 E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE); 86 E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
86 if (pop->visible) return; 87 if (pop->visible) return;
87 pop->visible = 1; 88 pop->visible = 1;
88 if (pop->shaped && !e_config->use_composite) 89 if ((pop->shaped) && (!e_config->use_composite))
89 { 90 {
90 ecore_evas_move(pop->ecore_evas, 91 ecore_evas_move(pop->ecore_evas,
91 pop->zone->container->manager->w, 92 pop->zone->container->manager->w,
@@ -173,7 +174,7 @@ EAPI void
173e_popup_edje_bg_object_set(E_Popup *pop, Evas_Object *o) 174e_popup_edje_bg_object_set(E_Popup *pop, Evas_Object *o)
174{ 175{
175 const char *shape_option; 176 const char *shape_option;
176 177
177 E_OBJECT_CHECK(pop); 178 E_OBJECT_CHECK(pop);
178 E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE); 179 E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
179 shape_option = edje_object_data_get(o, "shaped"); 180 shape_option = edje_object_data_get(o, "shaped");
@@ -210,24 +211,24 @@ e_popup_idler_before(void)
210{ 211{
211 Eina_List *l; 212 Eina_List *l;
212 E_Popup *pop; 213 E_Popup *pop;
213 214
214 EINA_LIST_FOREACH(_e_popup_list, l, pop) 215 EINA_LIST_FOREACH(_e_popup_list, l, pop)
215 { 216 {
216 if (pop->need_shape_export) 217 if (pop->need_shape_export)
217 { 218 {
218 Ecore_X_Rectangle *rects, *orects; 219 Ecore_X_Rectangle *rects, *orects;
219 int num; 220 int num;
220 221
221 rects = ecore_x_window_shape_rectangles_get(pop->evas_win, &num); 222 rects = ecore_x_window_shape_rectangles_get(pop->evas_win, &num);
222 if (rects) 223 if (rects)
223 { 224 {
224 int changed; 225 int changed;
225 226
226 changed = 1; 227 changed = 1;
227 if ((num == pop->shape_rects_num) && (pop->shape_rects)) 228 if ((num == pop->shape_rects_num) && (pop->shape_rects))
228 { 229 {
229 int i; 230 int i;
230 231
231 orects = pop->shape_rects; 232 orects = pop->shape_rects;
232 changed = 0; 233 changed = 0;
233 for (i = 0; i < num; i++) 234 for (i = 0; i < num; i++)
@@ -286,7 +287,7 @@ EAPI E_Popup *
286e_popup_find_by_window(Ecore_X_Window win) 287e_popup_find_by_window(Ecore_X_Window win)
287{ 288{
288 E_Popup *pop; 289 E_Popup *pop;
289 290
290 pop = eina_hash_find(_e_popup_hash, e_util_winid_str_get(win)); 291 pop = eina_hash_find(_e_popup_hash, e_util_winid_str_get(win));
291 if ((pop) && (pop->evas_win != win)) 292 if ((pop) && (pop->evas_win != win))
292 return NULL; 293 return NULL;
@@ -318,14 +319,12 @@ static int
318_e_popup_idle_enterer(void *data) 319_e_popup_idle_enterer(void *data)
319{ 320{
320 E_Popup *pop; 321 E_Popup *pop;
321 322
322 pop = (E_Popup *)data; 323 if (!(pop = data)) return 0;
323 ecore_evas_move(pop->ecore_evas, 324 ecore_evas_move(pop->ecore_evas,
324 pop->zone->x + pop->x, 325 pop->zone->x + pop->x,
325 pop->zone->y + pop->y); 326 pop->zone->y + pop->y);
326
327 e_container_shape_show(pop->shape); 327 e_container_shape_show(pop->shape);
328
329 pop->idle_enterer = NULL; 328 pop->idle_enterer = NULL;
330 return 0; 329 return 0;
331} 330}
@@ -335,7 +334,7 @@ _e_popup_cb_window_shape(void *data, int ev_type, void *ev)
335{ 334{
336 E_Popup *pop; 335 E_Popup *pop;
337 Ecore_X_Event_Window_Shape *e; 336 Ecore_X_Event_Window_Shape *e;
338 337
339 e = ev; 338 e = ev;
340 pop = e_popup_find_by_window(e->win); 339 pop = e_popup_find_by_window(e->win);
341 if (pop) pop->need_shape_export = 1; 340 if (pop) pop->need_shape_export = 1;