All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.8] ui/gtk: fix "Copy" menu item segfault
@ 2016-12-14 14:25 Stefan Hajnoczi
  2016-12-14 14:35 ` Stefan Weil
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2016-12-14 14:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Michael S. Tsirkin, Gerd Hoffmann, Stefan Hajnoczi

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>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 ui/gtk.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Gerd, Michael: if you post Reviewed-by I can merge this directly without
requiring you to send a pull request.  It's a user interface segfault so it
would be nice to resolve it in QEMU 2.8.

diff --git a/ui/gtk.c b/ui/gtk.c
index e816428..a216216 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1581,6 +1581,9 @@ static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2,
                                        TRUE);
     }
     gtk_widget_set_sensitive(s->grab_item, on_vga);
+#ifdef CONFIG_VTE
+    gtk_widget_set_sensitive(s->copy_item, vc->type == GD_VC_VTE);
+#endif
 
     gd_update_windowsize(vc);
     gd_update_cursor(vc);
@@ -2246,6 +2249,11 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
     }
 #endif
 
+#ifdef CONFIG_VTE
+    gtk_widget_set_sensitive(s->copy_item,
+                             gd_vc_find_current(s)->type == GD_VC_VTE);
+#endif
+
     if (full_screen) {
         gtk_menu_item_activate(GTK_MENU_ITEM(s->full_screen_item));
     }
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2016-12-16  9:49 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-14 14:25 [Qemu-devel] [PATCH for-2.8] ui/gtk: fix "Copy" menu item segfault Stefan Hajnoczi
2016-12-14 14:35 ` Stefan Weil
2016-12-14 15:15 ` Gerd Hoffmann
2016-12-14 22:49 ` Michael S. Tsirkin
2016-12-15  7:34   ` Stefan Hajnoczi
2016-12-15  7:48   ` Stefan Hajnoczi
2016-12-15  8:47   ` Kevin Wolf
2016-12-15  9:50     ` Stefan Hajnoczi
2016-12-15  4:35 ` [Qemu-devel] regression in 2.8: unable to exit screen grab in SDL mode Michael S. Tsirkin
2016-12-15  7:50   ` Stefan Hajnoczi
2016-12-15  9:17     ` Gerd Hoffmann
2016-12-15 14:55       ` Michael S. Tsirkin
2016-12-15 16:17         ` Gerd Hoffmann
2016-12-15 15:07       ` Michael S. Tsirkin
2016-12-15 16:25         ` Gerd Hoffmann
2016-12-15 19:15           ` Michael S. Tsirkin
2016-12-15 19:19             ` Michael S. Tsirkin
2016-12-16  8:26               ` Thomas Huth
2016-12-16  8:45                 ` Liviu Ionescu
2016-12-16  9:00                 ` Kevin Wolf
2016-12-16  9:21                   ` Howard Spoelstra
2016-12-16  9:48               ` Gerd Hoffmann
2016-12-15 22:30           ` Michael S. Tsirkin
2016-12-16  9:27             ` Kevin Wolf
2016-12-16  9:36             ` Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.