Continuing from the previous discussion on this topic, someone suggested
that the nice level for app execution should be configurable.

I've attached a patch that does this, so if there are no complaints,
I'll commit it soon.
Index: src/bin/e_config.c
===================================================================
--- src/bin/e_config.c	(revision 38905)
+++ src/bin/e_config.c	(working copy)
@@ -414,6 +414,7 @@
    E_CONFIG_VAL(D, T, border_shade_transition, INT); /**/
    E_CONFIG_VAL(D, T, border_shade_speed, DOUBLE); /**/
    E_CONFIG_VAL(D, T, framerate, DOUBLE); /**/
+   E_CONFIG_VAL(D, T, priority, INT); /**/
    E_CONFIG_VAL(D, T, image_cache, INT); /**/
    E_CONFIG_VAL(D, T, font_cache, INT); /**/
    E_CONFIG_VAL(D, T, edje_cache, INT); /**/
@@ -856,6 +857,10 @@
         COPYPTR(syscon.actions);
         IFCFGEND;
         
+        IFCFG(0x012d);
+        COPYVAL(priority);
+        IFCFGEND;
+        
         e_config->config_version = E_CONFIG_FILE_VERSION;   
         _e_config_free(tcfg);
      }
@@ -869,6 +874,7 @@
    E_CONFIG_LIMIT(e_config->border_shade_transition, 0, 3);
    E_CONFIG_LIMIT(e_config->border_shade_speed, 1.0, 20000.0);
    E_CONFIG_LIMIT(e_config->framerate, 1.0, 200.0);
+   E_CONFIG_LIMIT(e_config->priority, 0, 19);
    E_CONFIG_LIMIT(e_config->image_cache, 0, 256 * 1024);
    E_CONFIG_LIMIT(e_config->font_cache, 0, 32 * 1024);
    E_CONFIG_LIMIT(e_config->edje_cache, 0, 256);
Index: src/bin/e_config.h
===================================================================
--- src/bin/e_config.h	(revision 38905)
+++ src/bin/e_config.h	(working copy)
@@ -34,7 +34,7 @@
 /* increment this whenever a new set of config values are added but the users
  * config doesn't need to be wiped - simply new values need to be put in
  */
-#define E_CONFIG_FILE_GENERATION 0x012c
+#define E_CONFIG_FILE_GENERATION 0x012d
 #define E_CONFIG_FILE_VERSION    ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION)
 
 #define E_EVAS_ENGINE_DEFAULT         0
@@ -72,6 +72,7 @@
    int         border_shade_transition; // GUI
    double      border_shade_speed; // GUI
    double      framerate; // GUI
+   int         priority; // GUI
    int         image_cache; // GUI
    int         font_cache; // GUI
    int         edje_cache; // GUI
Index: src/bin/e_main.c
===================================================================
--- src/bin/e_main.c	(revision 38905)
+++ src/bin/e_main.c	(working copy)
@@ -576,8 +576,8 @@
 
    locked |= e_config->desklock_start_locked;
 
-   /* set all execced stuff to pri 1 - nice. make this config later? */
-   ecore_exe_run_priority_set(1);
+   /* set all execced stuff to configured priority */
+   ecore_exe_run_priority_set(e_config->priority);
    
    TS("scale");
    /* init config system */
Index: src/modules/conf_performance/e_int_config_performance.c
===================================================================
--- src/modules/conf_performance/e_int_config_performance.c	(revision 38905)
+++ src/modules/conf_performance/e_int_config_performance.c	(working copy)
@@ -10,6 +10,7 @@
 struct _E_Config_Dialog_Data 
 {
    double framerate;
+   int priority;
 
    /* Advanced */   
    int cache_flush_poll_interval;
@@ -46,6 +47,7 @@
 _fill_data(E_Config_Dialog_Data *cfdata) 
 {
    cfdata->framerate = e_config->framerate;
+   cfdata->priority = e_config->priority;
    cfdata->font_cache = ((double)e_config->font_cache / 1024);
    cfdata->image_cache = ((double)e_config->image_cache / 1024);
    cfdata->edje_cache = e_config->edje_cache;
@@ -75,6 +77,8 @@
    if (cfdata->framerate <= 0.0) cfdata->framerate = 1.0;
    e_config->framerate = cfdata->framerate;
    edje_frametime_set(1.0 / e_config->framerate);
+   e_config->priority = cfdata->priority;
+   ecore_exe_run_priority_set(e_config->priority);
    e_canvas_recache();
    e_config_save_queue();
    return 1;
@@ -93,6 +97,11 @@
    ob = e_widget_slider_add(evas, 1, 0, _("%1.0f fps"), 5.0, 200.0, 5.0, 0, &(cfdata->framerate), NULL, 150);
    e_widget_framelist_object_append(of, ob);
 
+   ob = e_widget_label_add(evas, _("Application Priority"));
+   e_widget_framelist_object_append(of, ob);   
+   ob = e_widget_slider_add(evas, 1, 0, "%1.0f", 0, 19, 1, 0, NULL, &(cfdata->priority), 150);
+   e_widget_framelist_object_append(of, ob);
+
    e_widget_list_object_append(o, of, 1, 1, 0.5);   
    return o;
 }
@@ -108,6 +117,8 @@
    e_config->edje_cache = cfdata->edje_cache;
    e_config->edje_collection_cache = cfdata->edje_collection_cache;
    edje_frametime_set(1.0 / e_config->framerate);
+   e_config->priority = cfdata->priority;
+   ecore_exe_run_priority_set(e_config->priority);
    e_canvas_recache();
    e_config_save_queue();
    return 1;
@@ -125,6 +136,11 @@
    e_widget_framelist_object_append(of, ob);   
    ob = e_widget_slider_add(evas, 1, 0, _("%1.0f fps"), 5.0, 240.0, 1.0, 0, &(cfdata->framerate), NULL, 150);
    e_widget_framelist_object_append(of, ob);
+
+   ob = e_widget_label_add(evas, _("Application Priority"));
+   e_widget_framelist_object_append(of, ob);   
+   ob = e_widget_slider_add(evas, 1, 0, "%1.0f", 0, 19, 1, 0, NULL, &(cfdata->priority), 150);
+   e_widget_framelist_object_append(of, ob);
    e_widget_list_object_append(o, of, 1, 1, 0.5);   
 
    of = e_widget_framelist_add(evas, _("Cache Settings"), 0);   
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to