Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/editors/screen/screen_edit.c8
-rw-r--r--source/blender/windowmanager/intern/wm_window.c18
2 files changed, 19 insertions, 7 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index e1b5c355e3e..4d387ad0191 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -647,8 +647,12 @@ void ED_screen_refresh(wmWindowManager *wm, wmWindow *win)
/* Exception for background mode, we only need the screen context. */
if (!G.background) {
- /* header size depends on DPI, let's verify */
- WM_window_set_dpi(win);
+
+ /* Called even when creating the ghost window fails in #WM_window_open. */
+ if (win->ghostwin) {
+ /* Header size depends on DPI, let's verify. */
+ WM_window_set_dpi(win);
+ }
ED_screen_global_areas_refresh(win);
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index ce0f710f4c2..89f85caa729 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -49,6 +49,7 @@
#include "BKE_icons.h"
#include "BKE_layer.h"
#include "BKE_main.h"
+#include "BKE_report.h"
#include "BKE_screen.h"
#include "BKE_workspace.h"
@@ -914,7 +915,7 @@ int wm_window_close_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
-int wm_window_new_exec(bContext *C, wmOperator *UNUSED(op))
+int wm_window_new_exec(bContext *C, wmOperator *op)
{
wmWindow *win_src = CTX_wm_window(C);
ScrArea *area = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_TYPE_ANY, 0);
@@ -931,16 +932,23 @@ int wm_window_new_exec(bContext *C, wmOperator *UNUSED(op))
false,
WIN_ALIGN_PARENT_CENTER) != NULL);
- return ok ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
+ if (!ok) {
+ BKE_report(op->reports, RPT_ERROR, "Failed to create window");
+ return OPERATOR_CANCELLED;
+ }
+ return OPERATOR_FINISHED;
}
-int wm_window_new_main_exec(bContext *C, wmOperator *UNUSED(op))
+int wm_window_new_main_exec(bContext *C, wmOperator *op)
{
wmWindow *win_src = CTX_wm_window(C);
bool ok = (wm_window_copy_test(C, win_src, true, false) != NULL);
-
- return ok ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
+ if (!ok) {
+ BKE_report(op->reports, RPT_ERROR, "Failed to create window");
+ return OPERATOR_CANCELLED;
+ }
+ return OPERATOR_FINISHED;
}
/* fullscreen operator callback */