From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: "Final" version of tty child frames Date: Mon, 06 Jan 2025 15:30:42 +0200 Message-ID: <86ttac5at9.fsf@gnu.org> References: <86wmi0g0x6.fsf@gnu.org> <11a86987cce9fe0a257c3fa58703dc33@finder.org> <86wmgl6jzv.fsf@gnu.org> <092cb755eee3a9b5e06d15c0b07e90b1@finder.org> <276414b03c24964aaeb9e43e8dba5e77@finder.org> <5fedec86bce470555814acbdf999f99d@finder.org> <86h6791khk.fsf@gnu.org> <09b0904da92efad899865b2ece5f3116@finder.org> <23dfc3fde8677a984b4c37a40d09d83b@finder.org> <86h66dagdg.fsf@gnu.org> <9c324c399a59d8e64cdc7072d2db0ae8@finder.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16659"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org, rudalics@gmx.at To: Jared Finder Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 06 14:31:37 2025 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tUnCj-0004AI-Ln for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Jan 2025 14:31:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUnC0-0002JZ-HA; Mon, 06 Jan 2025 08:30:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUnBv-0002IQ-Tw for emacs-devel@gnu.org; Mon, 06 Jan 2025 08:30:48 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUnBv-000073-58; Mon, 06 Jan 2025 08:30:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=5dCrw8t5zvLw4WOAMjGOloiT0xGQaXckA29KOASYU54=; b=P0wjU8mkeWoM VU/3NkLaGKep6CsF0LRhlJuFVup4efPhJ4Jyhui8s66jiEtfX8A4PI3/WwKwf19yP/sdMBbJldsfi Qcili0c0du31pjfc3r4XXs1tPneGHyYxWc5+AbIwRi7IskObrFA9cGMWuUxfq5hJe9/SbL9SOCp3N Nnum15t0zantwpundTP/rUcluTRfaofqbADkrHr5Arf6zeBIdAzEvSsblFr1OBtMrtWpfJOw8FTFI FKxBLi0U/ozPnru++J1F92VE2eFiet1B9EbeF5LIIotdWYUrSBxvFJHh/MGRpu4ca+Lg8JRK+ynL8 ieO2JKPs44XCjyfwpN5TQA==; In-Reply-To: <9c324c399a59d8e64cdc7072d2db0ae8@finder.org> (message from Jared Finder on Sun, 05 Jan 2025 16:05:59 -0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:327735 Archived-At: > Date: Sun, 05 Jan 2025 16:05:59 -0800 > From: Jared Finder > Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org, rudalics@gmx.at > > Style comments addressed, thank you! Someday, I will internalize Emacs' > unique C style conventions. Probably once I only code for Emacs and not > other projects. :) FTR, they are not Emacs conventions, they are GNU conventions. > > Does this mean child frames on xterm will have the selected-frame set > > to a child frame, and thus do not need this trick with > > last_mouse_frame? Or what other difference between xterm and the > > Linux console hides behind this "fallback"? > > This is just keeping the behavior that already exists today. I was > surprised by the current behavior: that term_mouse_position which only > works for a GPM enabled mouse gets called even when GPM could not be > used. It could make sense to change this behavior however it would be a > bigger change as gpm-mouse-mode is enabled by default even for non-GPM > supporting terminals. I suspect that GPM support is equivalent to > TERM=linux, but I may be wrong. > > This works when xterm-mouse-mode is enabled because mouse_position_hook > (set to term_mouse_position) is called first, followed by > mouse-position-function (set to xterm-mouse-position-function). On ttys > with xterm-mouse-mode enabled the return value from term_mouse_position > is ignored. See existing definitions in Fmouse_pixel_position and > mouse_position in frame.c. Maybe term_mouse_position should return immediately if GPM is not enabled? > >> +{ > >> + Lisp_Object frame = CALLN (Ffuncall, Qframe_at, > >> + make_fixnum (x), make_fixnum (y)); > > > > I'd refrain from calling into Lisp here: frame-at will call > > tty-frame-list-z-order, which is implemented in C, and the rest of > > frame-at can be trivially done in C. > > Would it make sense to delete the Lisp implementation of frame-at and > make it implemented in C only? Yes, I think so.