diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-07-21 14:02:05 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-07-21 14:02:05 +0400 |
commit | f745564e4ee791e4faf804b09ce975b882f4f8d9 (patch) | |
tree | 90ebbe363ccd925cedc652c9bb018ce552b5a2ab /source/blender/windowmanager/intern/wm_event_system.c | |
parent | 8489b94e07f9e73bd3c9c3e4f6a91f1f0a259827 (diff) |
GSOC 2013 paint
Yep, at last it's here!
There are a few minor issues remaining but development can go on in
master after discussion at blender institute.
For full list of features see:
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.72/Painting
Thanks to Sergey and Campbell for the extensive review and to the
countless artists that have given their input and reported issues during
development.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 256f456a7a4..7e2b7f2eb65 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -111,10 +111,13 @@ void wm_event_free(wmEvent *event) if (event->customdata) { if (event->customdatafree) { /* note: pointer to listbase struct elsewhere */ - if (event->custom == EVT_DATA_LISTBASE) - BLI_freelistN(event->customdata); - else + if (event->custom == EVT_DATA_DRAGDROP) { + ListBase *lb = event->customdata; + WM_drag_free_list(lb); + } + else { MEM_freeN(event->customdata); + } } } @@ -1934,17 +1937,17 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers wmDropBox *drop = handler->dropboxes->first; for (; drop; drop = drop->next) { /* other drop custom types allowed */ - if (event->custom == EVT_DATA_LISTBASE) { + if (event->custom == EVT_DATA_DRAGDROP) { ListBase *lb = (ListBase *)event->customdata; wmDrag *drag; for (drag = lb->first; drag; drag = drag->next) { if (drop->poll(C, drag, event)) { - drop->copy(drag, drop); /* free the drags before calling operator */ - BLI_freelistN(event->customdata); + WM_drag_free_list(lb); + event->customdata = NULL; event->custom = 0; @@ -2146,10 +2149,12 @@ static void wm_event_drag_test(wmWindowManager *wm, wmWindow *win, wmEvent *even return; } - if (event->type == MOUSEMOVE || ISKEYMODIFIER(event->type)) + if (event->type == MOUSEMOVE || ISKEYMODIFIER(event->type)) { win->screen->do_draw_drag = true; + } else if (event->type == ESCKEY) { - BLI_freelistN(&wm->drags); + WM_drag_free_list(&wm->drags); + win->screen->do_draw_drag = true; } else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) { @@ -2161,7 +2166,7 @@ static void wm_event_drag_test(wmWindowManager *wm, wmWindow *win, wmEvent *even MEM_freeN(event->customdata); } - event->custom = EVT_DATA_LISTBASE; + event->custom = EVT_DATA_DRAGDROP; event->customdata = &wm->drags; event->customdatafree = 1; |