svn merge ^/trunk/blender -r49890:49917
[blender.git] / source / blender / editors / interface / interface_templates.c
index 5997bd77699e25b422d340a009e85c23c7d5661b..450c4c8920e7b14f2284943fa539007d09ce4bf6 100644 (file)
@@ -2595,7 +2595,7 @@ static void do_running_jobs(bContext *C, void *UNUSED(arg), int event)
                        WM_operator_name_call(C, "SCREEN_OT_animation_play", WM_OP_INVOKE_SCREEN, NULL);
                        break;
                case B_STOPCOMPO:
-                       WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL);
+                       WM_jobs_stop(CTX_wm_manager(C), CTX_data_scene(C), NULL);
                        break;
                case B_STOPSEQ:
                        WM_jobs_stop(CTX_wm_manager(C), CTX_wm_area(C), NULL);
@@ -2620,29 +2620,30 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
 
        uiBlockSetHandleFunc(block, do_running_jobs, NULL);
 
-       if (sa->spacetype == SPACE_NODE) {
-               if (WM_jobs_test(wm, sa))
-                       owner = sa;
-               handle_event = B_STOPCOMPO;
-       }
-       else if (sa->spacetype == SPACE_SEQ) {
-               if (WM_jobs_test(wm, sa))
+       if (sa->spacetype == SPACE_SEQ) {
+               if (WM_jobs_test(wm, sa, WM_JOB_TYPE_ANY))
                        owner = sa;
                handle_event = B_STOPSEQ;
        }
        else if (sa->spacetype == SPACE_CLIP) {
-               if (WM_jobs_test(wm, sa))
+               if (WM_jobs_test(wm, sa, WM_JOB_TYPE_ANY))
                        owner = sa;
                handle_event = B_STOPCLIP;
        }
        else {
                Scene *scene;
                /* another scene can be rendering too, for example via compositor */
-               for (scene = CTX_data_main(C)->scene.first; scene; scene = scene->id.next)
-                       if (WM_jobs_test(wm, scene))
+               for (scene = CTX_data_main(C)->scene.first; scene; scene = scene->id.next) {
+                       if (WM_jobs_test(wm, scene, WM_JOB_TYPE_RENDER)) {
+                               handle_event = B_STOPRENDER;
                                break;
+                       }
+                       else if (WM_jobs_test(wm, scene, WM_JOB_TYPE_COMPOSITE)) {
+                               handle_event = B_STOPCOMPO;
+                               break;
+                       }
+               }
                owner = scene;
-               handle_event = B_STOPRENDER;
        }
 
        if (owner) {
@@ -2658,7 +2659,7 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
                
                uiLayoutRow(layout, FALSE);
        }
-       if (WM_jobs_test(wm, screen))
+       if (WM_jobs_test(wm, screen, WM_JOB_TYPE_SCREENCAST))
                uiDefIconTextBut(block, BUT, B_STOPCAST, ICON_CANCEL, IFACE_("Capture"), 0, 0, 85, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0,
                                 TIP_("Stop screencast"));
        if (screen->animtimer)