all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 71866@debbugs.gnu.org
Subject: bug#71866: 30.0.50; [macOS] Cursor hiding char behind it with certain theme customization
Date: Fri, 19 Jul 2024 04:57:12 +0300	[thread overview]
Message-ID: <56cc929b-5491-4ed4-a527-d0b1a369e625@gutov.dev> (raw)
In-Reply-To: <867cdto3uk.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2616 bytes --]

On 10/07/2024 14:58, Eli Zaretskii wrote:
>> Date: Wed, 10 Jul 2024 05:46:35 +0300
>> Cc: 71866@debbugs.gnu.org
>> From: Dmitry Gutov <dmitry@gutov.dev>
>>
>>>> It does get called. Unfortunately, as soon as I put a breakpoint there,
>>>> any attempt to switch to the Emacs window drops into the debugger again
>>>> - and I have switch back to the terminal emulator to enter 'c RET' 20
>>>> times or so.
>>>
>>> I don't think I understand what you are trying to do.  I thought you
>>> needed to "switch to the Emacs window" just once: to trigger the
>>> situation which you want to investigate.  Once you trigger it, the
>>> debugger will indeed kick in, but all you need to do next is step
>>> through the code, so why do you care about switching to Emacs again?
>>
>> Somehow, the problem manifests when I switch between frames (two frames
>> in the current repro) using C-` (bound to `other-frame').
>>
>> But if I Alt-Tab to a different application and then Alt-Tab back to
>> Emacs, then the glyph is rendered fine - even if the "problematic" frame
>> gets selected.
> 
> I thought you see the problem when you switch from another application
> to Emacs, not only when you switch between two Emacs frames.  I see I
> was mistaken.
> 
>>>     (gdb) print f
>>>       $1 = (struct frame *) 0x1234567812345600
>>>     (gdb) condition 3 f == 0x1234567812345600
>>>
>>> This makes breakpoint 3 trigger only when struct frame variable f has
>>> the value of this frame.
>>
>> So step 1 find out the address of the second frame, step 2 switch to
>> first frame, step 3 enable a conditional breakpoint.
> 
> Yes.

Okay, I have tried that, and the results might or might not be useful.

Similarly to the case of switching from another application, when I have 
to switch to another application to handle the breakpoints (just typing 
'c RET'), the behavior is different.

BUT the last call to ns_draw_window_cursor (out of 14) before the 
control is returned results in the cursor getting hidden (in the new 
selected Emacs frame only). Unlike the problem I described, the 
character under the cursor stays drawn, but the cursor rectangle goes 
away (and that happens after the last breakpoint hit, before that the 
text and the cursor look correctly - hollow cursor around the character).

I'm attaching the last debugging log - maybe the backtrace can be 
useful? - but note that the backtrace printing is halfway broken as well 
- it freezes and I have to press ^C a bunch of times to see something.

Anyway, while wrong, the behavior is not the same, so I can't be sure 
it's the same problem that is being triggered.

[-- Attachment #2: emacs-lldb-log.txt --]
[-- Type: text/plain, Size: 9973 bytes --]

Process 82461 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
    frame #0: 0x000000010027da6c emacs`ns_draw_window_cursor(w=0x00000001328b4188, glyph_row=0x0000000132ad0000, x=<unavailable>, y=<unavailable>, cursor_type=FILLED_BOX_CURSOR, cursor_width=1, on_p=true, active_p=<unavailable>) at nsterm.m:3045:23 [opt]
   3042	  if (!on_p)
   3043	    return;
   3044
-> 3045	  w->phys_cursor_type = cursor_type;
   3046	  w->phys_cursor_on_p = on_p;
   3047
   3048	  if (cursor_type == NO_CURSOR)
Target 0: (emacs) stopped.
(lldb) c
Process 82461 resuming
Process 82461 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
    frame #0: 0x000000010027da6c emacs`ns_draw_window_cursor(w=0x00000001328b4188, glyph_row=0x0000000132ad0000, x=<unavailable>, y=<unavailable>, cursor_type=FILLED_BOX_CURSOR, cursor_width=1, on_p=true, active_p=<unavailable>) at nsterm.m:3045:23 [opt]
   3042	  if (!on_p)
   3043	    return;
   3044
-> 3045	  w->phys_cursor_type = cursor_type;
   3046	  w->phys_cursor_on_p = on_p;
   3047
   3048	  if (cursor_type == NO_CURSOR)
Target 0: (emacs) stopped.
(lldb) c
Process 82461 resuming
Process 82461 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
    frame #0: 0x000000010027da6c emacs`ns_draw_window_cursor(w=0x00000001328b4430, glyph_row=0x00000001308d1200, x=<unavailable>, y=<unavailable>, cursor_type=NO_CURSOR, cursor_width=0, on_p=true, active_p=<unavailable>) at nsterm.m:3045:23 [opt]
   3042	  if (!on_p)
   3043	    return;
   3044
-> 3045	  w->phys_cursor_type = cursor_type;
   3046	  w->phys_cursor_on_p = on_p;
   3047
   3048	  if (cursor_type == NO_CURSOR)
Target 0: (emacs) stopped.
(lldb) c
Process 82461 resuming
2024-07-19 04:39:54.538871+0300 emacs[82461:2830026] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.
Process 82461 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
    frame #0: 0x000000010027da6c emacs`ns_draw_window_cursor(w=0x00000001328b4188, glyph_row=0x0000000132ad0000, x=<unavailable>, y=<unavailable>, cursor_type=HOLLOW_BOX_CURSOR, cursor_width=1, on_p=true, active_p=<unavailable>) at nsterm.m:3045:23 [opt]
   3042	  if (!on_p)
   3043	    return;
   3044
-> 3045	  w->phys_cursor_type = cursor_type;
   3046	  w->phys_cursor_on_p = on_p;
   3047
   3048	  if (cursor_type == NO_CURSOR)
Target 0: (emacs) stopped.
(lldb) c
Process 82461 resuming
Process 82461 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
    frame #0: 0x000000010027da6c emacs`ns_draw_window_cursor(w=0x00000001328b4430, glyph_row=0x00000001308d1200, x=<unavailable>, y=<unavailable>, cursor_type=NO_CURSOR, cursor_width=0, on_p=true, active_p=<unavailable>) at nsterm.m:3045:23 [opt]
   3042	  if (!on_p)
   3043	    return;
   3044
-> 3045	  w->phys_cursor_type = cursor_type;
   3046	  w->phys_cursor_on_p = on_p;
   3047
   3048	  if (cursor_type == NO_CURSOR)
Target 0: (emacs) stopped.
(lldb) c
Process 82461 resuming
Process 82461 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
    frame #0: 0x000000010027da6c emacs`ns_draw_window_cursor(w=0x00000001328b4188, glyph_row=0x0000000132ad0000, x=<unavailable>, y=<unavailable>, cursor_type=FILLED_BOX_CURSOR, cursor_width=1, on_p=true, active_p=<unavailable>) at nsterm.m:3045:23 [opt]
   3042	  if (!on_p)
   3043	    return;
   3044
-> 3045	  w->phys_cursor_type = cursor_type;
   3046	  w->phys_cursor_on_p = on_p;
   3047
   3048	  if (cursor_type == NO_CURSOR)
Target 0: (emacs) stopped.
(lldb) c
Process 82461 resuming
Process 82461 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
    frame #0: 0x000000010027da6c emacs`ns_draw_window_cursor(w=0x00000001328b4188, glyph_row=0x0000000132ad0000, x=<unavailable>, y=<unavailable>, cursor_type=FILLED_BOX_CURSOR, cursor_width=1, on_p=true, active_p=<unavailable>) at nsterm.m:3045:23 [opt]
   3042	  if (!on_p)
   3043	    return;
   3044
-> 3045	  w->phys_cursor_type = cursor_type;
   3046	  w->phys_cursor_on_p = on_p;
   3047
   3048	  if (cursor_type == NO_CURSOR)
Target 0: (emacs) stopped.
(lldb) c
Process 82461 resuming
Process 82461 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
    frame #0: 0x000000010027da6c emacs`ns_draw_window_cursor(w=0x00000001328b4430, glyph_row=0x00000001308d1200, x=<unavailable>, y=<unavailable>, cursor_type=NO_CURSOR, cursor_width=0, on_p=true, active_p=<unavailable>) at nsterm.m:3045:23 [opt]
   3042	  if (!on_p)
   3043	    return;
   3044
-> 3045	  w->phys_cursor_type = cursor_type;
   3046	  w->phys_cursor_on_p = on_p;
   3047
   3048	  if (cursor_type == NO_CURSOR)
Target 0: (emacs) stopped.
(lldb) c
Process 82461 resuming
2024-07-19 04:40:10.523120+0300 emacs[82461:2830026] [CursorUI] -[TUINSCursorUIController activate:]: EmacsView doesn't conform to NSTextInputClient protocol.
Process 82461 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
    frame #0: 0x000000010027da6c emacs`ns_draw_window_cursor(w=0x00000001328b4188, glyph_row=0x0000000132ad0000, x=<unavailable>, y=<unavailable>, cursor_type=HOLLOW_BOX_CURSOR, cursor_width=1, on_p=true, active_p=<unavailable>) at nsterm.m:3045:23 [opt]
   3042	  if (!on_p)
   3043	    return;
   3044
-> 3045	  w->phys_cursor_type = cursor_type;
   3046	  w->phys_cursor_on_p = on_p;
   3047
   3048	  if (cursor_type == NO_CURSOR)
Target 0: (emacs) stopped.
(lldb) c
Process 82461 resuming
Process 82461 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
    frame #0: 0x000000010027da6c emacs`ns_draw_window_cursor(w=0x00000001328b4430, glyph_row=0x00000001308d1200, x=<unavailable>, y=<unavailable>, cursor_type=NO_CURSOR, cursor_width=0, on_p=true, active_p=<unavailable>) at nsterm.m:3045:23 [opt]
   3042	  if (!on_p)
   3043	    return;
   3044
-> 3045	  w->phys_cursor_type = cursor_type;
   3046	  w->phys_cursor_on_p = on_p;
   3047
   3048	  if (cursor_type == NO_CURSOR)
Target 0: (emacs) stopped.
(lldb) c
Process 82461 resuming
Process 82461 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
    frame #0: 0x000000010027da6c emacs`ns_draw_window_cursor(w=0x00000001328b4430, glyph_row=0x00000001308d1200, x=<unavailable>, y=<unavailable>, cursor_type=NO_CURSOR, cursor_width=0, on_p=true, active_p=<unavailable>) at nsterm.m:3045:23 [opt]
   3042	  if (!on_p)
   3043	    return;
   3044
-> 3045	  w->phys_cursor_type = cursor_type;
   3046	  w->phys_cursor_on_p = on_p;
   3047
   3048	  if (cursor_type == NO_CURSOR)
Target 0: (emacs) stopped.
(lldb) c
Process 82461 resuming
Process 82461 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
    frame #0: 0x000000010027da6c emacs`ns_draw_window_cursor(w=0x00000001328b4188, glyph_row=0x0000000132ad0000, x=<unavailable>, y=<unavailable>, cursor_type=HOLLOW_BOX_CURSOR, cursor_width=1, on_p=true, active_p=<unavailable>) at nsterm.m:3045:23 [opt]
   3042	  if (!on_p)
   3043	    return;
   3044
-> 3045	  w->phys_cursor_type = cursor_type;
   3046	  w->phys_cursor_on_p = on_p;
   3047
   3048	  if (cursor_type == NO_CURSOR)
Target 0: (emacs) stopped.
(lldb) c
Process 82461 resuming
Process 82461 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
    frame #0: 0x000000010027da6c emacs`ns_draw_window_cursor(w=0x00000001328b4430, glyph_row=0x00000001308d1200, x=<unavailable>, y=<unavailable>, cursor_type=NO_CURSOR, cursor_width=0, on_p=true, active_p=<unavailable>) at nsterm.m:3045:23 [opt]
   3042	  if (!on_p)
   3043	    return;
   3044
-> 3045	  w->phys_cursor_type = cursor_type;
   3046	  w->phys_cursor_on_p = on_p;
   3047
   3048	  if (cursor_type == NO_CURSOR)
Target 0: (emacs) stopped.
(lldb) c
Process 82461 resuming
Process 82461 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
    frame #0: 0x000000010027da6c emacs`ns_draw_window_cursor(w=0x00000001328b4430, glyph_row=0x00000001308d1200, x=<unavailable>, y=<unavailable>, cursor_type=NO_CURSOR, cursor_width=0, on_p=true, active_p=<unavailable>) at nsterm.m:3045:23 [opt]
   3042	  if (!on_p)
   3043	    return;
   3044
-> 3045	  w->phys_cursor_type = cursor_type;
   3046	  w->phys_cursor_on_p = on_p;
   3047
   3048	  if (cursor_type == NO_CURSOR)
Target 0: (emacs) stopped.
(lldb) bt
^C
^C*** exception in child provider update for Lisp_Symbol
^C^C*** exception in child provider update for Lisp_Symbol
^C^C* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
  * frame #0: 0x000000010027da6c emacs`ns_draw_window_cursor(w=0x00000001328b4430, glyph_row=0x00000001308d1200, x=<unavailable>, y=<unavailable>, cursor_type=NO_CURSOR, cursor_width=0, on_p=true, active_p=<unavailable>) at nsterm.m:3045:23 [opt]
    frame #1: 0x0000000100009120 emacs`gui_update_window_end(w=0x00000001328b4430, cursor_on_p=true, mouse_face_overwritten_p=false) at dispnew.c:3941:2 [opt]
    frame #2: 0x0000000100007e94 emacs`update_window(w=0x00000001328b4430, force_p=<unavailable>) at dispnew.c:3869:7 [opt]
    frame #3: 0x000000010000835c emacs`update_window_tree(w=0x00000001328b4430, force_p=true) at dispnew.c:3491:14 [opt]
    frame #4: 0x0000000100005c8c emacs`update_frame(f=0x00000001328b3f38, force_p=true, inhibit_hairy_id_p=<unavailable>) at dispnew.c:3326:18 [opt]
    frame #5: 0x000000010003b130 emacs`redisplay_internal at xdisp.c:17480:16 [opt]
    frame #6: 0x0000000100041620 emacs`redisplay at xdisp.c:16575:3 [opt] [artificial]
    frame #7: 0x000000010010d1e0 emacs`read_char(commandflag=<unavailable>, map=<unavailable>, prev_event=(struct Lisp_Symbol *) $35043 = 0x0000000100a8cf38, used_mouse_menu=<unavailable>, end_time=<unavailable>) at keyboard.c:2678:6 [opt]

... Interrupted.
(lldb) c
Process 82461 resuming

  reply	other threads:[~2024-07-19  1:57 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01  3:14 bug#71866: 30.0.50; [macOS] Cursor hiding char behind it with certain theme customization Dmitry Gutov
2024-07-01 11:36 ` Eli Zaretskii
2024-07-02  1:07   ` Dmitry Gutov
2024-07-06  8:56     ` Eli Zaretskii
2024-07-09  2:37       ` Dmitry Gutov
2024-07-09 11:31         ` Eli Zaretskii
2024-07-10  2:46           ` Dmitry Gutov
2024-07-10 11:58             ` Eli Zaretskii
2024-07-19  1:57               ` Dmitry Gutov [this message]
2024-07-20  8:30                 ` Eli Zaretskii
2024-07-20 15:46                   ` Dmitry Gutov
2024-07-20 16:03                     ` Eli Zaretskii
2024-07-21  0:53                       ` Dmitry Gutov
2024-07-21  7:20                         ` Eli Zaretskii
2024-07-21  9:04                           ` Eli Zaretskii
2024-07-21 23:22                             ` Dmitry Gutov
2024-07-21 13:50                           ` Dmitry Gutov
2024-07-21 14:55                             ` Eli Zaretskii
2024-07-21 23:58                               ` Dmitry Gutov
2024-07-22 14:45                                 ` Eli Zaretskii
2024-07-22 15:27                                   ` Alan Third
2024-07-22 16:02                                     ` Alan Third
2024-07-23  1:11                                       ` Dmitry Gutov
2024-07-23 11:19                                         ` Eli Zaretskii
2024-07-24  0:48                                           ` Dmitry Gutov
2024-07-24 11:32                                             ` Eli Zaretskii
2024-07-24 14:34                                               ` Dmitry Gutov
2024-07-24 16:29                                                 ` Eli Zaretskii
2024-07-24 19:22                                                   ` Dmitry Gutov
2024-07-24 20:08                                                     ` Dmitry Gutov
2024-07-25  5:01                                                     ` Eli Zaretskii
2024-07-25 16:14                                                       ` Dmitry Gutov
2024-07-22 16:10                                     ` Eli Zaretskii
2024-07-22 19:02                                       ` Alan Third
2024-07-22 19:15                                         ` Eli Zaretskii
2024-07-22 19:47                                           ` Alan Third
2024-07-23  1:06                                   ` Dmitry Gutov
2024-07-23 11:17                                     ` Eli Zaretskii
2024-07-02 23:42 ` Stefan Kangas
2024-07-07  2:03   ` Dmitry Gutov
2024-07-09 18:22     ` Stefan Kangas
2024-07-10  2:56       ` Dmitry Gutov
2024-07-23  7:40         ` Gerd Möllmann
2024-07-24  0:56           ` Dmitry Gutov
2024-07-24  3:48             ` Gerd Möllmann
2024-07-24 19:16               ` Dmitry Gutov
2024-07-25  3:03                 ` Gerd Möllmann
2024-07-25  5:39                   ` Eli Zaretskii
2024-07-25  5:58                     ` Gerd Möllmann
2024-07-25 14:46                   ` Dmitry Gutov

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

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

  git send-email \
    --in-reply-to=56cc929b-5491-4ed4-a527-d0b1a369e625@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=71866@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.