add edit clear submenu/clear hard_edges, fix tessy gl segv, mask toolgui layout,...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / mainsession.C
index d8e563d6b3a9411c7d3ceb2c32a9b0ecfbf40275..e40f343efbc16adc8a414a8c559a971442186c82 100644 (file)
@@ -56,18 +56,19 @@ MainSession::MainSession(MWindow *mwindow)
        drag_clips = new ArrayList<EDL*>;
        drag_edits = new ArrayList<Edit*>;
        drag_edit = 0;
+       drag_group = 0;
+       drag_group_edit = 0;
+       drag_group_position = 0;
+       drag_group_first_track = 0;
+       group_number = 1;
        clip_number = 1;
        brender_end = 0;
        cwindow_controls = 1;
        trim_edits = 0;
        current_tip = -1;
-       drag_handle = 0;
-       cwindow_fullscreen = 0;
-       rwindow_fullscreen = 0;
-       vwindow_fullscreen = 0;
-       zwindow_fullscreen = 0;
        selected_zwindow = -1;
        actual_frame_rate = 0;
+       title_bar_alpha = 0;
        window_config = 0;
        a_x11_host[0] = 0;
        b_x11_host[0] = 0;
@@ -124,6 +125,8 @@ MainSession::~MainSession()
        delete drag_auto_gang;
        delete drag_clips;
        delete drag_edits;
+       if( drag_group )
+               drag_group->remove_user();
 }
 
 void MainSession::boundaries()
@@ -198,9 +201,42 @@ void MainSession::default_window_positions(int window_config)
        int border_bottom = display_info.get_bottom_border();
 
        int dual_head = screens > 1 ? 1 : 0;
-       int right_w = root_w;
+       int left_w = 0, right_w = root_w;
+       int xin_screens = display_info.get_xinerama_screens();
+       if( xin_screens > 1 ) {
+               dual_head = 1;
+               int x, y, w, h;
+               for( int s=0; s<xin_screens; ++s ) {
+                       if( display_info.xinerama_geometry(s, x, y, w, h) )
+                               continue;
+                       if( !y && !x ) {
+                               left_w = w;
+                               break;
+                       }
+               }
+               if( left_w > 0 ) {
+                       for( int s=0; s<xin_screens; ++s ) {
+                               if( display_info.xinerama_geometry(s, x, y, w, h) )
+                                       continue;
+                               if( !y && x == left_w ) {
+                                       right_w = w;
+                                       screens = 2;
+                                       break;
+                               }
+                       }
+                       if( window_config == 1 ) {
+                               root_x = left_w;
+                               root_w = right_w;
+                       }
+                       else {
+                       // use same aspect ratio to compute left height
+                               root_w = left_w;
+                               root_h = (root_w*root_h) / right_w;
+                       }
+               }
+       }
 // Wider than 16:9, narrower than dual head
-       if( screens < 2 && (float)root_w / root_h > 1.8) {
+       if( screens < 2 && (float)root_w / root_h > 1.8 ) {
                dual_head = 1;
                switch( root_h ) {
                case 600:  right_w = 800;   break;
@@ -450,6 +486,7 @@ int MainSession::load_defaults(BC_Hash *defaults)
 
        current_tip = defaults->get("CURRENT_TIP", current_tip);
        actual_frame_rate = defaults->get("ACTUAL_FRAME_RATE", (float)-1);
+       title_bar_alpha = defaults->get("TITLE_BAR_ALPHA", (float)1);
 
        boundaries();
        return 0;
@@ -569,6 +606,7 @@ int MainSession::save_defaults(BC_Hash *defaults)
        defaults->update("TRANSITIONDIALOG_H", transitiondialog_h);
 
        defaults->update("ACTUAL_FRAME_RATE", actual_frame_rate);
+       defaults->update("TITLE_BAR_ALPHA", title_bar_alpha);
        defaults->update("CURRENT_TIP", current_tip);