Commit 447f4a7f authored by Stepan Salenikovich's avatar Stepan Salenikovich Committed by Guillaume Roguez

gnome: do not play DTMF tones for certain MOD masks

eg: when pressing 'Ctrl+c'

Also, propogate the event in all cases so that
accelerators/shortcuts aren't stolen.

Refs #71632

Change-Id: I1e86b1009d396efd09896d7383d9511602bd4b83
parent 96ee9a05
......@@ -848,13 +848,22 @@ dtmf_pressed(RingMainWindow *win,
if (state != Call::LifeCycleState::PROGRESS)
return GDK_EVENT_PROPAGATE;
/* filter out cretain MOD masked key presses so that, for example, 'Ctrl+c'
* does not result in a 'c' being played.
* we filter Ctrl, Alt, and SUPER/HYPER/META keys */
if ( event->state
& ( GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_SUPER_MASK | GDK_HYPER_MASK | GDK_META_MASK ))
return GDK_EVENT_PROPAGATE;
/* pass the character that was entered to be played by the daemon;
* the daemon will filter out invalid DTMF characters */
guint32 unicode_val = gdk_keyval_to_unicode(event->keyval);
QString val = QString::fromUcs4(&unicode_val, 1);
call->playDTMF(val);
g_debug("attemptingto play DTMF tone during ongoing call: %s", val.toUtf8().constData());
return GDK_EVENT_STOP;
/* always propogate the key, so we don't steal accelerators/shortcuts */
return GDK_EVENT_PROPAGATE;
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment