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:
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r--source/blender/windowmanager/intern/Makefile1
-rw-r--r--source/blender/windowmanager/intern/wm.c4
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c65
-rw-r--r--source/blender/windowmanager/intern/wm_files.c62
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c5
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c127
-rw-r--r--source/blender/windowmanager/intern/wm_window.c8
7 files changed, 131 insertions, 141 deletions
diff --git a/source/blender/windowmanager/intern/Makefile b/source/blender/windowmanager/intern/Makefile
index f4d65975d43..823423cc28b 100644
--- a/source/blender/windowmanager/intern/Makefile
+++ b/source/blender/windowmanager/intern/Makefile
@@ -58,6 +58,7 @@ CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../blenloader
CPPFLAGS += -I../../gpu
CPPFLAGS += -I../../render/extern/include
+CPPFLAGS += -I../../radiosity/extern/include
CPPFLAGS += -I../../../kernel/gen_system
CPPFLAGS += -I../../blenfont
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index 38cf39c2081..85f8a647826 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -69,7 +69,7 @@ void WM_operator_free(wmOperator *op)
MEM_freeN(op->properties);
}
- if(op->reports && (op->flag & OPERATOR_REPORT_FREE)) {
+ if(op->reports) {
BKE_reports_clear(op->reports);
MEM_freeN(op->reports);
}
@@ -108,7 +108,7 @@ void wm_operator_register(bContext *C, wmOperator *op)
MEM_freeN(buf);
/* so the console is redrawn */
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL);
+ WM_event_add_notifier(C, NC_CONSOLE|ND_CONSOLE_REPORT, NULL);
}
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 3c03d24ca93..f0d9f8c0989 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -52,7 +52,6 @@
#include "BKE_pointcache.h"
#include "ED_fileselect.h"
-#include "ED_info.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_util.h"
@@ -130,7 +129,7 @@ static wmNotifier *wm_notifier_next(wmWindowManager *wm)
void wm_event_do_notifiers(bContext *C)
{
wmWindowManager *wm= CTX_wm_manager(C);
- wmNotifier *note, *next;
+ wmNotifier *note;
wmWindow *win;
if(wm==NULL)
@@ -142,9 +141,7 @@ void wm_event_do_notifiers(bContext *C)
CTX_wm_window_set(C, win);
- for(note= wm->queue.first; note; note= next) {
- next= note->next;
-
+ for(note= wm->queue.first; note; note= note->next) {
if(note->category==NC_WM) {
if( ELEM(note->data, ND_FILEREAD, ND_FILESAVE)) {
wm->file_saved= 1;
@@ -177,10 +174,6 @@ void wm_event_do_notifiers(bContext *C)
do_anim= 1;
}
}
- if(ELEM4(note->category, NC_SCENE, NC_OBJECT, NC_GEOM, NC_SCENE)) {
- ED_info_stats_clear(CTX_data_scene(C));
- WM_event_add_notifier(C, NC_SPACE|ND_SPACE_INFO, NULL);
- }
}
if(do_anim) {
/* depsgraph gets called, might send more notifiers */
@@ -345,12 +338,11 @@ static wmOperator *wm_operator_create(wmWindowManager *wm, wmOperatorType *ot, P
/* initialize error reports */
if (reports) {
- op->reports= reports; /* must be initialized already */
+ op->reports= reports; /* must be initialized alredy */
}
else {
op->reports= MEM_mallocN(sizeof(ReportList), "wmOperatorReportList");
BKE_reports_init(op->reports, RPT_STORE);
- op->flag |= OPERATOR_REPORT_FREE;
}
/* recursive filling of operator macro list */
@@ -393,13 +385,13 @@ static void wm_region_mouse_co(bContext *C, wmEvent *event)
}
}
-static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, PointerRNA *properties, ReportList *reports)
+static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, PointerRNA *properties)
{
wmWindowManager *wm= CTX_wm_manager(C);
int retval= OPERATOR_PASS_THROUGH;
if(wm_operator_poll(C, ot)) {
- wmOperator *op= wm_operator_create(wm, ot, properties, reports); /* if reports==NULL, theyll be initialized */
+ wmOperator *op= wm_operator_create(wm, ot, properties, NULL);
if((G.f & G_DEBUG) && event && event->type!=MOUSEMOVE)
printf("handle evt %d win %d op %s\n", event?event->type:0, CTX_wm_screen(C)->subwinactive, ot->idname);
@@ -443,12 +435,10 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P
return retval;
}
-/* WM_operator_name_call is the main accessor function
- * this is for python to access since its done the operator lookup
- *
- * invokes operator in context */
-static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, int context, PointerRNA *properties, ReportList *reports)
+/* invokes operator in context */
+int WM_operator_name_call(bContext *C, const char *opstring, int context, PointerRNA *properties)
{
+ wmOperatorType *ot= WM_operatortype_find(opstring, 0);
wmWindow *window= CTX_wm_window(C);
wmEvent *event;
@@ -476,7 +466,7 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, int contex
CTX_wm_region_set(C, ar1);
}
- retval= wm_operator_invoke(C, ot, event, properties, reports);
+ retval= wm_operator_invoke(C, ot, event, properties);
/* set region back */
CTX_wm_region_set(C, ar);
@@ -491,7 +481,7 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, int contex
ARegion *ar= CTX_wm_region(C);
CTX_wm_region_set(C, NULL);
- retval= wm_operator_invoke(C, ot, event, properties, reports);
+ retval= wm_operator_invoke(C, ot, event, properties);
CTX_wm_region_set(C, ar);
return retval;
@@ -506,7 +496,7 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, int contex
CTX_wm_region_set(C, NULL);
CTX_wm_area_set(C, NULL);
- retval= wm_operator_invoke(C, ot, event, properties, reports);
+ retval= wm_operator_invoke(C, ot, event, properties);
CTX_wm_region_set(C, ar);
CTX_wm_area_set(C, area);
@@ -515,45 +505,32 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, int contex
case WM_OP_EXEC_DEFAULT:
event= NULL; /* pass on without break */
case WM_OP_INVOKE_DEFAULT:
- return wm_operator_invoke(C, ot, event, properties, reports);
+ return wm_operator_invoke(C, ot, event, properties);
}
}
return 0;
}
-
-/* invokes operator in context */
-int WM_operator_name_call(bContext *C, const char *opstring, int context, PointerRNA *properties)
-{
- wmOperatorType *ot= WM_operatortype_find(opstring, 0);
- if(ot)
- return wm_operator_call_internal(C, ot, context, properties, NULL);
-
- return 0;
-}
-
/* Similar to WM_operator_name_call called with WM_OP_EXEC_DEFAULT context.
- wmOperatorType is used instead of operator name since python alredy has the operator type
- poll() must be called by python before this runs.
- reports can be passed to this function (so python can report them as exceptions)
*/
-int WM_operator_call_py(bContext *C, wmOperatorType *ot, int context, PointerRNA *properties, ReportList *reports)
+int WM_operator_call_py(bContext *C, wmOperatorType *ot, PointerRNA *properties, ReportList *reports)
{
- int retval= OPERATOR_CANCELLED;
-
-#if 0
- wmOperator *op;
wmWindowManager *wm= CTX_wm_manager(C);
- op= wm_operator_create(wm, ot, properties, reports);
-
+ wmOperator *op= wm_operator_create(wm, ot, properties, reports);
+ int retval= OPERATOR_CANCELLED;
+
if (op->type->exec)
retval= op->type->exec(C, op);
else
printf("error \"%s\" operator has no exec function, python cannot call it\n", op->type->name);
-#endif
-
- retval= wm_operator_call_internal(C, ot, context, properties, reports);
+
+ if (reports)
+ op->reports= NULL; /* dont let the operator free reports passed to this function */
+ WM_operator_free(op);
return retval;
}
@@ -836,7 +813,7 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
wmOperatorType *ot= WM_operatortype_find(event->keymap_idname, 0);
if(ot)
- retval= wm_operator_invoke(C, ot, event, properties, NULL);
+ retval= wm_operator_invoke(C, ot, event, properties);
}
if(retval & OPERATOR_PASS_THROUGH)
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index a6e38a61e0f..9c30c99bbdd 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -37,8 +37,8 @@
#define _WIN32_IE 0x0400 /* minimal requirements for SHGetSpecialFolderPath on MINGW MSVC has this defined already */
#endif
#include <shlobj.h> /* for SHGetSpecialFolderPath, has to be done before BLI_winstuff because 'near' is disabled through BLI_windstuff */
-#include <process.h> /* getpid */
#include "BLI_winstuff.h"
+#include <process.h> /* getpid */
#else
#include <unistd.h> /* getpid */
#endif
@@ -96,7 +96,6 @@
#include "wm.h"
#include "wm_window.h"
-static void writeBlog(void);
/* To be able to read files without windows closing, opening, moving
we try to prepare for worst case:
@@ -257,10 +256,7 @@ void WM_read_file(bContext *C, char *name, ReportList *reports)
if(retval==2) wm_init_userdef(); // in case a userdef is read from regular .blend
- if (retval!=0) {
- G.relbase_valid = 1;
- writeBlog();
- }
+ if (retval!=0) G.relbase_valid = 1;
// XXX undo_editmode_clear();
BKE_reset_undo();
@@ -388,7 +384,7 @@ void WM_read_autosavefile(bContext *C)
void read_Blog(void)
{
- char name[FILE_MAX];
+ char name[FILE_MAX], filename[FILE_MAX];
LinkNode *l, *lines;
struct RecentFile *recent;
char *line;
@@ -420,6 +416,58 @@ void read_Blog(void)
BLI_free_file_lines(lines);
+#ifdef WIN32
+ /* Add the drive names to the listing */
+ {
+ __int64 tmp;
+ char folder[MAX_PATH];
+ char tmps[4];
+ int i;
+
+ tmp= GetLogicalDrives();
+
+ for (i=2; i < 26; i++) {
+ if ((tmp>>i) & 1) {
+ tmps[0]='a'+i;
+ tmps[1]=':';
+ tmps[2]='\\';
+ tmps[3]=0;
+
+// XX fsmenu_insert_entry(tmps, 0, 0);
+ }
+ }
+
+ /* Adding Desktop and My Documents */
+// XXX fsmenu_append_separator();
+
+ SHGetSpecialFolderPath(0, folder, CSIDL_PERSONAL, 0);
+// XXX fsmenu_insert_entry(folder, 0, 0);
+ SHGetSpecialFolderPath(0, folder, CSIDL_DESKTOPDIRECTORY, 0);
+// XXX fsmenu_insert_entry(folder, 0, 0);
+
+// XXX fsmenu_append_separator();
+ }
+#endif
+
+ BLI_make_file_string(G.sce, name, BLI_gethome(), ".Bfs");
+ lines= BLI_read_file_as_lines(name);
+
+ for (l= lines; l; l= l->next) {
+ char *line= l->link;
+
+ if (!BLI_streq(line, "")) {
+// XXX fsmenu_insert_entry(line, 0, 1);
+ }
+ }
+
+// XXX fsmenu_append_separator();
+
+ /* add last saved file */
+ BLI_split_dirfile(G.sce, name, filename); /* G.sce shouldn't be relative */
+
+// XXX fsmenu_insert_entry(name, 0, 0);
+
+ BLI_free_file_lines(lines);
}
static void writeBlog(void)
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 9a268f8be17..ee826d5f57e 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -266,8 +266,6 @@ void WM_exit(bContext *C)
CTX_free(C);
- SYS_DeleteSystem(SYS_GetSystem());
-
if(MEM_get_memory_blocks_in_use()!=0) {
printf("Error Totblock: %d\n", MEM_get_memory_blocks_in_use());
MEM_printmemlist();
@@ -284,6 +282,9 @@ void WM_exit(bContext *C)
}
#endif
+
+ SYS_DeleteSystem(SYS_GetSystem());
+
exit(G.afbreek==1);
}
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 0913d58258f..2e813bac37d 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -91,12 +91,10 @@ wmOperatorType *WM_operatortype_find(const char *idname, int quiet)
char idname_bl[OP_MAX_TYPENAME]; // XXX, needed to support python style names without the _OT_ syntax
WM_operator_bl_idname(idname_bl, idname);
-
- if (idname_bl[0]) {
- for(ot= global_ops.first; ot; ot= ot->next) {
- if(strncmp(ot->idname, idname_bl, OP_MAX_TYPENAME)==0)
- return ot;
- }
+
+ for(ot= global_ops.first; ot; ot= ot->next) {
+ if(strncmp(ot->idname, idname_bl, OP_MAX_TYPENAME)==0)
+ return ot;
}
if(!quiet)
@@ -111,12 +109,10 @@ wmOperatorType *WM_operatortype_exists(const char *idname)
char idname_bl[OP_MAX_TYPENAME]; // XXX, needed to support python style names without the _OT_ syntax
WM_operator_bl_idname(idname_bl, idname);
-
- if(idname_bl[0]) {
- for(ot= global_ops.first; ot; ot= ot->next) {
- if(strncmp(ot->idname, idname_bl, OP_MAX_TYPENAME)==0)
- return ot;
- }
+
+ for(ot= global_ops.first; ot; ot= ot->next) {
+ if(strncmp(ot->idname, idname_bl, OP_MAX_TYPENAME)==0)
+ return ot;
}
return NULL;
}
@@ -326,25 +322,21 @@ void WM_operator_py_idname(char *to, const char *from)
/* some.op -> SOME_OT_op */
void WM_operator_bl_idname(char *to, const char *from)
{
- if (from) {
- char *sep= strchr(from, '.');
+ char *sep= strchr(from, '.');
- if(sep) {
- int i, ofs= (sep-from);
+ if(sep) {
+ int i, ofs= (sep-from);
- for(i=0; i<ofs; i++)
- to[i]= toupper(from[i]);
+ for(i=0; i<ofs; i++)
+ to[i]= toupper(from[i]);
- BLI_strncpy(to+ofs, "_OT_", OP_MAX_TYPENAME);
- BLI_strncpy(to+(ofs+4), sep+1, OP_MAX_TYPENAME);
- }
- else {
- /* should not happen but support just incase */
- BLI_strncpy(to, from, OP_MAX_TYPENAME);
- }
+ BLI_strncpy(to+ofs, "_OT_", OP_MAX_TYPENAME);
+ BLI_strncpy(to+(ofs+4), sep+1, OP_MAX_TYPENAME);
+ }
+ else {
+ /* should not happen but support just incase */
+ BLI_strncpy(to, from, OP_MAX_TYPENAME);
}
- else
- to[0]= 0;
}
/* print a string representation of the operator, with the args that it runs
@@ -448,24 +440,13 @@ void WM_operator_properties_free(PointerRNA *ptr)
/* ************ default op callbacks, exported *********** */
/* invoke callback, uses enum property named "type" */
+/* only weak thing is the fixed property name... */
int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- PropertyRNA *prop;
+ PropertyRNA *prop= RNA_struct_find_property(op->ptr, "type");
uiPopupMenu *pup;
uiLayout *layout;
- prop= RNA_struct_find_property(op->ptr, "type");
-
- if(!prop) {
- RNA_STRUCT_BEGIN(op->ptr, findprop) {
- if(RNA_property_type(findprop) == PROP_ENUM) {
- prop= findprop;
- break;
- }
- }
- RNA_STRUCT_END;
- }
-
if(prop==NULL) {
printf("WM_menu_invoke: %s has no \"type\" enum property\n", op->type->idname);
}
@@ -475,7 +456,7 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *event)
else {
pup= uiPupMenuBegin(C, op->type->name, 0);
layout= uiPupMenuLayout(pup);
- uiItemsEnumO(layout, op->type->idname, (char*)RNA_property_identifier(prop));
+ uiItemsEnumO(layout, op->type->idname, "type");
uiPupMenuEnd(C, pup);
}
@@ -739,7 +720,6 @@ int wm_search_menu_poll(bContext *C)
{
if(CTX_wm_window(C)==NULL) return 0;
if(CTX_wm_area(C) && CTX_wm_area(C)->spacetype==SPACE_CONSOLE) return 0; // XXX - so we can use the shortcut in the console
- if(CTX_wm_area(C) && CTX_wm_area(C)->spacetype==SPACE_TEXT) return 0; // XXX - so we can use the spacebar in the text editor
return 1;
}
@@ -761,6 +741,7 @@ static void WM_OT_window_duplicate(wmOperatorType *ot)
ot->name= "Duplicate Window";
ot->idname= "WM_OT_window_duplicate";
+ ot->invoke= WM_operator_confirm;
ot->exec= wm_window_duplicate_op;
ot->poll= WM_operator_winactive;
}
@@ -833,12 +814,22 @@ static EnumPropertyItem *open_recentfile_itemf(bContext *C, PointerRNA *ptr, int
struct RecentFile *recent;
int totitem= 0, i, ofs= 0;
+ if(G.sce[0]) {
+ tmp.value= 1;
+ tmp.identifier= G.sce;
+ tmp.name= G.sce;
+ RNA_enum_item_add(&item, &totitem, &tmp);
+ ofs = 1;
+ }
+
/* dynamically construct enum */
for(recent = G.recent_files.first, i=0; (i<U.recent_files) && (recent); recent = recent->next, i++) {
- tmp.value= i+ofs+1;
- tmp.identifier= recent->filename;
- tmp.name= recent->filename;
- RNA_enum_item_add(&item, &totitem, &tmp);
+ if(strcmp(recent->filename, G.sce)) {
+ tmp.value= i+ofs+1;
+ tmp.identifier= recent->filename;
+ tmp.name= recent->filename;
+ RNA_enum_item_add(&item, &totitem, &tmp);
+ }
}
RNA_enum_item_end(&item, &totitem);
@@ -878,17 +869,10 @@ static void untitled(char *name)
}
}
-static void load_set_load_ui(wmOperator *op)
-{
- if(!RNA_property_is_set(op->ptr, "load_ui"))
- RNA_boolean_set(op->ptr, "load_ui", !(U.flag & USER_FILENOUI));
-}
static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
RNA_string_set(op->ptr, "filename", G.sce);
- load_set_load_ui(op);
-
WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL;
@@ -897,14 +881,7 @@ static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event)
static int wm_open_mainfile_exec(bContext *C, wmOperator *op)
{
char filename[FILE_MAX];
-
RNA_string_get(op->ptr, "filename", filename);
- load_set_load_ui(op);
-
- if(RNA_boolean_get(op->ptr, "load_ui"))
- G.fileflags &= ~G_FILE_NO_UI;
- else
- G.fileflags |= G_FILE_NO_UI;
// XXX wm in context is not set correctly after WM_read_file -> crash
// do it before for now, but is this correct with multiple windows?
@@ -925,8 +902,6 @@ static void WM_OT_open_mainfile(wmOperatorType *ot)
ot->poll= WM_operator_winactive;
WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE);
-
- RNA_def_boolean(ot->srna, "load_ui", 1, "Load UI", "Load user interface setup in the .blend file.");
}
static int wm_recover_last_session_exec(bContext *C, wmOperator *op)
@@ -1060,6 +1035,7 @@ static void WM_OT_window_fullscreen_toggle(wmOperatorType *ot)
ot->name= "Toggle Fullscreen";
ot->idname= "WM_OT_window_fullscreen_toggle";
+ ot->invoke= WM_operator_confirm;
ot->exec= wm_window_fullscreen_toggle_op;
ot->poll= WM_operator_winactive;
}
@@ -1091,7 +1067,7 @@ static void WM_OT_exit_blender(wmOperatorType *ot)
*/
void *WM_paint_cursor_activate(wmWindowManager *wm, int (*poll)(bContext *C),
- wmPaintCursorDraw draw, void *customdata)
+ void (*draw)(bContext *C, int, int, void *customdata), void *customdata)
{
wmPaintCursor *pc= MEM_callocN(sizeof(wmPaintCursor), "paint cursor");
@@ -1918,28 +1894,19 @@ void wm_window_keymap(wmWindowManager *wm)
/* note, this doesn't replace existing keymap items */
WM_keymap_verify_item(keymap, "WM_OT_window_duplicate", WKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
- #ifdef __APPLE__
- WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_OSKEY, 0);
- WM_keymap_add_item(keymap, "WM_OT_open_recentfile", OKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0);
- WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_OSKEY, 0);
- WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_OSKEY, 0);
- WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0);
- WM_keymap_add_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_OSKEY, 0);
- #endif
- WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_CTRL, 0);
- WM_keymap_add_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_CTRL, 0);
- WM_keymap_add_item(keymap, "WM_OT_open_recentfile", OKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
- WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_CTRL, 0);
- WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_CTRL, 0);
- WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
-
+ WM_keymap_verify_item(keymap, "WM_OT_read_homefile", XKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_verify_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_verify_item(keymap, "WM_OT_open_recentfile", OKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_verify_item(keymap, "WM_OT_open_mainfile", F1KEY, KM_PRESS, 0, 0);
+ WM_keymap_verify_item(keymap, "WM_OT_save_mainfile", WKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_verify_item(keymap, "WM_OT_save_as_mainfile", F2KEY, KM_PRESS, 0, 0);
WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, KM_SHIFT, 0);
- WM_keymap_add_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_verify_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_CTRL, 0);
/* debug/testing */
WM_keymap_verify_item(keymap, "WM_OT_ten_timer", TKEY, KM_PRESS, KM_ALT|KM_CTRL, 0);
WM_keymap_verify_item(keymap, "WM_OT_debug_menu", DKEY, KM_PRESS, KM_ALT|KM_CTRL, 0);
- WM_keymap_verify_item(keymap, "WM_OT_search_menu", SPACEKEY, KM_PRESS, 0, 0);
+ WM_keymap_verify_item(keymap, "WM_OT_search_menu", SPACEKEY, KM_PRESS, KM_CTRL, 0);
}
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index d70516ef02e..d6bde9a468c 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -26,7 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -91,7 +90,7 @@ static void wm_window_check_position(rcti *rect)
wm_get_screensize(&width, &height);
#ifdef __APPLE__
- height -= 70;
+ height -= 42;
#endif
if(rect->xmin < 0) {
@@ -691,13 +690,12 @@ static int wm_window_timer(const bContext *C)
wmTimer *wt;
for(wt= win->timers.first; wt; wt= wt->next) {
if(wt->sleep==0) {
- if(time > wt->ntime) {
+ if(wt->timestep < time - wt->ltime) {
wmEvent event= *(win->eventstate);
wt->delta= time - wt->ltime;
wt->duration += wt->delta;
wt->ltime= time;
- wt->ntime= wt->stime + wt->timestep*ceil(wt->duration/wt->timestep);
event.type= wt->event_type;
event.custom= EVT_DATA_TIMER;
@@ -792,8 +790,6 @@ wmTimer *WM_event_add_window_timer(wmWindow *win, int event_type, double timeste
wt->event_type= event_type;
wt->ltime= PIL_check_seconds_timer();
- wt->ntime= wt->ltime + timestep;
- wt->stime= wt->ltime;
wt->timestep= timestep;
BLI_addtail(&win->timers, wt);