Conditionally compile out the 'single threaded' stuff. It doesn't work very well...
[synfig.git] / synfig-studio / trunk / src / gtkmm / workarea.cpp
index c940d86..c4f8be6 100644 (file)
@@ -6,8 +6,8 @@
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
-**     Copyright 2006 Yue Shi Lai
-**     Copyright (c) 2007 Chris Moore
+**     Copyright (c) 2006 Yue Shi Lai
+**     Copyright (c) 2007, 2008 Chris Moore
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
@@ -828,18 +828,22 @@ WorkArea::~WorkArea()
                render_idle_func_id=0;
 }
 
+#ifdef SINGLE_THREADED
 bool
 WorkArea::get_updating()const
 {
        return App::single_threaded && async_renderer && async_renderer->updating;
 }
+#endif
 
+#ifdef SINGLE_THREADED
 void
 WorkArea::stop_updating(bool cancel)
 {
        async_renderer->stop();
        if (cancel) canceled_=true;
 }
+#endif
 
 void
 WorkArea::save_meta_data()
@@ -1164,7 +1168,7 @@ WorkArea::on_key_press_event(GdkEventKey* event)
                        break;
        }
 
-       synfigapp::Action::PassiveGrouper grouper(instance.get(),"Nudge");
+       synfigapp::Action::PassiveGrouper grouper(instance.get(),_("Nudge"));
 
        // Grid snap does not apply to nudging
        bool grid_snap_holder(get_grid_snap());
@@ -1199,8 +1203,6 @@ WorkArea::on_drawing_area_event(GdkEvent *event)
        bool is_mouse(false);
        Gdk::ModifierType modifier(Gdk::ModifierType(0));
 
-       drawing_area->grab_focus();
-
        // Handle input stuff
        if(
                event->any.type==GDK_MOTION_NOTIFY ||
@@ -1220,6 +1222,7 @@ WorkArea::on_drawing_area_event(GdkEvent *event)
                {
                        device=event->button.device;
                        modifier=Gdk::ModifierType(event->button.state);
+                       drawing_area->grab_focus();
                }
 
                // Make sure we recognize the device
@@ -1348,8 +1351,11 @@ WorkArea::on_drawing_area_event(GdkEvent *event)
 
 
                        selected_bezier=find_bezier(mouse_pos,radius,&bezier_click_pos);
-                       if(duck && duck->get_editable())
+                       if(duck)
                        {
+                               if (!duck->get_editable())
+                                       return true;
+
                                //get_selected_duck()->signal_user_click(0)();
                                //if(clicked_duck)clicked_duck->signal_user_click(0)();
 
@@ -1618,7 +1624,7 @@ WorkArea::on_drawing_area_event(GdkEvent *event)
                else
                if(dragging==DRAG_DUCK)
                {
-                       synfigapp::Action::PassiveGrouper grouper(instance.get(),"Move");
+                       synfigapp::Action::PassiveGrouper grouper(instance.get(),_("Move"));
                        dragging=DRAG_NONE;
                        //translate_selected_ducks(mouse_pos);
                        set_axis_lock(false);
@@ -2214,12 +2220,14 @@ public:
 bool
 studio::WorkArea::async_update_preview()
 {
+#ifdef SINGLE_THREADED
        if (get_updating())
        {
                stop_updating();
                queue_render_preview();
                return false;
        }
+#endif
 
        async_renderer=0;