External Drag bug


#1

Ok, let’s see if I can explain this! I am a few commits behind in GIT, but I checked the logs and couldn’t see anything referencing this…

I had been tracking down a weird bug where I have a TableListBox, and occasionally when I dragged some rows it was calling my “shouldDropFilesWhenDraggedExternally” method when my mouse was clearly still over my component!

After some debugging, turns out…

Component* Desktop::findComponentAt was finding an invisible window in that area but then c->getComponentAt was returning 0 because it was invisible, which then triggers the if (Desktop::getInstance().findComponentAt (screenPos) == 0) condition to be true in DragImageComponent::updateLocation before it iterated over my main window…

I don’t know whether the component that desktopComponents.getUnchecked(i) returns should be checked for visibility as well, or whether that’ll have some adverse reaction…


#2

Bit more info… my invisible window has its setAlwaysOnTop() bit set…


#3

I actually fixed that exact problem a couple of days ago! Sorry if I missed it out when writing the commit logs!


#4

Serves me right! Oh well, good “practice” bug hunting I guess! (Like I need it!)


#5

Just updated…tnx for the leak detector!

But now… my autoScroll on a viewport looks like it is on 10 cups of coffee… I turned off beginDragAutoRepeat(), so all I have is

autoScroll (x, y, 20, 10);

Seems like the viewport then sets the top left position, and then component.cpp sends a fakemouse and before you know it, i’m caught in a little loop, where autoscroll is called again and again but I haven’t even moved the mouse a pixel…


#6

And that’s a new behaviour within the last few days? I can’t think what I’ve done that would affect that…?


#7

Wow, I hadn’t updated since June! (I was wondering why I had so many compile errors to fix!)

I’m not gonna sweat it too much, i’ll see if I can get better details for you later.