NB: This commit for Tasn; getting systray to work with
authorChristopher Michael <cpmichael1@comcast.net>
Sat, 30 Oct 2010 19:05:48 +0000 (19:05 +0000)
committerChristopher Michael <cpmichael1@comcast.net>
Sat, 30 Oct 2010 19:05:48 +0000 (19:05 +0000)
illume-indicator ;)

Systray:
  - Do NOT assume we are drawing to the desktop if we are not a shelf;
rather, get the ecore_x_window of the gadget containers evas.

Illume-Indictor:
  - Use a popup window on the indicator window so that systray module
can work with illume-indicator.

Illume:
  - Add some traps in case e_border_name_get does not return something.

SVN revision: 54052

src/modules/illume-indicator/e_mod_ind_win.c
src/modules/illume-indicator/e_mod_ind_win.h
src/modules/illume2/e_illume.c
src/modules/illume2/policies/illume/policy.c
src/modules/systray/e_mod_main.c

index c3c964e..83483b1 100644 (file)
@@ -53,6 +53,12 @@ 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, 
+                             (il_ind_cfg->height * e_scale));
+   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);
@@ -81,6 +87,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");
@@ -115,15 +123,20 @@ e_mod_ind_win_new(E_Zone *zone)
                                               _e_mod_ind_win_cb_zone_resize, 
                                               iwin));
 
-   /* set minimum size of this window */
+   /* set minimum size of this window & popup */
    e_win_size_min_set(iwin->win, zone->w, (il_ind_cfg->height * e_scale));
+   ecore_evas_size_min_set(iwin->popup->ecore_evas, zone->w, 
+                           (il_ind_cfg->height * e_scale));
 
    /* position and resize this window */
    e_win_move_resize(iwin->win, zone->x, zone->y, zone->w, 
                      (il_ind_cfg->height * e_scale));
+   e_popup_move_resize(iwin->popup, zone->x, zone->y, zone->w, 
+                     (il_ind_cfg->height * e_scale));
 
    /* 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);
@@ -172,6 +185,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;
@@ -195,6 +211,8 @@ _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, (il_ind_cfg->height * e_scale));
+   ecore_evas_size_min_set(iwin->popup->ecore_evas, iwin->zone->w, 
+                           (il_ind_cfg->height * e_scale));
 
    /* 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) 
@@ -203,6 +221,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, (il_ind_cfg->height * e_scale));
+   e_popup_resize(iwin->popup, iwin->zone->w, (il_ind_cfg->height * e_scale));
 
    /* tell conformant apps our position and size */
    ecore_x_e_illume_indicator_geometry_set(iwin->zone->black_win, 
@@ -224,6 +243,8 @@ _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, (il_ind_cfg->height * e_scale));
+   ecore_evas_size_min_set(iwin->popup->ecore_evas, ev->zone->w, 
+                           (il_ind_cfg->height * e_scale));
 
    return ECORE_CALLBACK_PASS_ON;
 }
@@ -234,6 +255,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)
@@ -400,6 +422,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_popup_move(iwin->popup, iwin->popup->x, ny);
           }
      }
 }
index aa2dd1c..d41a861 100644 (file)
@@ -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;
index 50a2872..e8fb3f9 100644 (file)
@@ -97,9 +97,9 @@ e_illume_border_is_indicator(E_Border *bd)
      {
         const char *title;
 
-        title = e_border_name_get(bd);
-        if (!strcmp(title, _e_illume_cfg->policy.indicator.title))
-          return EINA_TRUE;
+        if ((title = e_border_name_get(bd)))
+          if (!strcmp(title, _e_illume_cfg->policy.indicator.title))
+            return EINA_TRUE;
      }
 
    /* return a fallback */
@@ -156,9 +156,9 @@ e_illume_border_is_softkey(E_Border *bd)
      {
         const char *title;
 
-        title = e_border_name_get(bd);
-        if (!strcmp(title, _e_illume_cfg->policy.softkey.title))
-          return EINA_TRUE;
+        if ((title = e_border_name_get(bd)))
+          if (!strcmp(title, _e_illume_cfg->policy.softkey.title))
+            return EINA_TRUE;
      }
 
    /* return a fallback */
@@ -214,9 +214,9 @@ e_illume_border_is_keyboard(E_Border *bd)
      {
         const char *title;
 
-        title = e_border_name_get(bd);
-        if (!strcmp(title, _e_illume_cfg->policy.vkbd.title))
-          return EINA_TRUE;
+        if ((title = e_border_name_get(bd)))
+          if (!strcmp(title, _e_illume_cfg->policy.vkbd.title))
+            return EINA_TRUE;
      }
 
    /* return a fallback */
@@ -268,9 +268,9 @@ e_illume_border_is_home(E_Border *bd)
      {
         const char *title;
 
-        title = e_border_name_get(bd);
-        if (!strcmp(title, _e_illume_cfg->policy.home.title))
-          return EINA_TRUE;
+        if ((title = e_border_name_get(bd)))
+          if (!strcmp(title, _e_illume_cfg->policy.home.title))
+            return EINA_TRUE;
      }
 
    /* return a fallback */
index 2b7d26f..2c0444e 100644 (file)
@@ -1266,10 +1266,10 @@ _policy_zone_layout(E_Zone *zone)
    Eina_List *l;
    E_Border *bd;
 
-//   printf("Zone Layout: %d\n", zone->id);
-
    if (!zone) return;
 
+//   printf("Zone Layout: %d\n", zone->id);
+
    /* get the config for this zone */
    cz = e_illume_zone_config_get(zone->id);
 
index f43f92f..d1934a0 100644 (file)
@@ -904,10 +904,12 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
        E_FREE(inst);
        return NULL;
      }
+
    if ((gc->shelf) && (gc->shelf->popup))
      inst->win.parent = gc->shelf->popup->evas_win;
    else
-     inst->win.parent = inst->con->bg_win;
+     inst->win.parent = (Ecore_X_Window) 
+       ecore_evas_window_get(ecore_evas_ecore_evas_get(gc->evas));
 
    inst->win.base = None;
    inst->win.selection = None;