[Top][All Lists]

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

Re: Adding fake cursors when resizing a window.

From: Keith David Bershatsky
Subject: Re: Adding fake cursors when resizing a window.
Date: Thu, 07 Mar 2019 17:39:20 -0800

Thank you, Eli and Martin, for reviewing and responding to this particular 

I am able to observe the behavior described on Emacs for w32 and NS, but _not_ 
running on X11 with the current build settings.

I have set up stderr messages in all locations where draw_glyphs is called and 
have concluded that draw_glyphs is _not_ responsible for erasing the fake 
cursors along the vertical strip that forms the scroll bar in the middle of the 
screen (which gets removed when the right window is deleted, and the left 
window increases to fill the entire frame).  In addition to the stderr 
messages, I can visually see that the gap left in the area of fake cursors is 
the same width as the vertical scroll bar, and the gap does not align exactly 
with two characters.  In other words, if draw_glyphs were somehow responsible 
for erasing the fake cursors in the area affected, then the fake cursors would 
be removed at the same X-axis and exact pixel width of each new character that 
gets drawn on the glass.

I do not know why draw_glyphs is able to redraw the row without any problems, 
but drawing fake cursors along that region of the vertical scroll bar fails.  
On the w32 platform, the fake cursors at issue (BAR/HBAR_CURSOR) are drawn with 
w32_fill_area.  On the NS platform, the fake cursors (BAR/HBAR_CURSOR) are 
drawn with NSRectFill.

It probably would not be too difficult to create a minimal working example that 
draws/erases a horizontal line (the width of the window) every command loop to 
help demonstrate the issue, if that would be helpful ....


> Date: [03-07-2019 07:12:57] <07 Mar 2019 17:12:57 +0200>
> From: Eli Zaretskii <address@hidden>
> To: Keith David Bershatsky <address@hidden>
> CC: address@hidden
> Subject: Re: Adding fake cursors when resizing a window.
> > Date: Wed, 06 Mar 2019 19:42:16 -0800
> > From: Keith David Bershatsky <address@hidden>
> >
> > Fact Pattern:  Two-window left/right split with vertical scroll bars on 
> > each window.  The user deletes the right window and the left window 
> > increases in size to fill the entire frame.  update_window is called and 
> > all of the fake get erased at the outset using the window's current_matrix 
> > before scrolling_window is called.  Then, draw_glyphs does its thing on the 
> > relevant lines and fake cursors are laid on each relevant line subsequent 
> > thereto.
> >
> > From what I can tell, it appears that draw_glyphs is able to write glyphs 
> > _underneath_ the vertical scroll bar in the center of the screen (that is 
> > about to be removed).  However, drawing a rectangle (to create a fake 
> > cursor) from nsterm.m cannot write a fake cursor _underneath_ the vertical 
> > scroll bar in the center of the screen (that is about to be removed).  When 
> > the vertical scroll bar is removed from the center of the screen, the area 
> > where the fake cursor could not be drawn is readily apparent.
> I'm confused by your description of the sequence of events.  Is this
> what happens on NS, or are you saying you see this on X and w32 as
> well?  I'm less familiar with the redisplay sequence on NS (and it
> also recently tends to change frequently), but on X and w32 your
> description is either inaccurate or misses something, because the
> sequence AFAIK is like this:
>   . redisplay_internal calls the condemn_scroll_bars_hook, which marks
>     all scroll bars as candidates for deletion
>   . then redisplay_internal calls redisplay_windows, which walks the
>     window-tree and examines each window, whereby each window that is
>     still alive in the window-tree "redeems" its scroll bars by
>     marking them not to be deleted
>   . then redisplay_internal calls judge_scroll_bars_hook, which
>     removes all the scroll bars that were not "redeemed"
>   . and only after that redisplay_internal calls update_frame, which
>     calls update_window for each live window, and that ends up calling
>     draw_glyphs to deliver the updated contents to the glass.
> So I don't understand why you see draw_glyphs draw "underneath" the
> scroll bar, since by the time draw_glyphs is called, the scroll bar in
> the middle of the frame was supposed to be deleted already.
> > One of my thoughts on dealing with this issue is to remove the vertical 
> > scroll bar (splitting the 2 windows) before update_window runs.
> AFAIK, we already do that, at least on X and on w32.

reply via email to

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