qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for-2.8] ui/gtk: fix "Copy" menu item segfault
Date: Thu, 15 Dec 2016 00:49:06 +0200	[thread overview]
Message-ID: <20161215004752-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20161214142518.10504-1-stefanha@redhat.com>

On Wed, Dec 14, 2016 at 02:25:18PM +0000, Stefan Hajnoczi wrote:
> 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>

I don't think it's 2.8 personally, patch just disables an
illegal action. Similar to the hotplug crash fix I
have queued. Just document this as a known issue.



BTW - any idea how to make paste work?



> ---
>  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

  parent reply	other threads:[~2016-12-14 22:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161215004752-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).