Jumpy Resizable Window

10 posts / 0 new
Last post
Hanley
Offline
Last seen: 3 months 3 weeks ago
Joined: 29 Jun 2011 - 03:46
Jumpy Resizable Window

I have a window with a couple components in it, all set to change their size and placement when the window is resized. It's working, except when I drag the corner down or up quickly, the components, as well as the title bar, jump anywhere from 10 to 100 pixels in the direction I'm dragging for just an instant and then snap back to where it's supposed to be. And it does this over and over until I stop dragging. It creates a kind of fluttery, jumpy effect. Here's the relevant code:

Main Window Constructor:

//some constructor code then...
setContentOwned (new VideoComponent::VideoComponent(), true);
centreWithSize (getWidth(), getHeight());
sizeLimit.setMinimumSize(600, 400);
setConstrainer(&sizeLimit);
setVisible (true);		
setResizable(true, true);

Main Componenent:

//some constructor code, then...
rectPlace = new RectanglePlacement(4 + 8);

// later...
void VideoComponent::resized()
{
	rect->setBounds (10, 10, getWidth() - 20, getHeight() - 50);
	videoPlayer->setBoundsWithCorrectAspectRatio (*rect, *rectPlace);
	control->setBounds(videoPlayer->getX(), videoPlayer->getBottom(), videoPlayer->getWidth(), 30);
}

Any ideas?

TheVinn
Offline
Last seen: 6 months 2 weeks ago
Joined: 29 Aug 2009 - 11:31
Re: Jumpy Resizable Window

Which corner are you dragging from?

Hanley
Offline
Last seen: 3 months 3 weeks ago
Joined: 29 Jun 2011 - 03:46
Re: Jumpy Resizable Window

Bottom right

Hanley
Offline
Last seen: 3 months 3 weeks ago
Joined: 29 Jun 2011 - 03:46
Re: Jumpy Resizable Window

One more pice of info: The main component is a QuickTimeVideoComponent. When I get rid of it, but keep all of the other components, the problem goes away. But since the other components were set relative to the QuickTime component, they were jumping too. So the QT component is causing the problem.

Anyone experience that issue with QuickTimeVideoComponent?

TheVinn
Offline
Last seen: 6 months 2 weeks ago
Joined: 29 Aug 2009 - 11:31
Re: Jumpy Resizable Window

You mean your contentComponent is a QuickTimeVideoComponent?

Hanley
Offline
Last seen: 3 months 3 weeks ago
Joined: 29 Jun 2011 - 03:46
Re: Jumpy Resizable Window

No. The component set to be owned by the main window is just a regular component. It then owns two components, one of which is a QuickTimeVideoComponent.

Alatar
Offline
Last seen: 3 months 3 weeks ago
Joined: 29 Jan 2012 - 09:44
Re: Jumpy Resizable Window

Never tried a quicktime component myself. But maybe the resizing is taking too much CPU power and JUCE has trouble keeping up?
What is your CPU meter indicating?
Are you running debug or release mode?

Hanley
Offline
Last seen: 3 months 3 weeks ago
Joined: 29 Jun 2011 - 03:46
Re: Jumpy Resizable Window

CPU meter is running around 20-30 % when I'm resizing the window. This is pretty low compared to say, XCode, which runs at around 70% when I'm resizing the window. I'm runinng Debug mode.

jules
Offline
Last seen: 6 hours 36 min ago
Joined: 29 Apr 2013 - 18:37
Re: Jumpy Resizable Window

Quicktime uses an embedded window that I think might use its own thread for updating, so it does sometimes tear. Don't think I can do anything about it.

Hanley
Offline
Last seen: 3 months 3 weeks ago
Joined: 29 Jun 2011 - 03:46
Re: Jumpy Resizable Window

K. Maybe I can figure out a workaround. Thanks for the replies.