summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2015-02-21 12:24:28 +0100
committerBoris Faure <billiob@gmail.com>2015-02-21 12:24:28 +0100
commitbe30c069f3c9a2b4b5423f7ee386c27212124000 (patch)
treeee1b87bd9a79f7919e11291a6bcadb194ff9539b /src
parent5d169ebd7186f8889a1de57b3c2cb4d9a2c4fc6c (diff)
close media popup on escape
Diffstat (limited to 'src')
-rw-r--r--src/bin/termio.c6
-rw-r--r--src/bin/win.c16
-rw-r--r--src/bin/win.h6
3 files changed, 27 insertions, 1 deletions
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 789c314..e4c5be5 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -1909,6 +1909,12 @@ _smart_cb_key_down(void *data, Evas *e EINA_UNUSED,
1909 if (miniview_handle_key(term_miniview_get(sd->term), ev)) 1909 if (miniview_handle_key(term_miniview_get(sd->term), ev))
1910 return; 1910 return;
1911 1911
1912 if (term_has_popmedia(sd->term) && !strcmp(ev->key, "Escape"))
1913 {
1914 term_popmedia_close(sd->term);
1915 return;
1916 }
1917
1912 1918
1913 if (keyin_handle(&sd->khdl, sd->pty, ev, ctrl, alt, shift, win)) 1919 if (keyin_handle(&sd->khdl, sd->pty, ev, ctrl, alt, shift, win))
1914 goto end; 1920 goto end;
diff --git a/src/bin/win.c b/src/bin/win.c
index 90b9c72..8cf19cc 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -1509,11 +1509,25 @@ _cb_popmedia_del(void *data, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED, vo
1509 edje_object_signal_emit(term->bg, "popmedia,off", "terminology"); 1509 edje_object_signal_emit(term->bg, "popmedia,off", "terminology");
1510} 1510}
1511 1511
1512Eina_Bool
1513term_has_popmedia(const Term *term)
1514{
1515 return !!term->popmedia;
1516}
1517
1518void
1519term_popmedia_close(Term *term)
1520{
1521 if (term->popmedia)
1522 edje_object_signal_emit(term->bg, "popmedia,off", "terminology");
1523}
1524
1525
1512static void 1526static void
1513_cb_popmedia_done(void *data, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, const char *src EINA_UNUSED) 1527_cb_popmedia_done(void *data, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, const char *src EINA_UNUSED)
1514{ 1528{
1515 Term *term = data; 1529 Term *term = data;
1516 1530
1517 if (term->popmedia || term->popmedia_deleted) 1531 if (term->popmedia || term->popmedia_deleted)
1518 { 1532 {
1519 if (term->popmedia) 1533 if (term->popmedia)
diff --git a/src/bin/win.h b/src/bin/win.h
index e4e4507..d25f542 100644
--- a/src/bin/win.h
+++ b/src/bin/win.h
@@ -48,4 +48,10 @@ void term_next(Term *term);
48void term_prev(Term *term); 48void term_prev(Term *term);
49Win * term_win_get(Term *term); 49Win * term_win_get(Term *term);
50 50
51
52Eina_Bool
53term_has_popmedia(const Term *term);
54void
55term_popmedia_close(Term *term);
56
51#endif 57#endif