bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#73838: 31.0.50; Problems in note_mouse_highlight if -nw


From: Gerd Möllmann
Subject: bug#73838: 31.0.50; Problems in note_mouse_highlight if -nw
Date: Wed, 16 Oct 2024 18:56:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]