From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#24372: 25.1.50; After losing focus, cursor is hidden when moving point Date: Fri, 09 Sep 2016 18:59:50 +0000 Message-ID: References: <83a8flaud3.fsf@gnu.org> <831t0t83br.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114b32ccda37e8053c17c064 X-Trace: blaine.gmane.org 1473447684 15690 195.159.176.226 (9 Sep 2016 19:01:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 9 Sep 2016 19:01:24 +0000 (UTC) Cc: 24372@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 09 21:01:21 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1biR35-00033n-8P for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Sep 2016 21:01:15 +0200 Original-Received: from localhost ([::1]:59759 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biR33-0007YB-B6 for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Sep 2016 15:01:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biR2v-0007Xz-S9 for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2016 15:01:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biR2s-00018Q-Lc for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2016 15:01:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biR2s-00018L-HT for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2016 15:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1biR2s-0006cO-9Y for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2016 15:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Sep 2016 19:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24372 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24372-submit@debbugs.gnu.org id=B24372.147344760925369 (code B ref 24372); Fri, 09 Sep 2016 19:01:02 +0000 Original-Received: (at 24372) by debbugs.gnu.org; 9 Sep 2016 19:00:09 +0000 Original-Received: from localhost ([127.0.0.1]:54885 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1biR20-0006b7-SY for submit@debbugs.gnu.org; Fri, 09 Sep 2016 15:00:09 -0400 Original-Received: from mail-wm0-f48.google.com ([74.125.82.48]:37617) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1biR1y-0006Zg-Ve for 24372@debbugs.gnu.org; Fri, 09 Sep 2016 15:00:07 -0400 Original-Received: by mail-wm0-f48.google.com with SMTP id w12so48925370wmf.0 for <24372@debbugs.gnu.org>; Fri, 09 Sep 2016 12:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jAYM+7VlqB21UIhWCE/BCsbctiaF2tV4R+5t3CnDUNU=; b=dBlhGkWzA/3gzkKLCrMHfGYoc6A5InLRO5Z8+4gXElUatIzbBxnQQjFmQQP6NxEGhf MCe1wL+UK9cUZV2MR4X+KNMHCiB3uI18TtLOWK3zSdlCMr4dHxJDbEV9vlaW2ZtqXLaY 8YXBuFC04EHOYRFfQ4mFC+YilRPAUPU2vD1FHorkwp9V6H8bRCQtSbThs/yNk5hmRvD9 9xaOUtMGLn+ynLYHWYYOGzEINVWzhZlgwvTB+oskEHQOBAoYibFatesSHM9LFnixZjVa VDvKNYqHPi9sxHNCOpun8izfEscrX96JwpCSfRDarMN/NElSx9PoxAvMQe5Io+SHaVJW CtMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jAYM+7VlqB21UIhWCE/BCsbctiaF2tV4R+5t3CnDUNU=; b=iFIbuqHsxY6VsTyKOMQXQbymBOhzhwZ5LsePYADx/wldT5qlj+CHKoptePKhZCuPOQ EyQVuY8cf9LLQq16KShJIxrmTyGZnweB08gIWa0iuVfShTi4oNl6JENDGWz6AQerrT9x kbml8IJWATPYr2YaGV40E77LOXKK2ECgF79YxpL6PklM1qmZTbMV3PO5I6O3/cnuJYnQ lA0BZMu0ai4GMPmf8XyfheBTl7V76jeS9Rw4un35H5FSHBHHxLWVkgwHvJLPxJxWRpAa GmxzqMMMBr23y1UFrLbGv8n6B3FkE3jKNprpxHXjDcC84ckeZf97CUQbHo7birVZt1c0 gCPw== X-Gm-Message-State: AE9vXwNOzMCg01c8EK3sP/++LKlCLkPt4hFdTpNs+BopdN8gINcQPfb8eZ+BunlDsPq+7TQ9Xe1ny3RqrtMuHQ== X-Received: by 10.28.153.70 with SMTP id b67mr4718113wme.84.1473447600992; Fri, 09 Sep 2016 12:00:00 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:123122 Archived-At: --001a114b32ccda37e8053c17c064 Content-Type: text/plain; charset=UTF-8 Philipp Stephani schrieb am Fr., 9. Sep. 2016 um 19:18 Uhr: > Philipp Stephani schrieb am Fr., 9. Sep. 2016 um > 18:29 Uhr: > > Philipp Stephani schrieb am Fr., 9. Sep. 2016 um > 18:20 Uhr: > > Eli Zaretskii schrieb am Fr., 9. Sep. 2016 um 18:07 Uhr: > > > From: Philipp Stephani > > Date: Fri, 09 Sep 2016 15:59:02 +0000 > > Cc: 24372@debbugs.gnu.org > > > > Eli Zaretskii schrieb am Di., 6. Sep. 2016 um 18:03 Uhr: > > > > > From: Philipp Stephani > > > Date: Mon, 05 Sep 2016 21:16:40 +0200 > > > > > > emacs -Q -eval '(setq blink-cursor-delay 0.0)' > > > > > > Move point around in the scratch buffer (e.g. press C-b a couple of > > > times): the cursor stays visible, as it should be. Then put the mouse > > > focus on a different GTK window (not Emacs window), put the mouse > focus > > > back on Emacs, and move point again: the cursor is hidden, making it > > > impossible to see until you stop moving. > > > > Does it happen even if you wait with cursor motion until after the > > cursor blinks one time, i.e. if you start moving point with the cursor > > already visible after Emacs gets focus? > > > > Yes. No matter what state the cursor is in and how often it has already > blinked, it becomes invisible when > > moving. > > So what is the importance of moving focus out of the Emacs frame and > then back into it? Is the problem reproducible without that? Or are > you saying that focus-out followed by focus-in event somehow changes > the behavior wrt displaying the cursor? > > > Yes. The cursor only become invisible after a focus-out/focus-in event. > This isn't surprising given that blink-cursor-mode changes focus-in-hook > and focus-out-hook. Probably the bug is hidden somewhere in the complex > interaction between the various blink-cursor timers and hooks. > > > A simpler recipe that doesn't need explicit focus events is > > emacs -Q -eval '(progn (setq blink-cursor-delay 0.0) > (blink-cursor-suspend) (blink-cursor-check))' > > and then start moving point. > > > OK, I guess one issue is that setting blink-cursor-delay doesn't restart > blink-cursor-idle-timer. (Similarly, changing blink-cursor-interval doesn't > restart blink-cursor-timer.) While obviously we can't fix that when using > setq, I'd suggest adding custom setters to the variables nevertheless. > > The direct cause of the issue seems to be that, when blink-cursor-delay is > idle, after every command blink-cursor-start is called immediately, which > hides the cursor. I guess that is so that in the default case where > blink-cursor-delay = blink-cursor-interval the cursor frequency is > constant. However, this causes the cursor to be hidden very quickly when > blink-cursor-delay < blink-cursor-interval. Maybe in that case > blink-cursor-start should show instead of hide the cursor, and > run-with-timer should be called with an argument of (blink-cursor-interval > - blink-cursor-delay), so that the cursor is at least shown for > blink-cursor-interval. WDYT? > I just realized that this is equivalent to treating blink-cursor-interval as a lower bound to blink-cursor-delay. Not sure whether that's the intention of blink-cursor-delay. --001a114b32ccda37e8053c17c064 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Philip= p Stephani <p.stephani2@gmail.c= om> schrieb am Fr., 9. Sep. 2016 um 19:18=C2=A0Uhr:
Philipp Stephan= i <p.stephani2@gmail.com> schrieb am Fr., 9. Sep. 2016 um 1= 8:29=C2=A0Uhr:
Philipp Stephani <p.s= tephani2@gmail.com> schrieb am Fr., 9. Sep. 2016 um 18:20=C2=A0Uhr:<= br class=3D"gmail_msg">
Eli Zaretskii <eliz@gnu.org> schrieb am= Fr., 9. Sep. 2016 um 18:07=C2=A0Uhr:
> From: Philipp Stephani <p.step= hani2@gmail.com>
> Date: Fri, 09 Sep 2016 15:59:02 +0000
> Cc: 24372@debbugs.gnu.org
>
> Eli Zaretskii <eliz@gnu.org> schrieb am Di., 6. Sep. 2016 um 18:0= 3 Uhr:
>
>=C2=A0 > From: Philipp Stephani <p.stephani2@gmail.com>= ;
>=C2=A0 > Date: Mon, 05 Sep 2016 21:16:40 +0200
>=C2=A0 >
>=C2=A0 > emacs -Q -eval '(setq blink-cursor-delay 0.0)'
>=C2=A0 >
>=C2=A0 > Move point around in the scratch buffer (e.g. press C-b a c= ouple of
>=C2=A0 > times): the cursor stays visible, as it should be. Then put= the mouse
>=C2=A0 > focus on a different GTK window (not Emacs window), put the= mouse focus
>=C2=A0 > back on Emacs, and move point again: the cursor is hidden, = making it
>=C2=A0 > impossible to see until you stop moving.
>
>=C2=A0 Does it happen even if you wait with cursor motion until after t= he
>=C2=A0 cursor blinks one time, i.e. if you start moving point with the = cursor
>=C2=A0 already visible after Emacs gets focus?
>
> Yes. No matter what state the cursor is in and how often it has alread= y blinked, it becomes invisible when
> moving.

So what is the importance of moving focus out of the Emacs frame and
then back into it?=C2=A0 Is the problem reproducible without that?=C2=A0 Or= are
you saying that focus-out followed by focus-in event somehow changes
the behavior wrt displaying the cursor?

Yes. The cursor only become invisible after a focus-out/fo= cus-in event.
This isn't surprising given= that blink-cursor-mode changes focus-in-hook and focus-out-hook. Probably = the bug is hidden somewhere in the complex interaction between the various = blink-cursor timers and hooks.=C2=A0

A simpler recipe that doesn't need explicit focus events is

emacs -Q -eval '(progn (setq blink-cursor-delay 0.0) (blink-curs= or-suspend) (blink-cursor-check))'=C2=A0
=
and then start movin= g point.

OK, I guess one is= sue is that setting blink-cursor-delay doesn't restart blink-cursor-idl= e-timer. (Similarly, changing blink-cursor-interval doesn't restart bli= nk-cursor-timer.) While obviously we can't fix that when using setq, I&= #39;d suggest adding custom setters to the variables nevertheless.

The direct cause of the issue seems to be that, when blink-cursor-delay i= s idle, after every command blink-cursor-start is called immediately, which= hides the cursor. I guess that is so that in the default case where blink-= cursor-delay =3D blink-cursor-interval the cursor frequency is constant. Ho= wever, this causes the cursor to be hidden very quickly when blink-cursor-d= elay < blink-cursor-interval. Maybe in that case blink-cursor-start shou= ld show instead of hide the cursor, and run-with-timer should be called wit= h an argument of (blink-cursor-interval - blink-cursor-delay), so that the = cursor is at least shown for blink-cursor-interval. WDYT?=C2=A0
=

I just realized that this is equival= ent to treating blink-cursor-interval as a lower bound to blink-cursor-dela= y. Not sure whether that's the intention of blink-cursor-delay.
--001a114b32ccda37e8053c17c064--