add behavior option to disable focus-in/out animations and visuals

this is useful for CI
devs/discomfitor/focus
Mike Blumenkrantz 5 years ago
parent 566dc187d6
commit e895d00693
  1. 10
      data/themes/default.edc
  2. 6
      data/themes/mild.edc
  3. 6
      src/bin/config.c
  4. 1
      src/bin/config.h
  5. 2
      src/bin/options_behavior.c
  6. 3
      src/bin/termio.c
  7. 38
      src/bin/win.c

@ -1008,6 +1008,16 @@ collections {
target: "shine";
after: "focus_in2";
}
program {
signal: "focused,set"; source: "terminology";
action: STATE_SET "focused" 0.0;
target: "glint";
target: "shine";
sequence {
action: STATE_SET "focused2" 0.0;
target: "glow";
}
}
program { name: "focus_in2";
action: STATE_SET "focused2" 0.0;
transition: DECELERATE 0.5;

@ -86,6 +86,12 @@ collections {
transition: ACCELERATE 0.1;
target: "focusclip";
}
program {
signal: "focused,set";
source: "terminology";
action: STATE_SET "default" 0.0;
target: "focusclip";
}
program {
signal: "focus,out";
source: "terminology";

@ -151,6 +151,9 @@ config_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_base, Config, "mouse_over_focus",
mouse_over_focus, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_base, Config, "disable_focus_visuals",
disable_focus_visuals, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_base, Config, "colors_use", colors_use, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_ARRAY
@ -265,6 +268,7 @@ config_sync(const Config *config_src, Config *config)
config->colors_use = config_src->colors_use;
memcpy(config->colors, config_src->colors, sizeof(config->colors));
config->mouse_over_focus = config_src->mouse_over_focus;
config->disable_focus_visuals = config_src->disable_focus_visuals;
/* TODO: config->keys */
config->gravatar = config_src->gravatar;
config->notabs = config_src->notabs;
@ -512,6 +516,7 @@ config_new(void)
config->drag_links = EINA_FALSE;
config->login_shell = EINA_FALSE;
config->mouse_over_focus = EINA_TRUE;
config->disable_focus_visuals = EINA_FALSE;
config->colors_use = EINA_FALSE;
config->gravatar = EINA_TRUE;
config->notabs = EINA_FALSE;
@ -701,6 +706,7 @@ config_fork(Config *config)
CPY(colors_use);
memcpy(config2->colors, config->colors, sizeof(config->colors));
CPY(mouse_over_focus);
CPY(disable_focus_visuals);
CPY(temporary);
SCPY(config_key);
CPY(font_set);

@ -72,6 +72,7 @@ struct _Config
Eina_Bool drag_links;
Eina_Bool login_shell;
Eina_Bool mouse_over_focus;
Eina_Bool disable_focus_visuals;
Eina_Bool colors_use;
Eina_Bool gravatar;
Eina_Bool notabs;

@ -39,6 +39,7 @@ CB(erase_is_del, 0);
CB(drag_links, 0);
CB(login_shell, 0);
CB(mouse_over_focus, 0);
CB(disable_focus_visuals, 0);
CB(gravatar, 0);
CB(notabs, 1);
CB(mv_always_show, 0);
@ -199,6 +200,7 @@ options_behavior(Evas_Object *opbox, Evas_Object *term)
CX(_("Drag & drop links"), drag_links, 0);
CX(_("Start as login shell"), login_shell, 0);
CX(_("Focus split under the Mouse"), mouse_over_focus, 0);
CX(_("Disable focus-out visuals"), disable_focus_visuals, 0);
CX(_("Gravatar integration"), gravatar, 0);
CX(_("Show tabs"), notabs, 1);
CX(_("Always show miniview"), mv_always_show, 0);

@ -3518,7 +3518,8 @@ _smart_cb_focus_out(void *data,
Termio *sd = evas_object_smart_data_get(data);
EINA_SAFETY_ON_NULL_RETURN(sd);
edje_object_signal_emit(sd->cursor.obj, "focus,out", "terminology");
if (!sd->config->disable_focus_visuals)
edje_object_signal_emit(sd->cursor.obj, "focus,out", "terminology");
if (!sd->win) return;
sd->pty->selection.last_click = 0;
elm_win_keyboard_mode_set(sd->win, ELM_WIN_KEYBOARD_OFF);

@ -370,8 +370,11 @@ _solo_unfocus(Term_Container *tc, Term_Container *relative)
if (tc->parent != relative)
tc->parent->unfocus(tc->parent, tc);
edje_object_signal_emit(term->bg, "focus,out", "terminology");
edje_object_signal_emit(term->base, "focus,out", "terminology");
if (!term->config->disable_focus_visuals)
{
edje_object_signal_emit(term->bg, "focus,out", "terminology");
edje_object_signal_emit(term->base, "focus,out", "terminology");
}
if (!tc->wn->cmdbox_up)
elm_object_focus_set(term->termio, EINA_FALSE);
@ -402,8 +405,16 @@ _solo_focus(Term_Container *tc, Term_Container *relative)
tc->parent->focus(tc->parent, tc);
tc->is_focused = EINA_TRUE;
edje_object_signal_emit(term->bg, "focus,in", "terminology");
edje_object_signal_emit(term->base, "focus,in", "terminology");
if (term->config->disable_focus_visuals)
{
edje_object_signal_emit(term->bg, "focused,set", "terminology");
edje_object_signal_emit(term->base, "focused,set", "terminology");
}
else
{
edje_object_signal_emit(term->bg, "focus,in", "terminology");
edje_object_signal_emit(term->base, "focus,in", "terminology");
}
if (term->wn->cmdbox)
elm_object_focus_set(term->wn->cmdbox, EINA_FALSE);
elm_object_focus_set(term->termio, EINA_TRUE);
@ -498,8 +509,11 @@ _cb_win_focus_in(void *data,
{
if (term)
{
edje_object_signal_emit(term->bg, "focus,out", "terminology");
edje_object_signal_emit(term->base, "focus,out", "terminology");
if (!term->config->disable_focus_visuals)
{
edje_object_signal_emit(term->bg, "focus,out", "terminology");
edje_object_signal_emit(term->base, "focus,out", "terminology");
}
if (!wn->cmdbox_up)
elm_object_focus_set(term->termio, EINA_FALSE);
}
@ -4094,8 +4108,16 @@ _term_bg_config(Term *term)
DBG("is focused? tc:%p", term->container);
if (_term_is_focused(term) && (_win_is_focused(term->wn)))
{
edje_object_signal_emit(term->bg, "focus,in", "terminology");
edje_object_signal_emit(term->base, "focus,in", "terminology");
if (term->config->disable_focus_visuals)
{
edje_object_signal_emit(term->bg, "focused,set", "terminology");
edje_object_signal_emit(term->base, "focused,set", "terminology");
}
else
{
edje_object_signal_emit(term->bg, "focus,in", "terminology");
edje_object_signal_emit(term->base, "focus,in", "terminology");
}
if (term->wn->cmdbox)
elm_object_focus_set(term->wn->cmdbox, EINA_FALSE);
elm_object_focus_set(term->termio, EINA_TRUE);

Loading…
Cancel
Save