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--intern/guardedalloc/MEM_guardedalloc.h4
-rw-r--r--intern/guardedalloc/intern/mallocn.c14
-rw-r--r--source/blender/editors/interface/interface_icons.c17
-rw-r--r--source/blender/editors/mesh/editmesh_add.c6
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c21
-rw-r--r--source/blender/windowmanager/wm_event_system.h1
6 files changed, 44 insertions, 19 deletions
diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h
index 6b78b0b6bdc..dfb8b2db1b1 100644
--- a/intern/guardedalloc/MEM_guardedalloc.h
+++ b/intern/guardedalloc/MEM_guardedalloc.h
@@ -150,6 +150,10 @@ extern "C" {
/*get the peak memory usage in bytes, including mmap allocations*/
uintptr_t MEM_get_peak_memory(void);
+#ifndef NDEBUG
+const char *MEM_name_ptr(void *vmemh);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c
index 09f2d33a674..b213a1c3744 100644
--- a/intern/guardedalloc/intern/mallocn.c
+++ b/intern/guardedalloc/intern/mallocn.c
@@ -856,4 +856,18 @@ int MEM_get_memory_blocks_in_use(void)
return _totblock;
}
+#ifndef NDEBUG
+const char *MEM_name_ptr(void *vmemh)
+{
+ if (vmemh) {
+ MemHead *memh= vmemh;
+ memh--;
+ return memh->name;
+ }
+ else {
+ return "MEM_name_ptr(NULL)";
+ }
+}
+#endif
+
/* eof */
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 39e062a13aa..0ade3e6199f 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -864,13 +864,6 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect),
glPixelTransferf(GL_GREEN_SCALE, rgb[1]);
glPixelTransferf(GL_BLUE_SCALE, rgb[2]);
}
-
- if(is_preview == 0) {
- /* position */
- glRasterPos2f(x,y);
- }
-
- /* draw */
/* rect contains image in 'rendersize', we only scale if needed */
if(rw!=w && rh!=h) {
@@ -881,8 +874,14 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect),
rect= ima->rect;
}
- if(is_preview) glaDrawPixelsSafe(x, y, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, rect);
- else glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, rect);
+ /* draw */
+ if(is_preview) {
+ glaDrawPixelsSafe(x, y, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, rect);
+ }
+ else {
+ glRasterPos2f(x, y);
+ glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, rect);
+ }
if(ima)
IMB_freeImBuf(ima);
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c
index 525867d74c0..89991015419 100644
--- a/source/blender/editors/mesh/editmesh_add.c
+++ b/source/blender/editors/mesh/editmesh_add.c
@@ -114,13 +114,9 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event)
float min[3], max[3];
int done= 0;
short use_proj;
- wmWindow *win= CTX_wm_window(C);
-
+printf("%d\n", event->val);
em_setup_viewcontext(C, &vc);
- printf("\n%d %d\n", event->x, event->y);
- printf("%d %d\n", win->eventstate->x, win->eventstate->y);
-
use_proj= (vc.scene->toolsettings->snap_flag & SCE_SNAP) && (vc.scene->toolsettings->snap_mode==SCE_SNAP_MODE_FACE);
invert_m4_m4(vc.obedit->imat, vc.obedit->obmat);
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index f2b880bd0d5..47ca4314cc7 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -1452,11 +1452,24 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
wmWindow *win = CTX_wm_window(C);
if (win && win->eventstate->prevtype == event->type && win->eventstate->prevval == KM_PRESS) {
- /* test for double click first */
- if ((PIL_check_seconds_timer() - win->eventstate->prevclicktime) * 1000 < U.dbl_click_time) {
+ /* test for double click first,
+ * note1: this can be problematic because single click operators can get the
+ * double click event but then with old mouse coords which is highly confusing,
+ * so check for mouse moves too.
+ * note2: the first click event will be handled but still used to create a
+ * double click event if clicking again quickly.
+ * If no double click events are found itwill fallback to a single click.
+ * So a double click event can result in 2 successive single click calls
+ * if its not handled by the keymap - campbell */
+ if ( (ABS(event->x - win->eventstate->prevclickx)) <= 2 &&
+ (ABS(event->y - win->eventstate->prevclicky)) <= 2 &&
+ ((PIL_check_seconds_timer() - win->eventstate->prevclicktime) * 1000 < U.dbl_click_time)
+ ) {
event->val = KM_DBL_CLICK;
- event->x = win->eventstate->prevclickx;
- event->y = win->eventstate->prevclicky;
+ /* removed this because in cases where we're this is used as a single click
+ * event, this will give old coords, since the distance is checked above, using new coords should be ok. */
+ // event->x = win->eventstate->prevclickx;
+ // event->y = win->eventstate->prevclicky;
action |= wm_handlers_do(C, event, handlers);
}
diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h
index 8fd650fb184..4888f9aced3 100644
--- a/source/blender/windowmanager/wm_event_system.h
+++ b/source/blender/windowmanager/wm_event_system.h
@@ -84,7 +84,6 @@ enum {
/* wm_event_system.c */
-void wm_event_add (wmWindow *win, wmEvent *event_to_add);
void wm_event_free_all (wmWindow *win);
void wm_event_free (wmEvent *event);
void wm_event_free_handler (wmEventHandler *handler);