Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/screen/screen_ops.c
| Context not available. | |||||
| rect.xmax = rect.xmin + BLI_rcti_size_x(&rect) / U.pixelsize; | rect.xmax = rect.xmin + BLI_rcti_size_x(&rect) / U.pixelsize; | ||||
| rect.ymax = rect.ymin + BLI_rcti_size_y(&rect) / U.pixelsize; | rect.ymax = rect.ymin + BLI_rcti_size_y(&rect) / U.pixelsize; | ||||
| newwin = WM_window_open(C, &rect); | newwin = WM_window_open(C, &rect, WM_WINDOW_CUSTOM); | ||||
| if (newwin == NULL) { | if (newwin == NULL) { | ||||
| BKE_report(op->reports, RPT_ERROR, "Failed to open window!"); | BKE_report(op->reports, RPT_ERROR, "Failed to open window!"); | ||||
| goto finally; | goto finally; | ||||
| Context not available. | |||||
| /** \name Show User Preferences Operator | /** \name Show User Preferences Operator | ||||
| * \{ */ | * \{ */ | ||||
| static int userpref_show_invoke(bContext *C, wmOperator *op, const wmEvent *event) | static int userpref_show_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | ||||
| { | { | ||||
| int sizex = (500 + UI_NAVIGATION_REGION_WIDTH) * UI_DPI_FAC; | int sizex = (500 + UI_NAVIGATION_REGION_WIDTH) * UI_DPI_FAC; | ||||
| int sizey = 520 * UI_DPI_FAC; | int sizey = 520 * UI_DPI_FAC; | ||||
| /* changes context! */ | /* changes context! */ | ||||
| if (WM_window_open_temp(C, event->x, event->y, sizex, sizey, WM_WINDOW_USERPREFS) != NULL) { | if (WM_window_open_temp(C, sizex, sizey, WM_WINDOW_USERPREFS) != NULL) { | ||||
| /* The header only contains the editor switcher and looks empty. | /* The header only contains the editor switcher and looks empty. | ||||
| * So hiding in the temp window makes sense. */ | * So hiding in the temp window makes sense. */ | ||||
| ScrArea *area = CTX_wm_area(C); | ScrArea *area = CTX_wm_area(C); | ||||
| ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_HEADER); | ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_HEADER); | ||||
| region->flag |= RGN_FLAG_HIDDEN; | if (region) | ||||
| region->flag |= RGN_FLAG_HIDDEN; | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| else { | else { | ||||
| Context not available. | |||||
| /** \name Show Drivers Editor Operator | /** \name Show Drivers Editor Operator | ||||
| * \{ */ | * \{ */ | ||||
| static int drivers_editor_show_invoke(bContext *C, wmOperator *op, const wmEvent *event) | static int drivers_editor_show_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | ||||
| { | { | ||||
| PointerRNA ptr = {{NULL}}; | PointerRNA ptr = {{NULL}}; | ||||
| PropertyRNA *prop = NULL; | PropertyRNA *prop = NULL; | ||||
| Context not available. | |||||
| but = UI_context_active_but_prop_get(C, &ptr, &prop, &index); | but = UI_context_active_but_prop_get(C, &ptr, &prop, &index); | ||||
| /* changes context! */ | /* changes context! */ | ||||
| if (WM_window_open_temp(C, event->x, event->y, sizex, sizey, WM_WINDOW_DRIVERS) != NULL) { | if (WM_window_open_temp(C, sizex, sizey, WM_WINDOW_DRIVERS) != NULL) { | ||||
| /* activate driver F-Curve for the property under the cursor */ | /* activate driver F-Curve for the property under the cursor */ | ||||
| if (but) { | if (but) { | ||||
| FCurve *fcu; | FCurve *fcu; | ||||
| Context not available. | |||||