ui/gtk: fix "Copy" menu item segfault
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 14 Dec 2016 14:25:18 +0000 (14:25 +0000)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 14 Dec 2016 18:46:21 +0000 (18:46 +0000)
commita08156321ab9a7d2fed9ee77dbfeea2a61ffd153
treeedbafb2f624cb548326ab4fe92c36f93b5d35ac3
parent3753c75db8eaa40d1bfbfdf7b26e9defc1d785e5
ui/gtk: fix "Copy" menu item segfault

The "Copy" menu item copies VTE terminal text to the clipboard.  This
only works with VTE terminals, not with graphics consoles.

Disable the menu item when the current notebook page isn't a VTE
terminal.

This patch fixes a segfault.  Reproducer: Start QEMU and click the Copy
menu item when the guest display is visible.

Reported-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20161214142518.10504-1-stefanha@redhat.com
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
ui/gtk.c