From 0909d99f47f49dda9313ea58454c0d507c914064 Mon Sep 17 00:00:00 2001 From: Chidambar Zinnoury Date: Sat, 23 Jul 2016 10:14:02 +0200 Subject: e: Continue the process according to the stopped state and not the setting. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The user may change the client’s signals priority setting while it is stopped, which would not restart it. We may as well also always change the actual priority. --- src/bin/e_client.h | 1 + src/bin/e_comp_x.c | 30 ++++++++++++++---------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/bin/e_client.h b/src/bin/e_client.h index 41f68464e6..5849d8eabb 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.h @@ -704,6 +704,7 @@ struct E_Client 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) \ diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c index bac3da30fb..144cae45bd 100644 --- a/src/bin/e_comp_x.c +++ b/src/bin/e_comp_x.c @@ -871,17 +871,16 @@ _e_comp_x_client_pri_raise(E_Client *ec) if (ec->netwm.pid <= 0) return; if (ec->netwm.pid == getpid()) return; - if (!ec->signals_priority) - { - _pri_adj(ec->netwm.pid, - e_config->priority - 1, -1, EINA_FALSE, -// EINA_TRUE, EINA_TRUE); - EINA_TRUE, EINA_FALSE); - } - else + 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_FALSE); // printf("WIN: pid %i, title %s (HI!!!!!!!!!!!!!!!!!!)\n", // ec->netwm.pid, e_client_util_name_get(ec)); } @@ -892,16 +891,15 @@ _e_comp_x_client_pri_norm(E_Client *ec) if (ec->netwm.pid <= 0) return; if (ec->netwm.pid == getpid()) return; - if (!ec->signals_priority) - { - _pri_adj(ec->netwm.pid, - e_config->priority, 1, EINA_FALSE, -// EINA_TRUE, EINA_TRUE); - EINA_TRUE, EINA_FALSE); - } - else + _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)); -- cgit v1.2.1