I give up. Your constant reverts and refusal to submit any sort of report
or do debugging make it impossible to improve this. It can stay slow and
blocking forever now.

On Thu, Aug 2, 2012 at 4:36 AM, Enlightenment SVN <
no-re...@enlightenment.org> wrote:

> Log:
> unfortuntely.. i have to revert the revert to my revert... as
>   xsettings is still broken immediately after login and stays broken
>   until u restart e. :(
>
>
>
> Author:       raster
> Date:         2012-08-01 20:36:51 -0700 (Wed, 01 Aug 2012)
> New Revision: 74772
> Trac:         http://trac.enlightenment.org/e/changeset/74772
>
> Modified:
>   trunk/e/src/bin/e_xsettings.c
>
> Modified: trunk/e/src/bin/e_xsettings.c
> ===================================================================
> --- trunk/e/src/bin/e_xsettings.c       2012-08-02 01:15:38 UTC (rev 74771)
> +++ trunk/e/src/bin/e_xsettings.c       2012-08-02 03:36:51 UTC (rev 74772)
> @@ -51,18 +51,18 @@
>  static Eio_File *eio_op = NULL;
>  static Eina_Bool setting = EINA_FALSE;
>  static Eina_Bool reset = EINA_FALSE;
> -static Ecore_Idle_Enterer *xsettings_idler = NULL;
> -static const char *_setting_icon_theme_name = NULL;
> -static const char *_setting_theme_name = NULL;
> -static const char *_setting_font_name = NULL;
> -static const char *_setting_xft_dpi = NULL;
> -static char *_setting_theme = NULL;
> +static const char _setting_icon_theme_name[] = "Net/IconThemeName";
> +static const char _setting_theme_name[]      = "Net/ThemeName";
> +static const char _setting_font_name[]       = "Gtk/FontName";
> +static const char _setting_xft_dpi[]         = "Xft/DPI";
> +static const char *_setting_theme = NULL;
> +
>  static void _e_xsettings_done_cb(void *data, Eio_File *handler, const
> Eina_Stat *stat);
>
>  static Ecore_X_Atom
>  _e_xsettings_atom_screen_get(int screen_num)
>  {
> -   char buf[64];
> +   char buf[32];
>     snprintf(buf, sizeof(buf), "_XSETTINGS_S%d", screen_num);
>     return ecore_x_atom_get(buf);
>  }
> @@ -128,6 +128,9 @@
>                                   ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
>                                   ecore_x_current_time_get(), atom,
>                                   sm->selection, 0, 0);
> +
> +   _e_xsettings_apply(sm);
> +
>     return 1;
>  }
>
> @@ -166,6 +169,9 @@
>     Eina_List *l;
>
>     if (!name) return;
> +   if (name == _setting_theme_name)
> +     e_config->xsettings.net_theme_name_detected = value;
> +   name = eina_stringshare_add(name);
>
>     EINA_LIST_FOREACH(settings, l, s)
>       {
> @@ -175,27 +181,29 @@
>     if (!value)
>       {
>          if (!s) return;
> -        DBG("remove %s", name);
> +        DBG("remove %s\n", name);
> +        eina_stringshare_del(name);
> +        eina_stringshare_del(s->name);
>          eina_stringshare_del(s->s.value);
>          settings = eina_list_remove(settings, s);
>          E_FREE(s);
> -        if (name == _setting_theme_name)
> -          e_config->xsettings.net_theme_name_detected = value;
>          return;
>       }
> -   if (!s)
> +   if (s)
>       {
> -        DBG("add %s %s", name, value);
> +        DBG("update %s %s\n", name, value);
> +        eina_stringshare_del(name);
> +        eina_stringshare_replace(&s->s.value, value);
> +     }
> +   else
> +     {
> +        DBG("add %s %s\n", name, value);
>          s = E_NEW(Setting, 1);
>          s->type = SETTING_TYPE_STRING;
>          s->name = name;
> +        s->s.value = eina_stringshare_add(value);
>          settings = eina_list_append(settings, s);
>       }
> -   else
> -     DBG("update %s %s", name, value);
> -   eina_stringshare_replace(&s->s.value, value);
> -   if (name == _setting_theme_name)
> -     e_config->xsettings.net_theme_name_detected = s->s.value;
>
>     /* type + pad + name-len + last-change-serial + str_len */
>     s->length = 12;
> @@ -212,6 +220,7 @@
>     Eina_List *l;
>
>     if (!name) return;
> +   name = eina_stringshare_add(name);
>
>     EINA_LIST_FOREACH(settings, l, s)
>       {
> @@ -222,6 +231,8 @@
>       {
>          if (!s) return;
>          DBG("remove %s\n", name);
> +        eina_stringshare_del(name);
> +        eina_stringshare_del(s->name);
>          settings = eina_list_remove(settings, s);
>          E_FREE(s);
>          return;
> @@ -229,6 +240,7 @@
>     if (s)
>       {
>          DBG("update %s %d\n", name, value);
> +        eina_stringshare_del(name);
>          s->i.value = value;
>       }
>     else
> @@ -405,7 +417,7 @@
>       }
>     eio_op = NULL;
>     setting = EINA_FALSE;
> -   E_FREE(_setting_theme);
> +   _setting_theme = NULL;
>
>     if (e_config->xsettings.net_theme_name)
>       {
> @@ -418,7 +430,7 @@
>  }
>
>  static void
> -_e_xsettings_done_cb(void *data __UNUSED__, Eio_File *handler __UNUSED__,
> const Eina_Stat *st __UNUSED__)
> +_e_xsettings_done_cb(void *data __UNUSED__, Eio_File *handler __UNUSED__,
> const Eina_Stat *stat __UNUSED__)
>  {
>     Eina_List *l;
>     Settings_Manager *sm;
> @@ -429,10 +441,9 @@
>          return;
>       }
>     _e_xsettings_string_set(_setting_theme_name, _setting_theme);
> -   E_FREE(_setting_theme);
> +   _setting_theme = NULL;
>     eio_op = NULL;
>     setting = EINA_FALSE;
> -   if (xsettings_idler) return;
>     EINA_LIST_FOREACH(managers, l, sm)
>       _e_xsettings_apply(sm);
>  }
> @@ -512,65 +523,23 @@
>  }
>  #endif
>
> -static Eina_Bool
> -_e_xsettings_idler_cb(void *d)
> -{
> -   static int type;
> -   double loop, frame;
> -
> -   if (d)
> -     {
> -        /* reset */
> -        type = 0;
> -        return ECORE_CALLBACK_RENEW;
> -     }
> -   frame = ecore_animator_frametime_get();
> -   loop = ecore_loop_time_get();
> -   for (; (type < 4) && (ecore_loop_time_get() - loop < frame); type++)
> -     {
> -        switch (type)
> -          {
> -             case 0:
> -               _e_xsettings_theme_set();
> -               break;
> -             case 1:
> -               _e_xsettings_icon_theme_set();
> -               break;
> -             case 2:
> -               _e_xsettings_font_set();
> -               break;
> -             case 3:
> -               _e_xsettings_update();
> -             default:
> -               break;
> -          }
> -     }
> -   if (type < 4) return ECORE_CALLBACK_RENEW;
> -   xsettings_idler = NULL;
> -   type = 0;
> -   return ECORE_CALLBACK_CANCEL;
> -}
> -
> -static Eina_Bool
> -_e_xsettings_idler_start(void *d __UNUSED__)
> -{
> -   if (xsettings_idler)
> -     _e_xsettings_idler_cb((void*)1);
> -   else
> -     xsettings_idler = ecore_idle_enterer_add(_e_xsettings_idler_cb,
> NULL);
> -   return ECORE_CALLBACK_CANCEL;
> -}
> -
>  static void
>  _e_xsettings_start(void)
>  {
>     Eina_List *l;
>     E_Manager *man;
> +
>     if (running) return;
> +
> +   _e_xsettings_theme_set();
> +   _e_xsettings_icon_theme_set();
> +   _e_xsettings_font_set();
> +
>     EINA_LIST_FOREACH(e_manager_list(), l, man)
>       {
>          Settings_Manager *sm = E_NEW(Settings_Manager, 1);
>          sm->man = man;
> +
>          if (!_e_xsettings_activate(sm))
>            _e_xsettings_retry(sm);
>
> @@ -578,8 +547,8 @@
>       }
>
>     handlers = eina_list_append(handlers,
> ecore_event_handler_add(E_EVENT_CONFIG_ICON_THEME,
> -
> _cb_icon_theme_change, NULL));
> -   ecore_timer_add(2, _e_xsettings_idler_start, NULL);
> +
> _cb_icon_theme_change, NULL));
> +
>     running = EINA_TRUE;
>  }
>
> @@ -604,6 +573,7 @@
>
>     EINA_LIST_FREE(settings, s)
>       {
> +        if (s->name) eina_stringshare_del(s->name);
>          if (s->s.value) eina_stringshare_del(s->s.value);
>          E_FREE(s);
>       }
> @@ -617,18 +587,12 @@
>  EINTERN int
>  e_xsettings_init(void)
>  {
> -
>     _atom_manager = ecore_x_atom_get("MANAGER");
>     _atom_xsettings = ecore_x_atom_get("_XSETTINGS_SETTINGS");
>
>     if (e_config->xsettings.enabled)
>       _e_xsettings_start();
>
> -   _setting_icon_theme_name = eina_stringshare_add("Net/IconThemeName");
> -   _setting_theme_name = eina_stringshare_add("Net/ThemeName");
> -   _setting_font_name = eina_stringshare_add("Gtk/FontName");
> -   _setting_xft_dpi = eina_stringshare_add("Xft/DPI");
> -
>     return 1;
>  }
>
> @@ -638,15 +602,8 @@
>     _e_xsettings_stop();
>     if (eio_op) eio_file_cancel(eio_op);
>     eio_op = NULL;
> -   if (xsettings_idler) ecore_idle_enterer_del(xsettings_idler);
> -   xsettings_idler = NULL;
> -   reset = setting = EINA_FALSE;
> +   setting = EINA_FALSE;
>
> -   eina_stringshare_replace(&_setting_icon_theme_name, NULL);
> -   eina_stringshare_replace(&_setting_theme_name, NULL);
> -   eina_stringshare_replace(&_setting_font_name, NULL);
> -   eina_stringshare_replace(&_setting_xft_dpi, NULL);
> -
>     return 1;
>  }
>
> @@ -662,10 +619,15 @@
>       }
>
>     if (!running)
> -     _e_xsettings_start();
> +     {
> +        _e_xsettings_start();
> +     }
>     else
>       {
> -        _e_xsettings_idler_start(NULL);
> +        _e_xsettings_theme_set();
> +        _e_xsettings_icon_theme_set();
> +        _e_xsettings_font_set();
> +        _e_xsettings_update();
>          reset = EINA_TRUE;
>       }
>  }
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> enlightenment-svn mailing list
> enlightenment-...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to