From f6548d5e6eb5d7cc81c226221b4f1620cd021cb3 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 1 Mar 2013 17:17:57 +0000 Subject: Bug fix #34418 Fix for 2.66a Screencast could be started twice in a row, but it then also added two handlers for drawing an overlay circle around mouse cursor. After ending the screencast, this circle then kept being drawn. --- source/blender/editors/screen/screendump.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/screen') diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 1f7fee313b3..9cde62e8302 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -449,13 +449,21 @@ static void screenshot_endjob(void *sjv) static int screencast_exec(bContext *C, wmOperator *op) { + wmWindowManager *wm = CTX_wm_manager(C); + wmWindow *win = CTX_wm_window(C); bScreen *screen = CTX_wm_screen(C); - wmJob *wm_job = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), screen, "Screencast", 0, WM_JOB_TYPE_SCREENCAST); - ScreenshotJob *sj = MEM_callocN(sizeof(ScreenshotJob), "screenshot job"); + wmJob *wm_job; + ScreenshotJob *sj; + /* if called again, stop the running job */ + if (WM_jobs_test(wm, screen, WM_JOB_TYPE_SCREENCAST)) + WM_jobs_stop(wm, screen, screenshot_startjob); + + wm_job = WM_jobs_get(wm, win, screen, "Screencast", 0, WM_JOB_TYPE_SCREENCAST); + sj = MEM_callocN(sizeof(ScreenshotJob), "screenshot job"); + /* setup sj */ if (RNA_boolean_get(op->ptr, "full")) { - wmWindow *win = CTX_wm_window(C); sj->x = 0; sj->y = 0; sj->dumpsx = WM_window_pixels_x(win); @@ -470,7 +478,7 @@ static int screencast_exec(bContext *C, wmOperator *op) } sj->bmain = CTX_data_main(C); sj->scene = CTX_data_scene(C); - sj->wm = CTX_wm_manager(C); + sj->wm = wm; BKE_reports_init(&sj->reports, RPT_PRINT); -- cgit v1.2.3