avoid crashes running screendump and screen editing operators in background mode. (not that these would be useful but better not crash)

This commit is contained in:
Campbell Barton
2013-06-28 05:39:05 +00:00
parent 6d400423f9
commit aa9ffc0bc2
2 changed files with 4 additions and 5 deletions

View File

@@ -599,13 +599,12 @@ static int actionzone_area_poll(bContext *C)
wmWindow *win = CTX_wm_window(C);
ScrArea *sa = CTX_wm_area(C);
if (sa && win) {
if (sa && win && win->eventstate) {
const int *xy = &win->eventstate->x;
AZone *az;
int x = win->eventstate->x;
int y = win->eventstate->y;
for (az = sa->actionzones.first; az; az = az->next)
if (BLI_rcti_isect_pt(&az->rect, x, y))
if (BLI_rcti_isect_pt_v(&az->rect, xy))
return 1;
}
return 0;

View File

@@ -511,7 +511,7 @@ void SCREEN_OT_screencast(wmOperatorType *ot)
ot->invoke = WM_operator_confirm;
ot->exec = screencast_exec;
ot->poll = WM_operator_winactive;
ot->poll = screenshot_poll; /* shared poll */
ot->flag = 0;