Interesting. I did not know about view-lossage.
<f1> c C-g just briefly displays "Quit" and exits minibuffer. When running "emacs -nw -Q" from a terminal, the same key is described correctly as keyboard-quit.
After trying to exit C-x C-f with C-g, nothing shows up in view-lossage. When I hold C-g for a couple of seconds, focus goes back to the buffer as expected and "C-g [abort-recursive-edit]" shows up in view-lossage.
When hitting C-g while inside a buffer, view-lossage displays "C-g [keyboard-quit]" correctly, though, which I would not expect if Ubuntu kept Emacs from receiving keyboard events correctly.