all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "Leonardo Hernández Hernández" <leohdz172@proton.me>
Cc: 63614@debbugs.gnu.org
Subject: bug#63614: 29.0.91; PGTK Emacs crashes after clearing the clipboard
Date: Fri, 26 May 2023 08:33:52 +0800	[thread overview]
Message-ID: <875y8grkwf.fsf@yahoo.com> (raw)
In-Reply-To: <t6dini3qxhdeucn7cqxhcgwcoizebxlsmrptce36gwli6fqee7@j7ywdrv7cuzf> ("Leonardo Hernández Hernández"'s message of "Thu, 25 May 2023 20:27:18 +0000")

Leonardo Hernández Hernández <leohdz172@proton.me> writes:

> On Thu, May 25, 2023 at 04:35:56AM -0600, Po Lu wrote:
>> OK, thanks.  Does the crash still happen with this?
>> 
>> diff --git a/src/pgtkterm.c b/src/pgtkterm.c
>> index b8c626d81d8..bbe68f04adc 100644
>> --- a/src/pgtkterm.c
>> +++ b/src/pgtkterm.c
>> @@ -6606,8 +6606,7 @@ pgtk_selection_event (GtkWidget *widget, GdkEvent *event,
>> 
>>    if (event->type == GDK_PROPERTY_NOTIFY)
>>      pgtk_handle_property_notify (&event->property);
>> -  else if (event->type == GDK_SELECTION_CLEAR
>> -	   || event->type == GDK_SELECTION_REQUEST)
>> +  else if (event->type == GDK_SELECTION_REQUEST)
>>      {
>>        f = pgtk_find_selection_owner (event->selection.window);
>> 
>
> The crash does not happen when copying text from outside emacs,
> however it crashes when pasting text killed from emacs,
> for example, open `emacs -Q` kill some text and try to paste that
> text outside emacs (just run `wl-paste`)

What if you apply this change?

diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index b8c626d81d8..bfad949941b 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -376,11 +376,16 @@ mark_pgtkterm (void)
   for (i = 0; i < n; i++)
     {
       union buffered_input_event *ev = &evq->q[i];
-      mark_object (ev->ie.x);
-      mark_object (ev->ie.y);
-      mark_object (ev->ie.frame_or_window);
-      mark_object (ev->ie.arg);
-      mark_object (ev->ie.device);
+
+      if (ev->ie.type != SELECTION_CLEAR_EVENT
+	  && ev->ie.type != SELECTION_REQUEST_EVENT)
+	{
+	  mark_object (ev->ie.x);
+	  mark_object (ev->ie.y);
+	  mark_object (ev->ie.frame_or_window);
+	  mark_object (ev->ie.arg);
+	  mark_object (ev->ie.device);
+	}
     }
 
   for (dpyinfo = x_display_list; dpyinfo;





  reply	other threads:[~2023-05-26  0:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-20 18:52 bug#63614: 29.0.91; PGTK Emacs crashes after clearing the clipboard Leonardo Hernández via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-21  0:51 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-21  4:30   ` leohdz172--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-21  5:11     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-21  6:42       ` leohdz172--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-22  1:11 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-24  6:37   ` leohdz172--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-24  6:50     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-25  5:34       ` leohdz172--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-25  6:13         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-25  6:48 ` leohdz172--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-25 10:35   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-25 20:27     ` leohdz172--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-26  0:33       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-05-26  2:01         ` leohdz172--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-26  3:24           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-26  3:29             ` leohdz172--- via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=875y8grkwf.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=63614@debbugs.gnu.org \
    --cc=leohdz172@proton.me \
    --cc=luangruo@yahoo.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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.