Compare commits

...

2 Commits

Author SHA1 Message Date
Chidambar Zinnoury 0909d99f47 e: Continue the process according to the stopped state and not the setting. 6 years ago
Chidambar Zinnoury a99b10a6b6 e: Add signals priority support. 6 years ago
  1. 2
      src/bin/e_client.h
  2. 16
      src/bin/e_comp_x.c
  3. 15
      src/bin/e_int_client_menu.c

@ -703,6 +703,8 @@ struct E_Client
Eina_Bool keyboard_resizing : 1;
Eina_Bool on_post_updates : 1; // client is on the post update list
Eina_Bool signals_priority : 1; // send sigstop/sigcont on focus out/in instead of niceing
Eina_Bool stopped : 1; // if signals priority is enabled, and the client stopped
};
#define e_client_focus_policy_click(ec) \

@ -870,9 +870,16 @@ _e_comp_x_client_pri_raise(E_Client *ec)
{
if (ec->netwm.pid <= 0) return;
if (ec->netwm.pid == getpid()) return;
if (ec->stopped)
{
kill(ec->netwm.pid, SIGCONT);
ec->stopped = EINA_FALSE;
}
_pri_adj(ec->netwm.pid,
e_config->priority - 1, -1, EINA_FALSE,
// EINA_TRUE, EINA_TRUE);
// EINA_TRUE, EINA_TRUE);
EINA_TRUE, EINA_FALSE);
// printf("WIN: pid %i, title %s (HI!!!!!!!!!!!!!!!!!!)\n",
// ec->netwm.pid, e_client_util_name_get(ec));
@ -883,10 +890,17 @@ _e_comp_x_client_pri_norm(E_Client *ec)
{
if (ec->netwm.pid <= 0) return;
if (ec->netwm.pid == getpid()) return;
_pri_adj(ec->netwm.pid,
e_config->priority, 1, EINA_FALSE,
// EINA_TRUE, EINA_TRUE);
EINA_TRUE, EINA_FALSE);
if (ec->signals_priority)
{
kill(ec->netwm.pid, SIGSTOP);
ec->stopped = EINA_TRUE;
}
// printf("WIN: pid %i, title %s (NORMAL)\n",
// ec->netwm.pid, e_client_util_name_get(ec));
}

@ -51,6 +51,7 @@ static void _e_client_menu_cb_iconpref_netwm(void *data, E_Menu *m, E_Menu_Item
static void _e_client_menu_cb_iconpref_user(void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_client_menu_cb_default_icon(void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_client_menu_cb_netwm_icon(void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_client_menu_cb_signals_priority(void *data, E_Menu *m, E_Menu_Item *mi);
static Eina_List *menu_hooks = NULL;
@ -214,6 +215,12 @@ e_int_client_menu_create(E_Client *ec)
"e/widgets/border/default/borderless");
}
mi = e_menu_item_new(m);
e_menu_item_label_set(mi, _("Signals priority"));
e_menu_item_check_set(mi, 1);
e_menu_item_toggle_set(mi, ec->signals_priority ? 1 : 0);
e_menu_item_callback_set(mi, _e_client_menu_cb_signals_priority, ec);
if (e_comp_config_get()->enable_advanced_features)
{
E_Menu *subm;
@ -1498,6 +1505,14 @@ _e_client_menu_cb_netwm_icon(void *data, E_Menu *m, E_Menu_Item *mi)
}
}
static void
_e_client_menu_cb_signals_priority(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi)
{
E_Client *ec = data;
ec->signals_priority = mi->toggle;
}
static void
_e_client_menu_cb_border_pre(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi)
{

Loading…
Cancel
Save