add input focus, negate dx,dy for camera drag motion
authorGood Guy <[email protected]>
Sun, 9 Sep 2018 19:53:03 +0000 (13:53 -0600)
committerGood Guy <[email protected]>
Sun, 9 Sep 2018 19:53:03 +0000 (13:53 -0600)
cinelerra-5.1/cinelerra/canvas.C
cinelerra-5.1/cinelerra/cwindowgui.C
cinelerra-5.1/guicast/bcwindowbase.C
cinelerra-5.1/guicast/bcwindowbase.h

index 3e7ee0be96c1e6427b9e2f8140cee1d891514368..2a478d41a93c5ab04b3902001ee04d3870caf794 100644 (file)
@@ -773,6 +773,10 @@ void Canvas::create_canvas()
 
        if(video_on) get_canvas()->start_video();
 
+       get_canvas()->lock_window("Canvas::create_canvas 2");
+       get_canvas()->focus();
+       get_canvas()->unlock_window();
+
        unlock_canvas();
 }
 
@@ -928,26 +932,8 @@ int CanvasOutput::keypress_event()
 
 
 
-
-
-
-
-
-
-
-
-
-
-CanvasFullScreen::CanvasFullScreen(Canvas *canvas,
-    int w,
-    int h)
- : BC_FullScreen(canvas->subwindow,
-       w,
-       h,
-       BLACK,
-       0,
-       0,
-       0)
+CanvasFullScreen::CanvasFullScreen(Canvas *canvas, int w, int h)
+ : BC_FullScreen(canvas->subwindow, w, h, BLACK, 0, 0, 0)
 {
        this->canvas = canvas;
 }
@@ -957,32 +943,9 @@ CanvasFullScreen::~CanvasFullScreen()
 }
 
 
-
-
-
-
-
-
-
-
-
-
-
-CanvasXScroll::CanvasXScroll(EDL *edl,
-       Canvas *canvas,
-    int x,
-    int y,
-       int length,
-       int position,
-       int handle_length,
-    int pixels)
- : BC_ScrollBar(x,
-               y,
-               SCROLL_HORIZ,
-               pixels,
-               length,
-               position,
-               handle_length)
+CanvasXScroll::CanvasXScroll(EDL *edl, Canvas *canvas, int x, int y,
+       int length, int position, int handle_length, int pixels)
+ : BC_ScrollBar(x, y, SCROLL_HORIZ, pixels, length, position, handle_length)
 {
        this->canvas = canvas;
 }
@@ -1000,25 +963,9 @@ int CanvasXScroll::handle_event()
 }
 
 
-
-
-
-
-CanvasYScroll::CanvasYScroll(EDL *edl,
-       Canvas *canvas,
-    int x,
-    int y,
-       int length,
-       int position,
-       int handle_length,
-    int pixels)
- : BC_ScrollBar(x,
-               y,
-               SCROLL_VERT,
-               pixels,
-               length,
-               position,
-               handle_length)
+CanvasYScroll::CanvasYScroll(EDL *edl, Canvas *canvas, int x, int y,
+       int length, int position, int handle_length, int pixels)
+ : BC_ScrollBar(x, y, SCROLL_VERT, pixels, length, position, handle_length)
 {
        this->canvas = canvas;
 }
@@ -1036,10 +983,6 @@ int CanvasYScroll::handle_event()
 }
 
 
-
-
-
-
 CanvasFullScreenPopup::CanvasFullScreenPopup(Canvas *canvas)
  : BC_PopupMenu(0, 0, 0, "", 0)
 {
@@ -1074,12 +1017,6 @@ int CanvasSubWindowItem::handle_event()
 }
 
 
-
-
-
-
-
-
 CanvasPopup::CanvasPopup(Canvas *canvas)
  : BC_PopupMenu(0, 0, 0, "", 0)
 {
index 3b1d0ac8a05913895fb5aa0d6f78cc6ae38c9052..3e980b8b99308e7d89c99de872db4bc413af10cd 100644 (file)
@@ -2987,8 +2987,13 @@ int CWindowCanvas::test_bezier(int button_press,
                        {
                                last_center_x = gui->affected_x->get_value();
                                last_center_y = gui->affected_y->get_value();
-                               float x = gui->center_x + cursor_x - gui->x_origin;
-                               float y = gui->center_y + cursor_y - gui->y_origin;
+                               float dx = cursor_x - gui->x_origin;
+                               float dy = cursor_y - gui->y_origin;
+                               if(gui->current_operation == CWINDOW_CAMERA ) {
+                                       dx = -dx;  dy = -dy;
+                               }
+                               float x = gui->center_x + dx;
+                               float y = gui->center_y + dy;
                                gui->affected_x->set_value(x);
                                gui->affected_y->set_value(y);
                                if( !EQUIV(last_center_x, x) || !EQUIV(last_center_y, y) )
index 7de7c15d2d13573043729aa9d01dcf9c7d69ead9..724a44f772907222122912fcc26a51067041bf7b 100644 (file)
@@ -1357,7 +1357,7 @@ locking_message = event->xclient.message_type;
                                cursor_entered = 1;
                        }
                        if( cursor_entered )
-                               XSetInputFocus(display, win, RevertToParent, CurrentTime);
+                               focus();
                }
                event_win = event->xany.window;
                cursor_x = event->xcrossing.x;
@@ -4577,3 +4577,8 @@ void BC_WindowBase::flicker(int n, int ms)
        set_opaque();
 }
 
+void BC_WindowBase::focus()
+{
+       XSetInputFocus(top_level->display, top_level->win, RevertToParent, CurrentTime);
+}
+
index 336b96932d165ad2845f96f6fc4a95535643635c..ca73b39e61c696d37648cf3243243475ece56daa 100644 (file)
@@ -497,6 +497,7 @@ public:
        void slide_up(int distance);
        void slide_down(int distance);
        void flicker(int n=3, int ms=66);
+       void focus();
 
        int cycle_textboxes(int amount);