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.bugs Subject: bug#71866: 30.0.50; [macOS] Cursor hiding char behind it with certain theme customization Date: Mon, 22 Jul 2024 22:15:17 +0300 Message-ID: <86ikwx9r22.fsf@gnu.org> References: <72a0b2e2-600e-46f1-b583-0bed86f27d2d@gutov.dev> <86o76scaou.fsf@gnu.org> <86cyn7cito.fsf@gnu.org> <1659357b-5ca0-47a6-8ff3-4aa26017280b@gutov.dev> <86ttgibxqv.fsf@gnu.org> <7ae61592-8319-4b1a-b973-4015ff1db569@gutov.dev> <86wmlda3jb.fsf@gnu.org> <86msm99zmd.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="961"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dmitry@gutov.dev, 71866@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 22 21:16:20 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 1sVyWC-00004y-6H for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Jul 2024 21:16:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sVyVt-0004Fm-AZ; Mon, 22 Jul 2024 15:16:01 -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 1sVyVr-0004FJ-T3 for bug-gnu-emacs@gnu.org; Mon, 22 Jul 2024 15:16:00 -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 1sVyVr-0001Ie-GY for bug-gnu-emacs@gnu.org; Mon, 22 Jul 2024 15:15:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sVyVu-0003Qr-AE for bug-gnu-emacs@gnu.org; Mon, 22 Jul 2024 15:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Jul 2024 19:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71866 X-GNU-PR-Package: emacs Original-Received: via spool by 71866-submit@debbugs.gnu.org id=B71866.172167573413159 (code B ref 71866); Mon, 22 Jul 2024 19:16:02 +0000 Original-Received: (at 71866) by debbugs.gnu.org; 22 Jul 2024 19:15:34 +0000 Original-Received: from localhost ([127.0.0.1]:58613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVyVS-0003QB-GG for submit@debbugs.gnu.org; Mon, 22 Jul 2024 15:15:34 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVyVP-0003Px-Ou for 71866@debbugs.gnu.org; Mon, 22 Jul 2024 15:15:33 -0400 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 1sVyVF-0001Cq-84; Mon, 22 Jul 2024 15:15:21 -0400 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=WT5rs2CI/hi1v+58kKTaD/3IhMEXMbDA8KBVXZe9RLA=; b=OhxpIf9ku3eZ LaDYMtid8WTscrFlQNRtwztbdlYL2shbZU3LtIXabr7XETddGLDPnZoXkEB0np7rysDlg35OWB14o PkwXMBZx2aN3Qaf0XiFKYMjsezy3b7HHghA+tRgl7/0xkC4FuS4wpXAXyF3+qEtvOYxsmelj3Ine0 +GwkDnt32BL71JBgtiL+a911t7O5DsHUEYOe5EwlLT1V1gNfuSQq1tbYCwTrA0Q/WVLKR2YeutKD5 wfBLZJlr1iOxybhFEwEhPA24w0LTy/zhlc2IFWJsnfbAJDX4VbYR9qdF6I6HFDzPVNQecWF183zBU kcmKp/Ve+OmQ0XYPovrRPA==; In-Reply-To: (message from Alan Third on Mon, 22 Jul 2024 20:02:25 +0100) 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:289130 Archived-At: > Date: Mon, 22 Jul 2024 20:02:25 +0100 > From: Alan Third > Cc: dmitry@gutov.dev, 71866@debbugs.gnu.org > > On Mon, Jul 22, 2024 at 07:10:18PM +0300, Eli Zaretskii wrote: > > So how would you suggest to arrange the breakpoints to be able to > > match calls to ns_draw_window_cursor with what appears on the screen? > > > > Or maybe we can call some function after ns_draw_window_cursor returns > > to make sure the results of ns_draw_window_cursor are immediately > > shown on the glass? > > I'm not sure if it's possible. The whole thing runs asynchronously. > The best bet would be to put this: > > [[FRAME_NS_VIEW (f) layer] display]; > > at the end of ns_draw_window_cursor and look at it after that, but the > display function passes a bitmap off to a system that supposedly tells > the graphics card to pull in the bitmap using DMA and display it, all > in a separate thread. So whether it will work or not I don't know. > > It may be possible to access the bitmap and dump it to a file... > > CGContextRef context = [(EmacsLayer *)[FRAME_NS_VIEW (f) layer] getContext]; > CGContextFlush (context); > void *pixels = CGBitmapContextGetData (context); > NSLog(@"pixels: %p, bytes: %lu, %lux%lu", pixels, > CGBitmapContextGetHeight (context) * > CGBitmapContextGetBytesPerRow (context), > CGBitmapContextGetHeight (context), > CGBitmapContextGetWidth (context)); > > Just before the final ns_unfocus in ns_draw_window_cursor should > provide data about the image, and in lldb something like > > mem read -o ~/image.raw --count 10000 pixels --force > > should dump the raw pixels to disk and in theory imagemagick or > something could read them, but I'm failing to make this work. I think > count is not bytes, and either way I can't convince imagemagick to > read the output. Hmm... doesn't sound very practical to me. Are there any other ways of understanding why the cursor is sometimes not shown (and at times even the character under the cursor is not shown as well)? If the relation between what the code does and what's on display is basically impenetrable, how do people debug Emacs display issues on macOS?