From mboxrd@z Thu Jan 1 00:00:00 1970 Path: quimby.gnus.org!not-for-mail From: Pavel@Janik.cz (Pavel =?iso-8859-2?q?Jan=EDk?=) Newsgroups: gmane.emacs.devel Subject: Re: PATCH: focus follows mouse in C Date: Sat, 09 Feb 2002 12:53:12 +0100 Message-ID: References: <200202071456.g17EujV04572@aztec.santafe.edu> <200202082324.g18NON305738@aztec.santafe.edu> <6480-Sat09Feb2002120145+0200-eliz@is.elta.co.il> NNTP-Posting-Host: quimby2.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit X-Trace: quimby2.netfonds.no 1013263411 12058 195.204.10.66 (9 Feb 2002 14:03:31 GMT) X-Complaints-To: usenet@quimby2.netfonds.no NNTP-Posting-Date: 9 Feb 2002 14:03:31 GMT Cc: rms@gnu.org, emacs-devel@gnu.org Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby2.netfonds.no with esmtp (Exim 3.12 #1 (Debian)) id 16ZY6E-00038N-00 for ; Sat, 09 Feb 2002 15:03:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.33 #1 (Debian)) id 16ZXxD-0005sA-00; Sat, 09 Feb 2002 08:54:11 -0500 Original-Received: from p0320.as-l043.contactel.cz ([194.108.243.66] helo=SnowWhite.SuSE.cz) by fencepost.gnu.org with smtp (Exim 3.33 #1 (Debian)) id 16ZXvT-0005lm-00; Sat, 09 Feb 2002 08:52:23 -0500 Original-Received: by SnowWhite.SuSE.cz (PJ, from userid 500) id 9D551441BF; Sat, 9 Feb 2002 14:54:44 +0100 (CET) Original-To: Eli Zaretskii Mail-Copies-To: never X-Face: $"d&^B_IKlTHX!y2d,3;grhwjOBqOli]LV`6d]58%5'x/kBd7.MO&n3bJ@Zkf&RfBu|^qL+ ?/Re{MpTqanXS2'~Qp'J2p^M7uM:zp[1Xq#{|C!*'&NvCC[9!|=>#qHqIhroq_S"MH8nSH+d^9*BF: iHiAs(t(~b#1.{w.d[=Z In-Reply-To: <6480-Sat09Feb2002120145+0200-eliz@is.elta.co.il> ("Eli Zaretskii"'s message of "Sat, 09 Feb 2002 12:01:46 +0200") User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2.50 (i386-suse-linux-gnu) Original-Lines: 88 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: quimby.gnus.org gmane.emacs.devel:917 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:917 From: "Eli Zaretskii" Date: Sat, 09 Feb 2002 12:01:46 +0200 > > Of course, because "focus follows mouse". > > That sounds like a misfeature to me: it's very easy to make small > mouse movements just by tapping on the table or on the keyboard. Some > users might become annoyed enough to not use the feature, just because > of this. > > How about if window reselection will only be done if the mouse is in a > window different from the one it was the last time, at least as a user > option? Yes, now I finally understand your and RMS' point. I agree and I think that it should default to behaviour described by you. I think that when I have two windows and point is in the bottom one and I do C-x o, small mouse movement (still in bottom window) should not (by default, but user should be able to change it) select the bottom window again. This should be it (module cus-start.el etc. changes): --- xterm.c.~1.703.~ Sun Jan 27 17:15:53 2002 +++ xterm.c Sat Feb 9 12:45:39 2002 @@ -253,6 +253,15 @@ static int any_help_event_p; +/* Non-zero means autoselect window with the mouse cursor. */ + +int x_autoselect_window_p; + +/* Non-zero means always autoselect window even if user switched to + the different window. */ + +int x_autoselect_always_p; + /* Non-zero means draw block and hollow cursor as wide as the glyph under it. For example, if a block cursor is over a tab, it will be drawn as wide as that tab on the display. */ @@ -6605,6 +6614,26 @@ last_mouse_motion_event = *event; XSETFRAME (last_mouse_motion_frame, frame); + if (x_autoselect_window_p) + { + int area; + Lisp_Object window; + static Lisp_Object last_window; + + window = window_from_coordinates (frame, XINT (event->x), XINT (event->y), &area, 0); + + /* Window will be selected only when it is not selected now and + last mouse movement event was not in it. Minubuffer window + will be selected iff it is active. */ + if ( (x_autoselect_always_p || !EQ (window, last_window)) + && !EQ (window, selected_window) + && (!MINI_WINDOW_P (XWINDOW (window)) + || (EQ (window, minibuf_window) && minibuf_level > 0))) + Fselect_window (window); + + last_window=window; + } + if (event->window != FRAME_X_WINDOW (frame)) { frame->mouse_moved = 1; @@ -15002,6 +15031,15 @@ previous_help_echo = Qnil; staticpro (&previous_help_echo); help_echo_pos = -1; + + DEFVAR_BOOL ("x-autoselect-window", &x_autoselect_window_p, + doc: /* *Non-nil means autoselect window with mouse pointer. */); + x_autoselect_window_p = 0; + + DEFVAR_BOOL ("x-autoselect-always", &x_autoselect_always_p, + doc: /* *Non-nil means always autoselect window with mouse pointer +even if user switched to different window. */); + x_autoselect_always_p = 0; DEFVAR_BOOL ("x-stretch-cursor", &x_stretch_cursor_p, doc: /* *Non-nil means draw block cursor as wide as the glyph under it. -- Pavel Janík panic("IRQ, you lose..."); -- 2.2.16 arch/mips/sgi/kernel/indy_int.c _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel