fullscreen tweaks, vwdw refresh frame scale, cleanup
[goodguy/history.git] / cinelerra-5.1 / cinelerra / canvas.C
index dc6d44a58e0a13032704219c1dd666e96ab4b8d2..3e7ee0be96c1e6427b9e2f8140cee1d891514368 100644 (file)
@@ -739,23 +739,8 @@ void Canvas::create_canvas()
                        wdw->stop_video();
                }
 
-               int x = subwindow->get_screen_x(0, -1);
-               int y = subwindow->get_screen_y(0, -1);
-               int w = root_w;
-               int h = root_h;
-               if( mwindow->screens == 1 && root_w > scr_w0 ) {
-                       // Xinerama
-                       if( subwindow->get_x() >= scr_w0 ) {
-                               // assumes right side is the big one
-                               w = root_w - scr_w0;
-                               h = root_h;
-                       }
-                       else {
-                               // use same aspect ratio to compute left height
-                               w = scr_w0;
-                               h = (w*root_h) / (root_w-scr_w0);
-                       }
-               }
+               int x, y, w, h;
+               wdw->get_fullscreen_geometry(x, y, w, h);
 
                if( canvas_fullscreen )
                {
@@ -823,7 +808,6 @@ int Canvas::button_press_event_base(BC_WindowBase *caller)
 
 int Canvas::keypress_event(BC_WindowBase *caller)
 {
-       int caller_is_canvas = (caller == get_canvas());
        int key = caller->get_keypress();
        switch( key ) {
        case 'f':
@@ -832,13 +816,13 @@ int Canvas::keypress_event(BC_WindowBase *caller)
                        stop_fullscreen();
                else
                        start_fullscreen();
-               if(!caller_is_canvas) caller->lock_window("Canvas::keypress_event 1");
+               caller->lock_window("Canvas::keypress_event 1");
                break;
        case ESC:
                caller->unlock_window();
                if(get_fullscreen())
                        stop_fullscreen();
-               if(!caller_is_canvas) caller->lock_window("Canvas::keypress_event 2");
+               caller->lock_window("Canvas::keypress_event 2");
                break;
        default:
                return 0;
@@ -914,17 +898,17 @@ CanvasOutput::~CanvasOutput()
 
 int CanvasOutput::cursor_leave_event()
 {
-       return canvas->cursor_leave_event_base(this);
+       return canvas->cursor_leave_event_base(canvas->get_canvas());
 }
 
 int CanvasOutput::cursor_enter_event()
 {
-       return canvas->cursor_enter_event_base(this);
+       return canvas->cursor_enter_event_base(canvas->get_canvas());
 }
 
 int CanvasOutput::button_press_event()
 {
-       return canvas->button_press_event_base(this);
+       return canvas->button_press_event_base(canvas->get_canvas());
 }
 
 int CanvasOutput::button_release_event()
@@ -939,7 +923,7 @@ int CanvasOutput::cursor_motion_event()
 
 int CanvasOutput::keypress_event()
 {
-       return canvas->keypress_event(this);
+       return canvas->keypress_event(canvas->get_canvas());
 }