From: asjo@koldfront.dk (Adam Sjøgren)
To: emacs-devel@gnu.org
Cc: gtk-list@gnome.org
Subject: Re: Emacs --with-x-toolkit=gtk3 - iconify, move mouse over icon -> crash
Date: Wed, 12 Oct 2011 22:22:57 +0200 [thread overview]
Message-ID: <87zkh62c4e.fsf@topper.koldfront.dk> (raw)
In-Reply-To: 87obxmicsg.fsf@topper.koldfront.dk
On Wed, 12 Oct 2011 15:01:51 +0200, I wrote:
> When I compile emacs with gtk3 I get a crash if I iconify the Emacs
> window and move the mouse over the icon.
[...]
The attached trivial patch avoids the crash for me. I wonder if gtk3
should be catching those X errors as gtk2 seemed to, if Emacs should
handle them itself, or something else?
diff --git a/src/xterm.c b/src/xterm.c
index 4d3b572..c8b6771 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -93,6 +93,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef USE_GTK
#include "gtkutil.h"
+#ifdef HAVE_GTK3
+#include <X11/Xproto.h>
+#endif
#endif
#ifdef USE_LUCID
@@ -7848,6 +7851,13 @@ static void x_error_quitter (Display *, XErrorEvent *);
static int
x_error_handler (Display *display, XErrorEvent *event)
{
+#ifdef HAVE_GTK3
+ if (event->error_code == BadMatch && event->request_code == X_SetInputFocus && event->minor_code == 0) {
+ fprintf(stderr, "Ignoring XErrorEvent(BadMatch X_SetInputFocus) serial: %ul\n", event->serial);
+ return 0;
+ }
+#endif
+
if (x_error_message)
x_error_catcher (display, event);
else
Best regards,
Adam
--
"Gav Adam Sjøgren
Strik" asjo@koldfront.dk
next prev parent reply other threads:[~2011-10-12 20:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-12 13:01 Emacs --with-x-toolkit=gtk3 - iconify, move mouse over icon -> crash Adam Sjøgren
2011-10-12 20:22 ` Adam Sjøgren [this message]
2011-10-30 18:09 ` Jan Djärv
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zkh62c4e.fsf@topper.koldfront.dk \
--to=asjo@koldfront.dk \
--cc=emacs-devel@gnu.org \
--cc=gtk-list@gnome.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).