[haiku-bugs] Re: [Haiku] #9064: An invalidated BView does not draw to a BBitmap

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Mon, 26 Dec 2022 16:35:14 -0000

#9064: An invalidated BView does not draw to a BBitmap
---------------------------------+----------------------------
  Reporter:  axeld               |      Owner:  nobody
      Type:  bug                 |     Status:  assigned
  Priority:  high                |  Milestone:  R1
 Component:  Servers/app_server  |    Version:  R1/Development
Resolution:                      |   Keywords:
Blocked By:                      |   Blocking:
  Platform:  All                 |
---------------------------------+----------------------------
Comment (by Jim906):

 I think the problem relates to the fact that BBitmap::fWindow cannot
 receive messages because it is an offscreen BWindow, which means Run is
 never called.

 BView::Invalidate sends an AS_VIEW_INVALIDATE_RECT message to the
 OffscreenWindow that corresponds to fWindow.  The OffscreenWindow, in
 response, sends back an _UPDATE_ message.  Since fWindow can't receive
 messages, it does not make the expected reply (AS_BEGIN_UPDATE) to the
 OffscreenWindow.  This leaves the OffscreenWindow in a state where
 fUpdateRequested is true and fInUpdate is false.  In this state,
 Window::GetEffectiveDrawingRegion will decide that the invalidated area
 can't be drawn to.

 This situation can be avoided if OffscreenWindow's base member
 Window::fUpdatesEnabled is false, because then Window::_SendUpdateMessage
 won't send the _UPDATE_ message and won't set fUpdateRequested to true.
 Suggested patch:  https://review.haiku-os.org/c/haiku/+/5967.
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/9064#comment:2>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: