norgepaul / TChromeTabs

Comprehensive Delphi implementation of Chrome's tab system
Other
215 stars 78 forks source link

Access Violation when dragging Tab to other RemoteContainer #34

Open homer90 opened 8 years ago

homer90 commented 8 years ago

When dragging (and dropping) a Tab to an other Container it sometimes happens that the following access violation gets triggered:

accessviolation

I've made a quick video so you can see when this AV occurs: http://gfycat.com/InferiorEagerItaliangreyhound

It seems like SetControlPosition gets an invalid ChromeTabsControl and therefore crashes?

Best regards, Homer

homer90 commented 8 years ago

Workaround:

In function TCustomChromeTabs.InsertDroppedTab: TChromeTab;

If you comment out: // SetControlPosition(TabControls[FActiveDragTabObject.DropTabIndex], // FDragTabControl.ControlRect, // FALSE);

the AV doesn't occur anymore.

norgepaul commented 8 years ago

The code you commented out is needed otherwise the tab will resize when dropped. I couldn't repeat the problem, but I've added a check to make sure is FDragTabControl assigned:

  if FDragTabControl <> nil then
  begin
    SetControlPosition(TabControls[FActiveDragTabObject.DropTabIndex],
                       FDragTabControl.ControlRect,
                       FALSE);
  end;

Can you take a look at the new version (committing soon) and see you still get the error. If you do, please send me your demo and I'll take a look.

homer90 commented 8 years ago

The inital problem is solved now, yay! Thanks!

However if you have 2 tabs in one Container and want to to drag and drop one into another container which has 0 tabs you'll get an "Argument out of bounds exception". This happens if you release the mouse button while the tab is invisible.

  1. Create ChromeTabs with 2 tabs
  2. Create ChromeTabs with 0 tabs
  3. Move one tab over to the other slowly until the tab gets invisible
  4. Release the mousebutton now while the tab is still invisible

Video for clarification: http://gfycat.com/NippyGraciousHalcyon

norgepaul commented 8 years ago

I have recreated the demo as closely as I can using your videos, but cannot repeat the problem, no matter how many times I try. I guess you have some property set that I can't see in the video. Can you please send me a copy of the project you are using?

homer90 commented 8 years ago

I use the standard ChromeTabs settings. However i forgot to mention they are place on 2 panels. I've zipped an example: https://www.dropbox.com/s/8trx795p5ttv2w0/chrometabstest.zip?dl=0

landrix commented 8 years ago

Any news on this? The dropbox-link is broken.