From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#73838: 31.0.50; Problems in note_mouse_highlight if -nw Date: Wed, 16 Oct 2024 18:56:53 +0200 Message-ID: References: <86r08goy76.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36238"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 73838@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 16 18:59:06 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1t17MY-0009Gw-25 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 16 Oct 2024 18:59:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t17MD-0001ug-9U; Wed, 16 Oct 2024 12:58:45 -0400 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 1t17MA-0001uV-V8 for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2024 12:58:42 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t17MA-0002SN-MS for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2024 12:58:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=VqRpE1v34ytnev/ho/LqLPJMg/oF8B8x4Q64cuNGMHU=; b=BUakUVP0tVJyCihW4DVdJwUfD+uf9CVAq0IuJXhoQTFWq5LEOdPLYwFSQx09rUP1YCJOvIScU685nMBrP5Z3ZMSojC5DEEDG0FSiWO5vO+K1dXK8/EKT6zrikGaatYB5bekCidt1tDrf6vglehS7mkYuh5hcYXFiLg8Foy+0RWdjQlgwurOQc5ez2T25XdefmVDIxJlBxLH6msYM+hW9WQ+3Vy1Mr7/b3UziLpqpxokClEkT1/QLaG9StTdZPnkWvvv9l0H4Y9dsajNDmG5PSxD7EyQADC6rGu4MZeFg7ACbGhGVkiaQ7iS5NlBSNKpapfbPTriSYowyQGCMTQ8BHg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t17MU-0002Ui-Do for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2024 12:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 16 Oct 2024 16:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73838 X-GNU-PR-Package: emacs Original-Received: via spool by 73838-submit@debbugs.gnu.org id=B73838.17290978989528 (code B ref 73838); Wed, 16 Oct 2024 16:59:02 +0000 Original-Received: (at 73838) by debbugs.gnu.org; 16 Oct 2024 16:58:18 +0000 Original-Received: from localhost ([127.0.0.1]:60258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t17Ll-0002Tc-FA for submit@debbugs.gnu.org; Wed, 16 Oct 2024 12:58:17 -0400 Original-Received: from mail-wm1-f52.google.com ([209.85.128.52]:60516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t17Lj-0002TU-Fr for 73838@debbugs.gnu.org; Wed, 16 Oct 2024 12:58:16 -0400 Original-Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4314735bca2so600095e9.0 for <73838@debbugs.gnu.org>; Wed, 16 Oct 2024 09:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729097814; x=1729702614; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VqRpE1v34ytnev/ho/LqLPJMg/oF8B8x4Q64cuNGMHU=; b=NDepV5rMky+5YyjongCV+jvo3RzS3lxcvbgcyxH5ucsTShJgO67F8e62EzwcmwAJS2 kFKbBUYXcxggrs93VRjnJuO3L3zjSVRhsBx3wDhXZJCm5+Z2wa5+VIgo/nRmDyDAE0Od DdpdaLJpv0K/LIE4BNQURUHWxFpIIoCfar++v3WD2kdL9TCkd+pMMgV/KXR1YYoOwnG7 AbeER+ICHa0w1oJDvYHudyFC/sE1DXhsj3bbQDcKJElFnah9YhxhAXODOXvbVBQ3otmc YCysYlQb0bqDuo/SkNnup1JeRAYO+hxTmrCGCCvyNW++Iu1TL+AulCmAeYofXxa5oNG0 2/Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729097814; x=1729702614; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=VqRpE1v34ytnev/ho/LqLPJMg/oF8B8x4Q64cuNGMHU=; b=oB4BgfyYyNJh6uOE3a+cywoFBGBONuwYjI914kqAGHPeu6ZpqlsQQIRO+kbYuEEdTK yqlOpj2Hwwm7z6NLVG5LSvhejOXSUMobDDPkExuF1JyrpdsFdwUGcgnFoKwADEKeAE+2 F8+0JG81n1OB1VHM3/aVQ4VbO4yA6WtoFeYcXJS/y+neHujv7qTrhrNHNaLjvITYx9Nm CiGvq0JcxiFgozFGmLwVomNNDpH+744e+yq6Ffu1rAEr7HMocJ5rPypzd3/5x6FLtqXl 80Tbtg3Ay1Mkhltje+CwcKFcuuSBpTq9QRcjx3wlN4kXtrTS2aNN47QA1rvFzJMAfvXY 21jg== X-Gm-Message-State: AOJu0Yyl9t35JVhSX6NeMIdijUd1vuJldMPt8YHNT4wNV7RviEaMPh2j 2I0a3OJQNxL5mGhhmQAauEMwOba0SPIXf9v5nnX1i+z4UFgjwhNAlsdb6g== X-Google-Smtp-Source: AGHT+IEn1Ghk2Fc9QPBoTJra2VdE8dKLTWYoeS+XcO80ZrHrPYX5TPkylh6yQvNf1rpALRCWyV6WZA== X-Received: by 2002:a5d:4dc7:0:b0:37d:3def:2a82 with SMTP id ffacd0b85a97d-37d86d50442mr3345897f8f.36.1729097814351; Wed, 16 Oct 2024 09:56:54 -0700 (PDT) Original-Received: from pro2 (pd9e36c48.dip0.t-ipconnect.de. [217.227.108.72]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d7fa7a055sm4827365f8f.1.2024.10.16.09.56.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 09:56:54 -0700 (PDT) In-Reply-To: <86r08goy76.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 16 Oct 2024 18:38:05 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:293682 Archived-At: Eli Zaretskii writes: >> From: Gerd M=C3=B6llmann >> Date: Wed, 16 Oct 2024 16:19:53 +0200 >>=20 >> I'd like to propose a change like in the attached patch (from my tty >> child frames branch). It fixes the case I mentioned above. > > I'd like to understand why these changes are needed. Could you please > elaborate on each and every change? > >> if (EQ (window, f->menu_bar_window)) >> { >> - cursor =3D FRAME_OUTPUT_DATA (f)->nontext_cursor; >> + if (FRAME_WINDOW_P (f)) >> + cursor =3D FRAME_OUTPUT_DATA (f)->nontext_cursor; > > Can a TTY frame have a menu-bar window? AFAIK, a menu bar is just a > frame glyph row on TTY frames, it is not a window. > >> if (EQ (window, f->tab_bar_window)) >> { >> note_tab_bar_highlight (f, x, y); >> - if (tab_bar__dragging_in_progress) >> - cursor =3D FRAME_OUTPUT_DATA (f)->hand_cursor; >> - else >> - cursor =3D FRAME_OUTPUT_DATA (f)->nontext_cursor; >> + if (FRAME_WINDOW_P (f)) >> + { >> + if (tab_bar__dragging_in_progress) >> + cursor =3D FRAME_OUTPUT_DATA (f)->hand_cursor; >> + else >> + cursor =3D FRAME_OUTPUT_DATA (f)->nontext_cursor; >> + } > > Same question here about tab-bar window. > >> if (EQ (window, f->tool_bar_window)) >> { >> note_tool_bar_highlight (f, x, y); >> - cursor =3D FRAME_OUTPUT_DATA (f)->nontext_cursor; >> + if (FRAME_WINDOW_P (f)) >> + cursor =3D FRAME_OUTPUT_DATA (f)->nontext_cursor; >> goto set_cursor; > > Same question here about tool-bar window. > >> #ifdef HAVE_WINDOW_SYSTEM >> if (part =3D=3D ON_LEFT_MARGIN || part =3D=3D ON_RIGHT_MARGIN) >> { >> - cursor =3D FRAME_OUTPUT_DATA (f)->nontext_cursor; >> + if (FRAME_WINDOW_P (f)) >> + cursor =3D FRAME_OUTPUT_DATA (f)->nontext_cursor; > > This part I could understand. > >> #ifdef HAVE_WINDOW_SYSTEM >> if (part =3D=3D ON_VERTICAL_BORDER) >> { >> - cursor =3D FRAME_OUTPUT_DATA (f)->horizontal_drag_cursor; >> + if (FRAME_WINDOW_P (f)) >> + cursor =3D FRAME_OUTPUT_DATA (f)->horizontal_drag_cursor; > > Do we have vertical borders on TTY frames? If yes, this is also > understood. > >> else if (part =3D=3D ON_RIGHT_DIVIDER) >> { >> - cursor =3D FRAME_OUTPUT_DATA (f)->horizontal_drag_cursor; >> + if (FRAME_WINDOW_P (f)) >> + cursor =3D FRAME_OUTPUT_DATA (f)->horizontal_drag_cursor; >> help_echo_string =3D build_string ("drag-mouse-1: resize"); >> goto set_cursor; > > Do we have right dividers on TTY frames? > >> @@ -36244,7 +36253,8 @@ note_mouse_highlight (struct frame *f, int x, in= t y) >> || minibuf_level >> || NILP (Vresize_mini_windows)) >> { >> - cursor =3D FRAME_OUTPUT_DATA (f)->vertical_drag_cursor; >> + if (FRAME_WINDOW_P (f)) >> + cursor =3D FRAME_OUTPUT_DATA (f)->vertical_drag_cursor; >> help_echo_string =3D build_string ("drag-mouse-1: resize"); > > Same question about bottom dividers as above about right dividers. > >> else if (part =3D=3D ON_LEFT_FRINGE || part =3D=3D ON_RIGHT_FRINGE) >> { >> - cursor =3D FRAME_OUTPUT_DATA (f)->nontext_cursor; >> + if (FRAME_WINDOW_P (f)) >> + cursor =3D FRAME_OUTPUT_DATA (f)->nontext_cursor; > > How can fringes happen on a TTY frame? > >> else if (part =3D=3D ON_VERTICAL_SCROLL_BAR >> || part =3D=3D ON_HORIZONTAL_SCROLL_BAR) >> - cursor =3D FRAME_OUTPUT_DATA (f)->nontext_cursor; >> - else >> + { >> + if (FRAME_WINDOW_P (f)) >> + cursor =3D FRAME_OUTPUT_DATA (f)->nontext_cursor; >> + } >> + else if (FRAME_WINDOW_P (f)) >> cursor =3D FRAME_OUTPUT_DATA (f)->text_cursor; >> #endif > > How can scroll bars happen on TTY frames? I'll try to answer this a bit more broadly: I'd like the code to be more resilient, and not make implicit assumptions about the absence of of features on ttys, which when false, leads to such hard to detect errors. Consider the internal border case. In master, FRAME_INTERNAL_BORDER happens to return 0 in master. But that might change, if I ever get setting internal borders to work for tty child frames, to draw the border there.