forked from enlightenment/enlightenment
set default priority (nice val) of apps to 3, and introduce priority
raising of focused app. :) SVN revision: 60941
This commit is contained in:
parent
836701c1e6
commit
cbd40a06ba
|
@ -10,7 +10,7 @@ group "E_Config" struct {
|
|||
value "border_shade_transition" int: 3;
|
||||
value "border_shade_speed" double: 3000.0000000000000000000000000;
|
||||
value "framerate" double: 60.0000000000000000000000000;
|
||||
value "priority" int: 1;
|
||||
value "priority" int: 3;
|
||||
value "image_cache" int: 4096;
|
||||
value "font_cache" int: 512;
|
||||
value "edje_cache" int: 10;
|
||||
|
|
|
@ -10,7 +10,7 @@ group "E_Config" struct {
|
|||
value "border_shade_transition" int: 1;
|
||||
value "border_shade_speed" double: 1800.0000000000000000000000000;
|
||||
value "framerate" double: 60.0000000000000000000000000;
|
||||
value "priority" int: 1;
|
||||
value "priority" int: 3;
|
||||
value "image_cache" int: 4096;
|
||||
value "font_cache" int: 512;
|
||||
value "edje_cache" int: 32;
|
||||
|
|
|
@ -10,7 +10,7 @@ group "E_Config" struct {
|
|||
value "border_shade_transition" int: 3;
|
||||
value "border_shade_speed" double: 3000.0000000000000000000000000;
|
||||
value "framerate" double: 60.0000000000000000000000000;
|
||||
value "priority" int: 1;
|
||||
value "priority" int: 3;
|
||||
value "image_cache" int: 4096;
|
||||
value "font_cache" int: 512;
|
||||
value "edje_cache" int: 32;
|
||||
|
|
|
@ -59,6 +59,8 @@ void *alloca (size_t);
|
|||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <inttypes.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#ifdef HAVE_GETTEXT
|
||||
# include <libintl.h>
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
#define RESIZE_NONE 11
|
||||
|
||||
/* local subsystem functions */
|
||||
static void _e_border_pri_raise(E_Border *bd);
|
||||
static void _e_border_pri_norm(E_Border *bd);
|
||||
static void _e_border_free(E_Border *bd);
|
||||
static void _e_border_del(E_Border *bd);
|
||||
|
||||
|
@ -974,6 +976,40 @@ e_border_hide(E_Border *bd,
|
|||
bd->post_show = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_border_pri_raise(E_Border *bd)
|
||||
{
|
||||
if (bd->client.netwm.pid > 0)
|
||||
{
|
||||
int newpri;
|
||||
|
||||
// newpri = getpriority(PRIO_PROCESS, bd->client.netwm.pid) - 1;
|
||||
newpri = e_config->priority - 1;
|
||||
setpriority(PRIO_PROCESS, bd->client.netwm.pid, newpri);
|
||||
printf("WIN: pid %i, title %s TO: %i (HI!!!)\n",
|
||||
bd->client.netwm.pid,
|
||||
e_border_name_get(bd),
|
||||
newpri);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_border_pri_norm(E_Border *bd)
|
||||
{
|
||||
if (bd->client.netwm.pid > 0)
|
||||
{
|
||||
int newpri;
|
||||
|
||||
// newpri = getpriority(PRIO_PROCESS, bd->client.netwm.pid) + 1;
|
||||
newpri = e_config->priority;
|
||||
setpriority(PRIO_PROCESS, bd->client.netwm.pid, newpri);
|
||||
printf("WIN: pid %i, title %s TO: %i\n",
|
||||
bd->client.netwm.pid,
|
||||
e_border_name_get(bd),
|
||||
newpri);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_border_frame_replace(E_Border *bd, Eina_Bool argb)
|
||||
{
|
||||
|
@ -5206,6 +5242,7 @@ _e_border_cb_window_focus_in(void *data __UNUSED__,
|
|||
bd->client.icccm.take_focus);
|
||||
}
|
||||
#endif
|
||||
_e_border_pri_raise(bd);
|
||||
if (e->mode == ECORE_X_EVENT_MODE_GRAB)
|
||||
{
|
||||
if (e->detail == ECORE_X_EVENT_DETAIL_POINTER) return ECORE_CALLBACK_PASS_ON;
|
||||
|
@ -5273,6 +5310,7 @@ _e_border_cb_window_focus_out(void *data __UNUSED__,
|
|||
bd->client.icccm.take_focus);
|
||||
}
|
||||
#endif
|
||||
_e_border_pri_norm(bd);
|
||||
if (e->mode == ECORE_X_EVENT_MODE_NORMAL)
|
||||
{
|
||||
if (e->detail == ECORE_X_EVENT_DETAIL_INFERIOR) return ECORE_CALLBACK_PASS_ON;
|
||||
|
|
Loading…
Reference in New Issue