[haiku-development] BDirectWindow::GetClippingRegion implementation wrong?

  • From: Julian Harnath <julian.harnath@xxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 18 Nov 2012 00:26:35 +0100

Hello,

I'm trying to use BDirectWindow::GetClippingRegion(), but it always 
returns B_ERROR although I'm calling it from DirectConnected() and 
passing a valid pointer to a BRegion.
Looking at how the method is implemented in Haiku's GameKit it seems to 
contradict what is written in the BeBook...

The BeBook says that BDirectWindow::GetClippingRegion() MUST be called 
from within BDirectWindow::DirectConnected(), otherwise invalid results 
are returned. Haiku's implementation though does the opposite:

---- snip ----
if (fInDirectConnect) {
                _UnlockDirect();
                return B_ERROR;
        }
---- snip ----

I think it should be "if (!fInDirectConnect)" instead (but I didn't 
test that yet). Since I can't find any sample code actually using this 
function it might just be me misunderstanding it though.

--
So long, Julian

Other related posts: