GNU bug report logs - #19547
25.0.50; throw-on-input "fires" when switching workspace

Previous Next

Package: emacs;

Reported by: michael_heerdegen <at> web.de

Date: Fri, 9 Jan 2015 15:48:02 UTC

Severity: normal

Tags: fixed

Found in version 25.0.50

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


Message #131 received at 19547 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
Cc: rrt <at> sc3d.org, 19547 <at> debbugs.gnu.org, npostavs <at> users.sourceforge.net
Subject: Re: bug#19547: Patch for this bug
Date: Sun, 27 Nov 2016 17:54:58 +0200
> From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 19547 <at> debbugs.gnu.org, rrt <at> sc3d.org
> Date: Sun, 27 Nov 2016 15:53:58 +0100
> 
> 
> npostavs <at> users.sourceforge.net writes:
> 
> > Thierry Volpiatto <thierry.volpiatto <at> gmail.com> writes:
> >>  
> >> +  Lisp_Object ignore_event;
> >> +
> >> +  switch (event->kind)
> >> +    {
> >> +    case FOCUS_IN_EVENT: ignore_event = Qfocus_in;
> >> +    case FOCUS_OUT_EVENT: ignore_event = Qfocus_out;
> >> +    case HELP_EVENT: ignore_event = Qhelp;
> >> +    case ICONIFY_EVENT: ignore_event = Qiconify;
> >> +    case DEICONIFY_EVENT: ignore_event = Qdeiconify;
> >> +    case SELECTION_REQUEST_EVENT: ignore_event = Qselection_request;
> >
> > You need a break at the end of each case, otherwise all events would be
> > treated as SELECTION_REQUEST_EVENT.
> >
> >     case FOCUS_IN_EVENT: ignore_event = Qfocus_in; break;
> 
> You answer exactly at what I was wondering about, is break needed or not?

In addition to using 'break', you need to initialize ignore_event with
some value, otherwise it will hold garbage, which could accidentally
be one of the values you want to filter.  Alternatively, add a
'default' case to the switch.

> >> +  Vwhile_no_input_ignore_events = Qnil;
> >> +    /* = listn (Qfocus_in, Qfocus_out, Qhelp, Qiconify, Qdeiconify, Qselection_request); */
> >
> > I think something like this should work:
> >
> >     listn (CONSTYPE_PURE, 6, Qfocus_in, Qfocus_out, Qhelp, Qiconify, Qdeiconify, Qselection_request);
> 
> Same here, I had to use Qnil because I always had errors when trying to
> feed this variable here, I will try tonight if that works.

I'd suggest to use Flist instead, it should be closer to Lisp (if you
want to do this from C).

> I wondered also if instead the variable could be feeded from lisp as
> suggested by Eli, but I don't know yet where is the good place for this
> and how.

Something like simple.el should be fine.

Thanks.




This bug report was last modified 8 years and 43 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.