unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 73838@debbugs.gnu.org
Subject: bug#73838: 31.0.50; Problems in note_mouse_highlight if -nw
Date: Wed, 16 Oct 2024 18:56:53 +0200	[thread overview]
Message-ID: <m2plo0f0kq.fsf@gmail.com> (raw)
In-Reply-To: <86r08goy76.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 16 Oct 2024 18:38:05 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> Date: Wed, 16 Oct 2024 16:19:53 +0200
>> 
>> 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 = FRAME_OUTPUT_DATA (f)->nontext_cursor;
>> +      if (FRAME_WINDOW_P (f))
>> +	cursor = 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 = FRAME_OUTPUT_DATA (f)->hand_cursor;
>> -      else
>> -	cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
>> +      if (FRAME_WINDOW_P (f))
>> +	{
>> +	  if (tab_bar__dragging_in_progress)
>> +	    cursor = FRAME_OUTPUT_DATA (f)->hand_cursor;
>> +	  else
>> +	    cursor = 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 = FRAME_OUTPUT_DATA (f)->nontext_cursor;
>> +      if (FRAME_WINDOW_P (f))
>> +	cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
>>        goto set_cursor;
>
> Same question here about tool-bar window.
>
>>  #ifdef HAVE_WINDOW_SYSTEM
>>        if (part == ON_LEFT_MARGIN || part == ON_RIGHT_MARGIN)
>>  	{
>> -	  cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
>> +	  if (FRAME_WINDOW_P (f))
>> +	    cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
>
> This part I could understand.
>
>>  #ifdef HAVE_WINDOW_SYSTEM
>>    if (part == ON_VERTICAL_BORDER)
>>      {
>> -      cursor = FRAME_OUTPUT_DATA (f)->horizontal_drag_cursor;
>> +      if (FRAME_WINDOW_P (f))
>> +	cursor = FRAME_OUTPUT_DATA (f)->horizontal_drag_cursor;
>
> Do we have vertical borders on TTY frames?  If yes, this is also
> understood.
>
>>    else if (part == ON_RIGHT_DIVIDER)
>>      {
>> -      cursor = FRAME_OUTPUT_DATA (f)->horizontal_drag_cursor;
>> +      if (FRAME_WINDOW_P (f))
>> +	cursor = FRAME_OUTPUT_DATA (f)->horizontal_drag_cursor;
>>        help_echo_string = 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, int y)
>>  	|| minibuf_level
>>  	|| NILP (Vresize_mini_windows))
>>        {
>> -	cursor = FRAME_OUTPUT_DATA (f)->vertical_drag_cursor;
>> +	if (FRAME_WINDOW_P (f))
>> +	  cursor = FRAME_OUTPUT_DATA (f)->vertical_drag_cursor;
>>  	help_echo_string = build_string ("drag-mouse-1: resize");
>
> Same question about bottom dividers as above about right dividers.
>
>>    else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE)
>>      {
>> -      cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
>> +      if (FRAME_WINDOW_P (f))
>> +	cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
>
> How can fringes happen on a TTY frame?
>
>>    else if (part == ON_VERTICAL_SCROLL_BAR
>>  	   || part == ON_HORIZONTAL_SCROLL_BAR)
>> -    cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
>> -  else
>> +    {
>> +      if (FRAME_WINDOW_P (f))
>> +	cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
>> +    }
>> +  else if (FRAME_WINDOW_P (f))
>>      cursor = 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.





  reply	other threads:[~2024-10-16 16:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-16 10:47 bug#73838: 31.0.50; Problems in note_mouse_highlight if -nw Gerd Möllmann
2024-10-16 14:19 ` Gerd Möllmann
2024-10-16 15:38   ` Eli Zaretskii
2024-10-16 16:56     ` Gerd Möllmann [this message]
2024-10-16 18:30       ` Eli Zaretskii
2024-10-16 19:03         ` Gerd Möllmann
2024-10-17  4:06           ` Eli Zaretskii
2024-10-17  5:07             ` Gerd Möllmann
2024-10-17  5:48               ` Eli Zaretskii
2024-10-17  7:03                 ` Gerd Möllmann
2024-10-17 10:44                   ` Eli Zaretskii
2024-10-17 12:12                     ` Gerd Möllmann
2024-10-17 10:46                   ` Eli Zaretskii
2024-10-17 12:39                     ` Gerd Möllmann
2024-10-19  3:50                       ` Gerd Möllmann
2024-10-19  8:00                         ` Gerd Möllmann
2024-10-16 15:27 ` Eli Zaretskii
2024-10-16 16:41   ` Gerd Möllmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2plo0f0kq.fsf@gmail.com \
    --to=gerd.moellmann@gmail.com \
    --cc=73838@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).