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:
authorJulian Eisel <eiseljulian@gmail.com>2019-07-30 23:19:41 +0300
committerJulian Eisel <eiseljulian@gmail.com>2019-07-30 23:19:41 +0300
commit9ac33e56a16e933cc8a1c16e8c477f843d452f21 (patch)
tree5b5febf49b4be5fac6d97f067dd92cf455d319f7 /source/blender/windowmanager/intern
parent091cc94379a2976176f0ae93721cfb2239a60e55 (diff)
parentfe47c7bf8435afee164896547067ee6092b4673a (diff)
Merge branch 'master' into soc-2019-openxr
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c35
-rw-r--r--source/blender/windowmanager/intern/wm_files.c16
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c5
-rw-r--r--source/blender/windowmanager/intern/wm_operator_props.c7
4 files changed, 51 insertions, 12 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index 8e15eb71395..b0b89fa074f 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -240,9 +240,14 @@ static void wm_region_test_render_do_draw(const Scene *scene,
}
}
+static bool wm_region_use_viewport_by_type(short space_type, short region_type)
+{
+ return (ELEM(space_type, SPACE_VIEW3D, SPACE_IMAGE) && region_type == RGN_TYPE_WINDOW);
+}
+
static bool wm_region_use_viewport(ScrArea *sa, ARegion *ar)
{
- return (ELEM(sa->spacetype, SPACE_VIEW3D, SPACE_IMAGE) && ar->regiontype == RGN_TYPE_WINDOW);
+ return wm_region_use_viewport_by_type(sa->spacetype, ar->regiontype);
}
/********************** draw all **************************/
@@ -1065,3 +1070,31 @@ void WM_redraw_windows(bContext *C)
CTX_wm_area_set(C, area_prev);
CTX_wm_region_set(C, ar_prev);
}
+
+/* -------------------------------------------------------------------- */
+/** \name Region Viewport Drawing
+ *
+ * This is needed for viewport drawing for operator use
+ * (where the viewport may not have drawn yet).
+ *
+ * Otherwise avoid using these sine they're exposing low level logic externally.
+ *
+ * \{ */
+
+void WM_draw_region_viewport_ensure(ARegion *ar, short space_type)
+{
+ bool use_viewport = wm_region_use_viewport_by_type(space_type, ar->regiontype);
+ wm_draw_region_buffer_create(ar, false, use_viewport);
+}
+
+void WM_draw_region_viewport_bind(ARegion *ar)
+{
+ wm_draw_region_bind(ar, 0);
+}
+
+void WM_draw_region_viewport_unbind(ARegion *ar)
+{
+ wm_draw_region_unbind(ar, 0);
+}
+
+/** \} */
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 48b09b0d329..3e965fc2f55 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -605,7 +605,6 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports)
/* assume automated tasks with background, don't write recent file list */
const bool do_history = (G.background == false) && (CTX_wm_manager(C)->op_undo_depth == 0);
bool success = false;
- int retval;
/* so we can get the error message */
errno = 0;
@@ -619,7 +618,7 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports)
/* first try to append data from exotic file formats... */
/* it throws error box when file doesn't exist and returns -1 */
/* note; it should set some error message somewhere... (ton) */
- retval = wm_read_exotic(filepath);
+ const int retval = wm_read_exotic(filepath);
/* we didn't succeed, now try to read Blender file */
if (retval == BKE_READ_EXOTIC_OK_BLEND) {
@@ -632,7 +631,7 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports)
/* confusing this global... */
G.relbase_valid = 1;
- retval = BKE_blendfile_read(
+ success = BKE_blendfile_read(
C,
filepath,
/* Loading preferences when the user intended to load a regular file is a security risk,
@@ -668,7 +667,7 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports)
wm_window_match_do(C, &wmbase, &bmain->wm, &bmain->wm);
WM_check(C); /* opens window(s), checks keymaps */
- if (retval != BKE_BLENDFILE_READ_FAIL) {
+ if (success) {
if (do_history) {
wm_history_file_update();
}
@@ -677,8 +676,6 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports)
const bool use_data = true;
const bool use_userdef = false;
wm_file_read_post(C, false, false, use_data, use_userdef, false);
-
- success = true;
}
#if 0
else if (retval == BKE_READ_EXOTIC_OK_OTHER) {
@@ -941,7 +938,7 @@ void wm_homefile_read(bContext *C,
.is_startup = true,
.skip_flags = skip_flags,
},
- NULL) != BKE_BLENDFILE_READ_FAIL;
+ NULL);
}
if (BLI_listbase_is_empty(&U.themes)) {
if (G.debug & G_DEBUG) {
@@ -1053,7 +1050,7 @@ void wm_homefile_read(bContext *C,
wm_window_match_do(C, &wmbase, &bmain->wm, &bmain->wm);
}
- if (use_factory_settings) {
+ if (use_userdef) {
/* Clear keymaps because the current default keymap may have been initialized
* from user preferences, which have been reset. */
for (wmWindowManager *wm = bmain->wm.first; wm; wm = wm->id.next) {
@@ -2956,7 +2953,8 @@ static void wm_block_file_close_save(bContext *C, void *arg_block, void *arg_dat
wmWindow *win = CTX_wm_window(C);
UI_popup_block_close(C, win, arg_block);
- if (save_images_when_file_is_closed) {
+ int modified_images_count = ED_image_save_all_modified_info(C, NULL);
+ if (modified_images_count > 0 && save_images_when_file_is_closed) {
if (ED_image_should_save_modified(C)) {
ReportList *reports = CTX_wm_reports(C);
ED_image_save_all_modified(C, reports);
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 6d8c7d045c0..df14609d29b 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -80,6 +80,8 @@
#include "RE_engine.h"
#include "RE_pipeline.h" /* RE_ free stuff */
+#include "IMB_thumbs.h"
+
#ifdef WITH_PYTHON
# include "BPY_extern.h"
#endif
@@ -302,6 +304,9 @@ void WM_init(bContext *C, int argc, const char **argv)
/* Call again to set from userpreferences... */
BLT_lang_set(NULL);
+ /* That one is generated on demand, we need to be sure it's clear on init. */
+ IMB_thumb_clear_translations();
+
if (!G.background) {
#ifdef WITH_INPUT_NDOF
diff --git a/source/blender/windowmanager/intern/wm_operator_props.c b/source/blender/windowmanager/intern/wm_operator_props.c
index c471cb6f922..f22b5d07686 100644
--- a/source/blender/windowmanager/intern/wm_operator_props.c
+++ b/source/blender/windowmanager/intern/wm_operator_props.c
@@ -340,8 +340,11 @@ void WM_operator_properties_gesture_box_ex(wmOperatorType *ot, bool deselect, bo
*/
void WM_operator_properties_use_cursor_init(wmOperatorType *ot)
{
- PropertyRNA *prop = RNA_def_boolean(
- ot->srna, "use_cursor_init", true, "Cursor Init", "Use initial cursor position");
+ PropertyRNA *prop = RNA_def_boolean(ot->srna,
+ "use_cursor_init",
+ true,
+ "Use Mouse Position",
+ "Allow the initial mouse position to be used");
RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN);
}