olaf neophyte and de.po updates, valgrind tweaks, delete green lady, inkscape dpi=96
[goodguy/history.git] / cinelerra-5.1 / cinelerra / resizetrackthread.C
index 1c2eadc841c0ecd02f089a7b40f81e7469037301..f8e3de367561a23568d7089204a981b54cfd1d6b 100644 (file)
@@ -60,6 +60,12 @@ ResizeVTrackThread::~ResizeVTrackThread()
 
 void ResizeVTrackThread::start_window(int w, int h, int w1, int h1)
 {
+       if( window && running() ) {
+               window->lock_window();
+               window->raise_window();
+               window->unlock_window();
+               return;
+       }
        this->w = w;    this->h = h;
        this->w1 = w1;  this->h1 = h1;
        w_scale = h_scale = 1;
@@ -69,24 +75,18 @@ void ResizeVTrackThread::start_window(int w, int h, int w1, int h1)
 
 void ResizeVTrackThread::run()
 {
-       ResizeVTrackWindow *window = this->window =
-               new ResizeVTrackWindow(mwindow,
-                       this,
+       window = new ResizeVTrackWindow(mwindow, this,
                        mwindow->gui->get_abs_cursor_x(1),
                        mwindow->gui->get_abs_cursor_y(1));
        window->create_objects();
        int result = window->run_window();
-       this->window = 0;
-       delete window;
-
 
-       if(!result)
-       {
+       delete window;  window = 0;
+       if(!result) {
                update();
        }
 
-       if(((w % 4) ||
-               (h % 4)) &&
+       if(((w % 4) || (h % 4)) &&
                mwindow->edl->session->playback_config->vconfig->driver == PLAYBACK_X11_GL)
        {
                MainError::show_error(
@@ -118,9 +118,8 @@ ResizeVTrackWindow::~ResizeVTrackWindow()
 
 void ResizeVTrackWindow::create_objects()
 {
-       int x = 10, y = 10;
-
        lock_window("ResizeVTrackWindow::create_objects");
+       int x = 10, y = 10;
        BC_Title *size_title = new BC_Title(x, y, _("Size:"));
        add_subwindow(size_title);
        int x1 = x + size_title->get_w();
@@ -299,7 +298,8 @@ void ResizeTrackThread::start_window(Track *track)
 
 void ResizeTrackThread::update()
 {
-       mwindow->resize_track(track, w, h);
+       if( mwindow->edl->tracks->track_exists(track) )
+               mwindow->resize_track(track, w, h);
 }
 
 
@@ -340,7 +340,6 @@ ResizeAssetButton::ResizeAssetButton(AssetEditWindow *fwindow, int x, int y)
 {
        resize_asset_thread = 0;
         this->fwindow = fwindow;
-        set_underline(0);
 }
 
 ResizeAssetButton::~ResizeAssetButton()
@@ -350,7 +349,8 @@ ResizeAssetButton::~ResizeAssetButton()
 
 int ResizeAssetButton::handle_event()
 {
-       resize_asset_thread = new ResizeAssetThread(fwindow);
+       if( !resize_asset_thread )
+               resize_asset_thread = new ResizeAssetThread(fwindow);
        resize_asset_thread->start_window(fwindow->asset_edit->changed_params);
         return 1;
 }