e-wm: fix memory usage with illume causing OOM

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
Martin Jansa 2012-02-19 23:12:38 +01:00
parent 1772d999c2
commit 7f37409e0a
2 changed files with 137 additions and 1 deletions

View File

@ -0,0 +1,135 @@
From c7f54838d09cc94dd23ed060889bae780758c391 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Sun, 19 Feb 2012 23:09:07 +0100
Subject: [PATCH] Revert "Illume: Remove the popup. It's not needed now."
This reverts commit cba0bc9833689900930272fa5c4a2cd2529d3028.
---
src/modules/illume-indicator/e_mod_ind_win.c | 23 ++++++++++++++++++++---
src/modules/illume-indicator/e_mod_ind_win.h | 1 +
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/src/modules/illume-indicator/e_mod_ind_win.c b/src/modules/illume-indicator/e_mod_ind_win.c
index d3657d6..4a593fd 100644
--- a/src/modules/illume-indicator/e_mod_ind_win.c
+++ b/src/modules/illume-indicator/e_mod_ind_win.c
@@ -57,6 +57,11 @@ e_mod_ind_win_new(E_Zone *zone)
/* set this window to not accept or take focus */
ecore_x_icccm_hints_set(iwin->win->evas_win, 0, 0, 0, 0, 0, 0, 0);
+ /* create the popup */
+ iwin->popup = e_popup_new(zone, 0, 0, zone->w, h);
+ e_popup_name_set(iwin->popup, "indicator");
+ e_popup_layer_set(iwin->popup, 200);
+
/* create our event rectangle */
iwin->o_event = evas_object_rectangle_add(iwin->win->evas);
evas_object_color_set(iwin->o_event, 0, 0, 0, 0);
@@ -85,6 +90,8 @@ e_mod_ind_win_new(E_Zone *zone)
evas_object_move(iwin->o_base, 0, 0);
evas_object_show(iwin->o_base);
+ e_popup_edje_bg_object_set(iwin->popup, iwin->o_base);
+
/* create our gadget container */
iwin->gadcon = e_gadcon_swallowed_new("illume-indicator", zone->id,
iwin->o_base, "e.swallow.content");
@@ -133,12 +140,15 @@ e_mod_ind_win_new(E_Zone *zone)
/* set minimum size of this window & popup */
e_win_size_min_set(iwin->win, zone->w, h);
+ ecore_evas_size_min_set(iwin->popup->ecore_evas, zone->w, h);
/* position and resize this window */
e_win_move_resize(iwin->win, zone->x, zone->y, zone->w, h);
+ e_popup_move_resize(iwin->popup, zone->x, zone->y, zone->w, h);
/* show the window */
e_win_show(iwin->win);
+ e_popup_show(iwin->popup);
/* set this window on proper zone */
e_border_zone_set(iwin->win->border, zone);
@@ -188,6 +198,9 @@ _e_mod_ind_win_cb_free(Ind_Win *iwin)
/* tell conformant apps our position and size */
ecore_x_e_illume_indicator_geometry_set(iwin->zone->black_win, 0, 0, 0, 0);
+ if (iwin->popup) e_object_del(E_OBJECT(iwin->popup));
+ iwin->popup = NULL;
+
/* delete the window */
if (iwin->win) e_object_del(E_OBJECT(iwin->win));
iwin->win = NULL;
@@ -214,6 +227,7 @@ _e_mod_ind_win_cb_win_prop(void *data, int type __UNUSED__, void *event)
/* set minimum size of this window */
e_win_size_min_set(iwin->win, iwin->zone->w, h);
+ ecore_evas_size_min_set(iwin->popup->ecore_evas, iwin->zone->w, h);
/* NB: Not sure why, but we need to tell this border to fetch icccm
* size position hints now :( (NOTE: This was not needed a few days ago)
@@ -222,6 +236,7 @@ _e_mod_ind_win_cb_win_prop(void *data, int type __UNUSED__, void *event)
/* resize this window */
e_win_resize(iwin->win, iwin->zone->w, h);
+ e_popup_resize(iwin->popup, iwin->zone->w, h);
/* tell conformant apps our position and size */
ecore_x_e_illume_indicator_geometry_set(iwin->zone->black_win,
@@ -246,6 +261,7 @@ _e_mod_ind_win_cb_zone_resize(void *data, int type __UNUSED__, void *event)
/* set minimum size of this window to match zone size */
e_win_size_min_set(iwin->win, ev->zone->w, h);
+ ecore_evas_size_min_set(iwin->popup->ecore_evas, ev->zone->w, h);
return ECORE_CALLBACK_PASS_ON;
}
@@ -256,6 +272,7 @@ _e_mod_ind_win_cb_resize(E_Win *win)
Ind_Win *iwin;
if (!(iwin = win->data)) return;
+ if (iwin->popup) e_popup_resize(iwin->popup, win->w, win->h);
if (iwin->o_event) evas_object_resize(iwin->o_event, win->w, win->h);
if (iwin->o_base) evas_object_resize(iwin->o_base, win->w, win->h);
if (iwin->gadcon->o_container)
@@ -427,7 +444,7 @@ _e_mod_ind_win_cb_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj
bd->y = ny;
bd->changes.pos = 1;
bd->changed = 1;
- e_win_move(iwin->win, iwin->win->x, ny);
+ e_popup_move(iwin->popup, iwin->popup->x, ny);
}
}
}
@@ -553,7 +570,7 @@ _e_mod_ind_win_cb_border_hide(void *data, int type __UNUSED__, void *event)
if (!(iwin = data)) return ECORE_CALLBACK_PASS_ON;
ev = event;
if (ev->border != iwin->win->border) return ECORE_CALLBACK_PASS_ON;
- e_win_hide(iwin->win);
+ e_popup_hide(iwin->popup);
return ECORE_CALLBACK_PASS_ON;
}
@@ -566,6 +583,6 @@ _e_mod_ind_win_cb_border_show(void *data, int type __UNUSED__, void *event)
if (!(iwin = data)) return ECORE_CALLBACK_PASS_ON;
ev = event;
if (ev->border != iwin->win->border) return ECORE_CALLBACK_PASS_ON;
- e_win_show(iwin->win);
+ e_popup_show(iwin->popup);
return ECORE_CALLBACK_PASS_ON;
}
diff --git a/src/modules/illume-indicator/e_mod_ind_win.h b/src/modules/illume-indicator/e_mod_ind_win.h
index aa2dd1c..d41a861 100644
--- a/src/modules/illume-indicator/e_mod_ind_win.h
+++ b/src/modules/illume-indicator/e_mod_ind_win.h
@@ -14,6 +14,7 @@ struct _Ind_Win
Eina_List *hdls;
E_Win *win;
+ E_Popup *popup;
Evas_Object *o_base, *o_event;
E_Gadcon *gadcon;
E_Menu *menu;
--
1.7.8.4

View File

@ -4,7 +4,7 @@ LICENSE = "MIT BSD"
LIC_FILES_CHKSUM = "file://COPYING;md5=2667a0f4120372ea91f7467cdff4095f"
SRCNAME = "e"
PV = "0.16.999.060+svnr${SRCPV}"
PR = "r23"
PR = "r24"
SRCREV = "${EFL_SRCREV}"
inherit e update-alternatives gettext
@ -12,6 +12,7 @@ S = "${WORKDIR}/${SRCNAME}"
SRC_URI = "\
${E_SVN}/trunk;module=${SRCNAME};proto=http \
file://0001-Revert-Illume-Remove-the-popup.-It-s-not-needed-now.patch \
file://enlightenment_start.oe \
file://applications.menu \
"