Jumpy Resizable Window

Discussion and support for general JUCE issues

Jumpy Resizable Window

Postby Hanley » Sat Jun 23, 2012 2:38 am

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:
Code: Select all
//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:
Code: Select all
//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?
Hanley
JUCE Obsessive
 
Posts: 97
Joined: Wed Jun 29, 2011 3:46 am

Re: Jumpy Resizable Window

Postby TheVinn » Sat Jun 23, 2012 2:53 am

Which corner are you dragging from?
Open Source: LayerEffects, VFLib, SimpleDJ, DSP Filters, LuaBridge, JUCE, FreeType, TagLib
"This isn't a big project, it shouldn't take long." - Jules
User avatar
TheVinn
JUCE UberWeenie
 
Posts: 2990
Joined: Sat Aug 29, 2009 11:31 am
Location: Marina del Rey, California

Re: Jumpy Resizable Window

Postby Hanley » Sat Jun 23, 2012 2:54 am

Bottom right
Hanley
JUCE Obsessive
 
Posts: 97
Joined: Wed Jun 29, 2011 3:46 am

Re: Jumpy Resizable Window

Postby Hanley » Sat Jun 23, 2012 3:01 am

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?
Hanley
JUCE Obsessive
 
Posts: 97
Joined: Wed Jun 29, 2011 3:46 am

Re: Jumpy Resizable Window

Postby TheVinn » Sat Jun 23, 2012 3:06 am

You mean your contentComponent is a QuickTimeVideoComponent?
Open Source: LayerEffects, VFLib, SimpleDJ, DSP Filters, LuaBridge, JUCE, FreeType, TagLib
"This isn't a big project, it shouldn't take long." - Jules
User avatar
TheVinn
JUCE UberWeenie
 
Posts: 2990
Joined: Sat Aug 29, 2009 11:31 am
Location: Marina del Rey, California

Re: Jumpy Resizable Window

Postby Hanley » Sat Jun 23, 2012 3:12 am

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.
Hanley
JUCE Obsessive
 
Posts: 97
Joined: Wed Jun 29, 2011 3:46 am

Re: Jumpy Resizable Window

Postby Alatar » Sun Jun 24, 2012 1:04 am

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?
Alatar
JUCE Geek
 
Posts: 29
Joined: Sun Jan 29, 2012 10:44 am
Location: Europe

Re: Jumpy Resizable Window

Postby Hanley » Mon Jun 25, 2012 4:38 pm

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.
Hanley
JUCE Obsessive
 
Posts: 97
Joined: Wed Jun 29, 2011 3:46 am

Re: Jumpy Resizable Window

Postby jules » Mon Jun 25, 2012 6:21 pm

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.
User avatar
jules
Fearless Leader
 
Posts: 17386
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: Jumpy Resizable Window

Postby Hanley » Mon Jun 25, 2012 7:10 pm

K. Maybe I can figure out a workaround. Thanks for the replies.
Hanley
JUCE Obsessive
 
Posts: 97
Joined: Wed Jun 29, 2011 3:46 am


Return to General JUCE discussion

Who is online

Users browsing this forum: Google Feedfetcher and 1 guest