Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_region_popup.c
| Show All 17 Lines | |||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_rect.h" | #include "BLI_rect.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "IMB_imbuf.h" | |||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "interface_intern.h" | #include "interface_intern.h" | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
| type.listener = ui_block_region_popup_window_listener; | type.listener = ui_block_region_popup_window_listener; | ||||
| } | } | ||||
| return handle; | return handle; | ||||
| } | } | ||||
| void ui_popup_block_free(bContext *C, uiPopupBlockHandle *handle) | void ui_popup_block_free(bContext *C, uiPopupBlockHandle *handle) | ||||
| { | { | ||||
| wmWindow *win = CTX_wm_window(C); | |||||
| if (win && win->scrim) { | |||||
| IMB_freeImBuf(win->scrim); | |||||
| win->scrim = NULL; | |||||
| } | |||||
| /* If this popup is created from a popover which does NOT have keep-open flag set, | /* If this popup is created from a popover which does NOT have keep-open flag set, | ||||
| * then close the popover too. We could extend this to other popup types too. */ | * then close the popover too. We could extend this to other popup types too. */ | ||||
| ARegion *region = handle->popup_create_vars.butregion; | ARegion *region = handle->popup_create_vars.butregion; | ||||
| if (region != NULL) { | if (region != NULL) { | ||||
| LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) { | LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) { | ||||
| if (block->handle && (block->flag & UI_BLOCK_POPOVER) && | if (block->handle && (block->flag & UI_BLOCK_POPOVER) && | ||||
| (block->flag & UI_BLOCK_KEEP_OPEN) == 0) { | (block->flag & UI_BLOCK_KEEP_OPEN) == 0) { | ||||
| uiPopupBlockHandle *menu = block->handle; | uiPopupBlockHandle *menu = block->handle; | ||||
| Show All 15 Lines | |||||