2.5
authorTon Roosendaal <ton@blender.org>
Tue, 16 Dec 2008 12:28:00 +0000 (12:28 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 16 Dec 2008 12:28:00 +0000 (12:28 +0000)
Work on getting notifiers in shape.

- Most important: local (to own region or area) redraw notifiers
  have been depricated. This is not a good or correct notifier anyway.
  Notifiers should be signals to other areas.

- Instead use these 2 functions:
    ED_area_tag_redraw(area);
    ED_region_tag_redraw(region);
  It seems to me good convention to keep the area/region redraw tag
  itself protected everywhere, for future improvements.

- Also added a basic WM function that checks overlapping regions,
  and flushes redraws to underlying regions. This makes menus and
  buttons allow to only send local region redraws.
  (Brought back two "swapbuffer indicators" to test this.

- Todo: area 'action zone' redraws, and fixing other notifiers...
  sending data pointers in a notifier seems to be bad idea.

16 files changed:
source/blender/editors/include/ED_screen.h
source/blender/editors/include/UI_view2d.h
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/view2d.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/screen/area.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_time/ed_markers.c
source/blender/editors/space_time/space_time.c
source/blender/editors/space_time/time_header.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_operators.c

index 8be027d34002ffe4bffb3a76edefe50da3e5b6b2..3028a1f0ad6ab5f093fcdc1be0bd2903cab9d6b7 100644 (file)
@@ -47,6 +47,7 @@ void  ED_region_do_draw(struct bContext *C, struct ARegion *ar);
 void   ED_region_exit(struct bContext *C, struct ARegion *ar);
 void   ED_region_pixelspace(const struct bContext *C, struct ARegion *ar);
 void   ED_region_init(struct bContext *C, struct ARegion *ar);
+void   ED_region_tag_redraw(struct ARegion *ar);
 
 /* spaces */
 void   ED_spacetypes_init(void);
@@ -59,6 +60,7 @@ void  ED_area_initialize(struct wmWindowManager *wm, struct wmWindow *win, struct
 void   ED_area_exit(struct bContext *C, struct ScrArea *sa);
 void   ED_area_do_draw(struct bContext *C, struct ScrArea *sa);
 int            ED_screen_area_active(const struct bContext *C);
+void   ED_area_tag_redraw(ScrArea *sa);
 
 /* screens */
 void   ED_screens_initialize(struct wmWindowManager *wm);
index 09d57901b0b0b903c6aea5528135501e1afe9b62..a60b827c44c7b223ebcc7165b6c31a2ff8932db5 100644 (file)
@@ -101,7 +101,9 @@ enum {
 
 /* ------ Define for UI_view2d_sync ----- */
 
-/* means copy it from the other v2d */
+/* means copy it from another v2d */
+#define V2D_LOCK_SET   0
+/* means copy it to the other v2ds */
 #define V2D_LOCK_COPY  1
 
 
index 9c62939946e06e157cbb9cae32716dcd6b1212e5..2e44fedc66aca682e9a7df6bad62c101e0737a96 100644 (file)
@@ -47,6 +47,8 @@
 #include "BKE_texture.h"
 #include "BKE_utildefines.h"
 
+#include "ED_screen.h"
+
 #include "UI_interface.h"
 #include "UI_text.h"
 #include "interface.h"
@@ -1272,7 +1274,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
        }
 
        if(changed || (retval == WM_UI_HANDLER_BREAK))
-               WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+               ED_region_tag_redraw(data->region);
 }
 
 static void ui_do_but_textedit_select(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
@@ -1298,7 +1300,7 @@ static void ui_do_but_textedit_select(bContext *C, uiBlock *block, uiBut *but, u
 
        if(retval == WM_UI_HANDLER_BREAK) {
                ui_check_but(but);
-               WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+               ED_region_tag_redraw(data->region);
        }
 }
 
@@ -1354,7 +1356,7 @@ static void ui_numedit_apply(bContext *C, uiBlock *block, uiBut *but, uiHandleBu
        if(data->interactive) ui_apply_button(C, block, but, data, 1);
        else ui_check_but(but);
 
-       WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+       ED_region_tag_redraw(data->region);
 }
 
 /* ****************** menu opening for various types **************** */
@@ -2808,7 +2810,6 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
        }
 
        data->state= state;
-       WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
 }
 
 static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonActivateType type)
@@ -2880,7 +2881,7 @@ static void button_activate_exit(bContext *C, uiHandleButtonData *data, uiBut *b
        but->flag &= ~(UI_ACTIVE|UI_SELECT);
 
        /* redraw */
-       WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+       ED_region_tag_redraw(data->region);
 
        /* adds empty mousemove in queue for re-init handler, in case mouse is
         * still over a button. we cannot just check for this ourselfs because
@@ -2978,7 +2979,7 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but)
 
                                        if(!data->tooltip) {
                                                data->tooltip= ui_tooltip_create(C, data->region, but);
-                                               WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+                                               ED_region_tag_redraw(data->region);
                                        }
                                }
                                /* handle menu auto open timer */
@@ -3014,14 +3015,14 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but)
                                        if(!(but->flag & UI_SELECT)) {
                                                but->flag |= UI_SELECT;
                                                data->cancel= 0;
-                                               WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+                                               ED_region_tag_redraw(data->region);
                                        }
                                }
                                else {
                                        if(but->flag & UI_SELECT) {
                                                but->flag &= ~UI_SELECT;
                                                data->cancel= 1;
-                                               WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+                                               ED_region_tag_redraw(data->region);
                                        }
                                }
                                break;
index bb1105c79af59449d3f175bbca55279944df44b4..b1f70ddebd2e156b63778edb1108727f917c0b97 100644 (file)
@@ -355,7 +355,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
        ED_region_init(C, ar);
        
        /* notify change and redraw */
-       WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+       ED_region_tag_redraw(ar);
 
        return ar;
 }
@@ -671,7 +671,7 @@ uiMenuBlockHandle *ui_menu_block_create(bContext *C, ARegion *butregion, uiBut *
        wm_subwindow_getmatrix(C->window, ar->swinid, block->winmat);
        
        /* notify change and redraw */
-       WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+       ED_region_tag_redraw(ar);
 
        return handle;
 }
index a5ec52b3d3846035be34534d4e983dd4e77a8372..7798f3535ad9aa96a615ddacb1575f98897a4dec 100644 (file)
@@ -1526,7 +1526,7 @@ void UI_view2d_getscale(View2D *v2d, float *x, float *y)
        if (y) *y = (v2d->mask.ymax - v2d->mask.ymin) / (v2d->cur.ymax - v2d->cur.ymin);
 }
 
-
+/* called by notifier WM_NOTE_TIMELINE_SYNC */
 void UI_view2d_sync(View2D *v2d, View2D *v2dfrom, int flag)
 {
        
index b945e260fb997dc154d208f537b9ab567506acfa..da3a412c1470a56fca3cc46da31e80e6f134b27d 100644 (file)
@@ -48,6 +48,8 @@
 
 #include "BIF_gl.h"
 
+#include "ED_screen.h"
+
 #include "UI_resources.h"
 #include "UI_view2d.h"
 
@@ -164,7 +166,7 @@ static void view_pan_apply(bContext *C, wmOperator *op)
        UI_view2d_curRect_validate(v2d);
        
        /* request updates to be done... */
-       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+       ED_area_tag_redraw(C->area);
        if(v2d->flag & V2D_VIEWSYNC_X)
                WM_event_add_notifier(C, WM_NOTE_TIMELINE_SYNC, V2D_LOCK_COPY, v2d);
 }
@@ -493,7 +495,7 @@ static void view_zoomstep_apply(bContext *C, wmOperator *op)
        UI_view2d_curRect_validate(v2d);
        
        /* request updates to be done... */
-       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+       ED_area_tag_redraw(C->area);
        if(v2d->flag & V2D_VIEWSYNC_X)
                WM_event_add_notifier(C, WM_NOTE_TIMELINE_SYNC, V2D_LOCK_COPY, v2d);
 }
@@ -646,7 +648,7 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op)
        UI_view2d_curRect_validate(v2d);
        
        /* request updates to be done... */
-       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+       ED_area_tag_redraw(C->area);
        if(v2d->flag & V2D_VIEWSYNC_X)
                WM_event_add_notifier(C, WM_NOTE_TIMELINE_SYNC, V2D_LOCK_COPY, v2d);
 }
@@ -1027,7 +1029,7 @@ static void scroller_activate_apply(bContext *C, wmOperator *op)
        UI_view2d_curRect_validate(v2d);
        
        /* request updates to be done... */
-       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+       ED_area_tag_redraw(C->area);
        if(v2d->flag & V2D_VIEWSYNC_X)
                WM_event_add_notifier(C, WM_NOTE_TIMELINE_SYNC, V2D_LOCK_COPY, v2d);
 }
index dfa6e1095f56aca5e0243d32b29d5160d477b1e6..3e44566e5932a4c9ca776400228ec2e1027ec0a8 100644 (file)
@@ -108,11 +108,9 @@ void ED_region_do_listen(ARegion *ar, wmNotifier *note)
        /* generic notes first */
        switch(note->type) {
                case WM_NOTE_WINDOW_REDRAW:
-               case WM_NOTE_AREA_REDRAW:
-               case WM_NOTE_REGION_REDRAW:
                case WM_NOTE_GESTURE_REDRAW:
                case WM_NOTE_SCREEN_CHANGED:
-                       ar->do_draw= 1;
+                       ED_region_tag_redraw(ar);
                        break;
                default:
                        if(ar->type->listener)
@@ -175,6 +173,26 @@ void ED_region_do_draw(bContext *C, ARegion *ar)
        ar->do_draw= 0;
 }
 
+/* **********************************
+   maybe silly, but let's try for now
+   to keep do_draw tags protected
+   ********************************** */
+
+void ED_region_tag_redraw(ARegion *ar)
+{
+       ar->do_draw= 1;
+}
+
+void ED_area_tag_redraw(ScrArea *sa)
+{
+       ARegion *ar;
+       
+       for(ar= sa->regionbase.first; ar; ar= ar->next)
+               ar->do_draw= 1;
+}
+
+
+
 /* *************************************************************** */
 
 /* dir is direction to check, not the splitting edge direction! */
@@ -489,7 +507,7 @@ void area_copy_data(ScrArea *sa1, ScrArea *sa2, int swap_space)
 /* *********** Space switching code, local now *********** */
 /* XXX make operator for this */
 
-static void newspace(bContext *C, ScrArea *sa, int type)
+static void area_newspace(bContext *C, ScrArea *sa, int type)
 {
        if(sa->spacetype != type) {
                SpaceType *st;
@@ -538,11 +556,11 @@ static void newspace(bContext *C, ScrArea *sa, int type)
                                slold->regionbase= sa->regionbase;
                                sa->regionbase= sl->regionbase;
                                sl->regionbase.first= sl->regionbase.last= NULL;
-                               
-                               ED_area_initialize(C->wm, C->window, sa);
                        }
                }
                
+               ED_area_initialize(C->wm, C->window, sa);
+               
                /* tell WM to refresh, cursor types etc */
                WM_event_add_mousemove(C);
        }
@@ -588,8 +606,8 @@ static char *windowtype_pup(void)
 
 static void spacefunc(struct bContext *C, void *arg1, void *arg2)
 {
-       newspace(C, C->area, C->area->butspacetype);
-       WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+       area_newspace(C, C->area, C->area->butspacetype);
+       ED_area_tag_redraw(C->area);
 }
 
 /* returns offset for next button in header */
index a05ee3d8450fc27bae0c476233b02deef76e6c51..a8cd6b7203c15b5e15afc1c3f4c0280e71de047c 100644 (file)
@@ -924,7 +924,7 @@ void ED_screen_do_listen(wmWindow *win, wmNotifier *note)
        }
 }
 
-
+/* only for edge lines between areas, and the blended join arrows */
 void ED_screen_draw(wmWindow *win)
 {
        ScrArea *sa;
@@ -1010,6 +1010,9 @@ void ED_screens_initialize(wmWindowManager *wm)
        }
 }
 
+
+/* *********** exit calls are for closing running stuff ******** */
+
 void ED_region_exit(bContext *C, ARegion *ar)
 {
        ARegion *prevar= C->region;
@@ -1110,7 +1113,7 @@ void ED_screen_set_subwinactive(wmWindow *win, wmEvent *event)
                                if(do_draw) {
                                        for(ar= sa->regionbase.first; ar; ar= ar->next)
                                                if(ar->regiontype==RGN_TYPE_HEADER)
-                                                       ar->do_draw= 1; /* XXX */
+                                                       ED_region_tag_redraw(ar);
                                }
                        }
                }
index 4c29d71f62a309ada2e5658370f2296a57181387..a042e915f136bd5d289013fc08fb077a6b00bad8 100644 (file)
@@ -158,7 +158,7 @@ static void buttons_main_area_draw(const bContext *C, ARegion *ar)
        /* draw entirely, view changes should be handled here */
        // SpaceButs *sbuts= C->area->spacedata.first;
        View2D *v2d= &ar->v2d;
-       float col[3];
+       float col[3], fac;
        
        /* clear and setup matrix */
        UI_GetThemeColor3fv(TH_BACK, col);
@@ -167,6 +167,11 @@ static void buttons_main_area_draw(const bContext *C, ARegion *ar)
        
        UI_view2d_view_ortho(C, v2d);
                
+       /* swapbuffers indicator */
+       fac= BLI_frand();
+       glColor3f(fac, fac, fac);
+       glRecti(20,  2,  30,  12);
+       
        /* data... */
        
        
index deb56b286b441332313eaf657551d079f7acac90..43b2601d2fa9a26ccfe64c029184c453a399171b 100644 (file)
@@ -332,7 +332,7 @@ static void ed_marker_move_cancel(bContext *C, wmOperator *op)
        ed_marker_move_apply(C, op);
        ed_marker_move_exit(C, op);     
        
-       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+       ED_area_tag_redraw(C->area);
 }
 
 
@@ -374,7 +374,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
                case RIGHTMOUSE:
                        if(WM_modal_tweak_check(evt, mm->event_type)) {
                                ed_marker_move_exit(C, op);
-                               WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+                               ED_area_tag_redraw(C->area);
                                return OPERATOR_FINISHED;
                        }
                        
@@ -451,7 +451,7 @@ XXX                                 else if (mm->slink->spacetype == SPACE_ACTION) {
                                        }
                                }
                                
-                               WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+                               ED_area_tag_redraw(C->area);
                                // headerprint(str); XXX
                        }
        }
@@ -619,7 +619,7 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend)
                select_timeline_marker_frame(cfra, 0);
        
        /* XXX notifier for markers... */
-       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+       ED_area_tag_redraw(C->area);
 
        return OPERATOR_PASS_THROUGH;
 }
@@ -713,7 +713,7 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
        }
        
        /* XXX notifier for markers... */
-       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+       ED_area_tag_redraw(C->area);
 
        return 1;
 }
@@ -767,7 +767,7 @@ static int ed_marker_select_all_exec(bContext *C, wmOperator *op)
        }
        
        /* XXX notifier for markers... */
-       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+       ED_area_tag_redraw(C->area);
 
        return OPERATOR_FINISHED;
 }
@@ -815,7 +815,7 @@ static int ed_marker_delete_exec(bContext *C, wmOperator *op)
        
        /* XXX notifier for markers... */
        if(changed)
-               WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+               ED_area_tag_redraw(C->area);
 
        return OPERATOR_FINISHED;
 }
index 29426840653ccd505bc694c7bd94df56e71a1aef..417ddb0937374b0f20098908ce4db727daf47de9 100644 (file)
@@ -166,7 +166,7 @@ static void time_main_area_listener(ARegion *ar, wmNotifier *wmn)
        switch(wmn->type) {
                case WM_NOTE_TIMELINE_SYNC:
                        if(ar->v2d.flag & V2D_VIEWSYNC_X) {
-                               ar->do_draw= 1; /* XXX GAH! */
+                               ED_region_tag_redraw(ar);
                                UI_view2d_sync(&ar->v2d, wmn->data, wmn->value);
                        }
                        break;
index 4f7d00005a4202662371efd2a1e7862f603525ef..65203cb7421a61f175c528a9d93a7f642390c7a9 100644 (file)
@@ -162,7 +162,7 @@ static void do_time_viewmenu(bContext *C, void *arg, int event)
                                        v2d->cur.xmin=v2d->tot.xmin= (float)first-2;
                                v2d->cur.xmax=v2d->tot.xmax= (float)C->scene->r.efra+2;
                        
-                               WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+                               ED_area_tag_redraw(C->area);
                        }
                        break;
                case 4: /* Maximize Window */
@@ -170,7 +170,7 @@ static void do_time_viewmenu(bContext *C, void *arg, int event)
                        break;
                case 5: /* show time or frames */
                        stime->flag ^= TIME_DRAWFRAMES;
-                       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+                       ED_area_tag_redraw(C->area);
                        break;
                case 6:
                        //nextprev_marker(1);
@@ -191,12 +191,12 @@ static void do_time_viewmenu(bContext *C, void *arg, int event)
                        if(v2d) {
                                v2d->flag ^= V2D_VIEWSYNC_X;
                                if(v2d->flag & V2D_VIEWSYNC_X)
-                                       WM_event_add_notifier(C, WM_NOTE_TIMELINE_SYNC, 0, v2d);        /* XXX can notifier be called after data free? */
+                                       WM_event_add_notifier(C, WM_NOTE_TIMELINE_SYNC, V2D_LOCK_SET, v2d);
                        }
                        break;
                case 12: /* only show keyframes from selected data */
                        stime->flag ^= TIME_ONLYACTSEL;
-                       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+                       ED_area_tag_redraw(C->area);
                        break;
        }
 }
index 9ccc7afe363c6099de3678a27ed3ccf5efd8257d..d98b59ac2c6163686ad78579b037a052b098dd13 100644 (file)
@@ -188,13 +188,17 @@ void view3d_keymap(struct wmWindowManager *wm)
 static void view3d_main_area_draw(const bContext *C, ARegion *ar)
 {
        /* draw entirely, view changes should be handled here */
-       float col[3];
+       float col[3], fac;
        
        /* clear and setup matrix */
        UI_GetThemeColor3fv(TH_BACK, col);
        glClearColor(col[0], col[1], col[2], 0.0);
        glClear(GL_COLOR_BUFFER_BIT);
        
+       /* swapbuffers indicator */
+       fac= BLI_frand();
+       glColor3f(fac, fac, fac);
+       glRecti(20,  2,  30,  12);
 }
 
 
index 3afb33694662288fa3e31cb84cc2b08cdb493542..7f7f7aac32fcadf176098a9ae19c1230f15f8161 100644 (file)
@@ -120,8 +120,6 @@ typedef struct wmNotifier {
 enum {
        WM_NOTE_WINDOW_REDRAW,
        WM_NOTE_SCREEN_CHANGED,
-       WM_NOTE_AREA_REDRAW,
-       WM_NOTE_REGION_REDRAW,
        WM_NOTE_GESTURE_REDRAW,
        
        WM_NOTE_TIMELINE_SYNC,
index a03425f1d11bd3c82a3c2ee15a1655d3237f5895..710e7a5a4cc797d031c1b80499b293cd967558e0 100644 (file)
@@ -104,8 +104,6 @@ void WM_event_add_notifier(bContext *C, int type, int value, void *data)
 
        /* catch local notifications here */
        switch (type) {
-               case WM_NOTE_AREA_REDRAW:
-               case WM_NOTE_REGION_REDRAW:
                case WM_NOTE_GESTURE_REDRAW:
                        if(C->region) 
                                note->swinid= C->region->swinid;
@@ -180,24 +178,39 @@ void wm_event_do_notifiers(bContext *C)
        }       
 }
 
+static void wm_flush_draw_updates(bScreen *screen, rcti *dirty)
+{
+       ScrArea *sa;
+       ARegion *ar;
+       
+       for(sa= screen->areabase.first; sa; sa= sa->next) {
+               for(ar=sa->regionbase.first; ar; ar= ar->next) {
+                       if( BLI_isect_rcti(dirty, &ar->winrct, NULL) )
+                               ar->do_draw= 1;
+               }
+       }
+}
+
 /* quick test to prevent changing window drawable */
 static int wm_draw_update_test_window(wmWindow *win)
 {
        ScrArea *sa;
        ARegion *ar;
        
+       /* flush */
+       for(ar=win->screen->regionbase.first; ar; ar= ar->next) {
+               if(ar->swinid && ar->do_draw) {
+                       wm_flush_draw_updates(win->screen, &ar->winrct);
+               }
+       }
+
        if(win->screen->do_refresh)
                return 1;
        if(win->screen->do_draw)
                return 1;
        if(win->screen->do_gesture)
                return 1;
-
-       for(ar=win->screen->regionbase.first; ar; ar= ar->next) {
-               if(ar->swinid && ar->do_draw)
-                       return 1;
-       }
-
+       
        for(sa= win->screen->areabase.first; sa; sa= sa->next) {
                for(ar=sa->regionbase.first; ar; ar= ar->next) {
                        if(ar->swinid && ar->do_draw)
index 5ed29a28abd62438c694454030dce7744dbb2b24..1cd903e7cf32487c3bf0e959f7b3ff66f69c9be0 100644 (file)
@@ -201,7 +201,7 @@ static void border_select_end(bContext *C, wmOperator *op)
        WM_gesture_end(C, gesture);     /* frees gesture itself, and unregisters from window */
        op->customdata= NULL;
 
-       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+       ED_area_tag_redraw(C->area);
        
 }
 
@@ -284,7 +284,7 @@ static void tweak_gesture_end(bContext *C, wmOperator *op)
        WM_gesture_end(C, gesture);     /* frees gesture itself, and unregisters from window */
        op->customdata= NULL;
 
-       WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+       ED_area_tag_redraw(C->area);
        
 }