aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-03-13 12:02:52 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-03-13 12:02:52 -0400
commite895d00693b587459992529fd1277adb9f6cdae9 (patch)
tree13ab79f11f6368aece55c1695807e536fdf5fe7d /src/bin
parenttermio: reset size when size looks boggus. (diff)
downloadterminology-devs/discomfitor/focus.tar.gz
add behavior option to disable focus-in/out animations and visualsdevs/discomfitor/focus
this is useful for CI
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/config.c6
-rw-r--r--src/bin/config.h1
-rw-r--r--src/bin/options_behavior.c2
-rw-r--r--src/bin/termio.c3
-rw-r--r--src/bin/win.c38
5 files changed, 41 insertions, 9 deletions
diff --git a/src/bin/config.c b/src/bin/config.c
index 2ead19a..35a6e75 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -152,6 +152,9 @@ config_init(void)
(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
(edd_base, Config, "colors", colors, edd_color);
@@ -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);
diff --git a/src/bin/config.h b/src/bin/config.h
index db6db6e..2db6b25 100644
--- a/src/bin/config.h
+++ b/src/bin/config.h
@@ -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;
diff --git a/src/bin/options_behavior.c b/src/bin/options_behavior.c
index a44d3a0..e090485 100644
--- a/src/bin/options_behavior.c
+++ b/src/bin/options_behavior.c
@@ -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);
diff --git a/src/bin/termio.c b/src/bin/termio.c
index ff14490..e907498 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -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);
diff --git a/src/bin/win.c b/src/bin/win.c
index f169728..ba5078e 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -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);