diff --git a/source/blender/editors/interface/interface_ops.cc b/source/blender/editors/interface/interface_ops.cc index 36469cfddd8..876463dcb70 100644 --- a/source/blender/editors/interface/interface_ops.cc +++ b/source/blender/editors/interface/interface_ops.cc @@ -2383,13 +2383,16 @@ static void UI_OT_list_start_filter(wmOperatorType *ot) static bool ui_view_focused_poll(bContext *C) { + const wmWindow *win = CTX_wm_window(C); + if (!(win && win->eventstate)) { + return false; + } + const ARegion *region = CTX_wm_region(C); if (!region) { return false; } - const wmWindow *win = CTX_wm_window(C); const uiViewHandle *view = UI_region_view_find_at(region, win->eventstate->xy, 0); - return view != nullptr; } @@ -2426,6 +2429,9 @@ static void UI_OT_view_start_filter(wmOperatorType *ot) static bool ui_view_drop_poll(bContext *C) { const wmWindow *win = CTX_wm_window(C); + if (!(win && win->eventstate)) { + return false; + } const ARegion *region = CTX_wm_region(C); if (region == nullptr) { return false; diff --git a/source/blender/editors/interface/view2d_ops.cc b/source/blender/editors/interface/view2d_ops.cc index c0976c24862..a4f01f16f6e 100644 --- a/source/blender/editors/interface/view2d_ops.cc +++ b/source/blender/editors/interface/view2d_ops.cc @@ -1868,17 +1868,17 @@ static short mouse_in_scroller_handle(int mouse, int sc_min, int sc_max, int sh_ static bool scroller_activate_poll(bContext *C) { + const wmWindow *win = CTX_wm_window(C); + if (!(win && win->eventstate)) { + return false; + } if (!view2d_poll(C)) { return false; } - - wmWindow *win = CTX_wm_window(C); ARegion *region = CTX_wm_region(C); View2D *v2d = ®ion->v2d; - wmEvent *event = win->eventstate; - /* Check if mouse in scroll-bars, if they're enabled. */ - return (UI_view2d_mouse_in_scrollers(region, v2d, event->xy) != 0); + return (UI_view2d_mouse_in_scrollers(region, v2d, win->eventstate->xy) != 0); } /* Initialize #wmOperator.customdata for scroller manipulation operator. */