X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fassetpopup.C;h=b7aafa0dcec2445849db0afe14a6e9ced3162eb0;hb=60f8df69db9ddd8148bfc41a17bb0955b52a45e6;hp=d39aaa13e5c96be7ce326c0119bb8c2c1a402bb8;hpb=efc8fa7dc7ddcdeaa9398e09d81975a6ccf526fc;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/assetpopup.C b/cinelerra-5.1/cinelerra/assetpopup.C index d39aaa13..b7aafa0d 100644 --- a/cinelerra-5.1/cinelerra/assetpopup.C +++ b/cinelerra-5.1/cinelerra/assetpopup.C @@ -160,10 +160,13 @@ int AssetPopupInfo::handle_event() { int cur_x, cur_y; popup->gui->get_abs_cursor(cur_x, cur_y); - if( mwindow->session->drag_assets->size() ) { - AssetEdit *asset_edit = mwindow->awindow->get_asset_editor(); - asset_edit->edit_asset( - mwindow->session->drag_assets->values[0], cur_x, cur_y); + int n = mwindow->session->drag_assets->size(); + if( n > 0 ) { + for( int i=0; iawindow->get_asset_editor(); + asset_edit->edit_asset( + mwindow->session->drag_assets->values[i], cur_x-30*i, cur_y-30*i); + } } else if( mwindow->session->drag_clips->size() ) { popup->gui->awindow->clip_edit->edit_clip( @@ -241,7 +244,6 @@ AssetPopupView::~AssetPopupView() int AssetPopupView::handle_event() { VWindow *vwindow = mwindow->get_viewer(1, DEFAULT_VWINDOW); - vwindow->gui->lock_window("AssetPopupView::handle_event"); if( mwindow->session->drag_assets->total ) vwindow->change_source( @@ -251,7 +253,6 @@ int AssetPopupView::handle_event() vwindow->change_source( mwindow->session->drag_clips->values[0]); - vwindow->gui->unlock_window(); return 1; } @@ -273,8 +274,6 @@ int AssetPopupViewWindow::handle_event() VWindow *vwindow = mwindow->get_viewer(1); // TODO: create new vwindow or change current vwindow - vwindow->gui->lock_window("AssetPopupView::handle_event"); - if( mwindow->session->drag_assets->total ) vwindow->change_source( mwindow->session->drag_assets->values[0]); @@ -283,7 +282,6 @@ int AssetPopupViewWindow::handle_event() vwindow->change_source( mwindow->session->drag_clips->values[0]); - vwindow->gui->unlock_window(); return 1; } @@ -809,7 +807,8 @@ int SnapshotMenuItem::handle_event() double position = edl->local_session->get_selectionstart(1); int64_t source_position = (int64_t)(position * edl->get_frame_rate()); - ret = render_engine.vrender->process_buffer(frame, source_position, 0); + ret = !render_engine.vrender ? 1 : + render_engine.vrender->process_buffer(frame, source_position, 0); if( !ret ) ret = file.write_video_buffer(1); file.close_file(); @@ -965,6 +964,7 @@ int GrabshotPopup::grab_event(XEvent *event) int cw = lx1-lx0, ch = ly1-ly0; hide_window(); sync_display(); + grab_thread->done = 1; MWindow *mwindow = grab_thread->mwindow; Preferences *preferences = mwindow->preferences; @@ -996,12 +996,15 @@ int GrabshotPopup::grab_event(XEvent *event) asset->format = FILE_PPM; break; } + // no odd dimensions int rw = get_root_w(0), rh = get_root_h(0); if( cx < 0 ) { cw += cx; cx = 0; } if( cy < 0 ) { ch += cy; cy = 0; } if( cx+cw > rw ) cw = rw-cx; if( cy+ch > rh ) ch = rh-cy; + if( !cw || !ch ) return 1; + VFrame vframe(cw,ch, BC_RGB888); if( cx+cw < rw ) ++cw; if( cy+ch < rh ) ++ch; @@ -1040,7 +1043,6 @@ int GrabshotPopup::grab_event(XEvent *event) asset->remove_user(); } - grab_thread->done = 1; return 1; }