Ticket #3760: 3760-WEdit-shouldnt-draw-frame-over-buttonbar.patch

File 3760-WEdit-shouldnt-draw-frame-over-buttonbar.patch, 1.7 KB (added by mooffie, 8 years ago)
  • src/editor/editwidget.c

    From f5e52a71befdc7568e6e85b89a8d43e222bc7ada Mon Sep 17 00:00:00 2001
    From: Mooffie <mooffie@gmail.com>
    Date: Thu, 16 Feb 2017 00:23:33 +0200
    Subject: [PATCH] Ticket #3760: WEdit shouldn't draw frame over buttonbar.
    
    When dragging a framed WEdit with the mouse, the frame is painted over the
    buttonbar. This happens in two cases: when pressing the mouse down, and when
    releasing it.
    
    The patch fixes the problem by calling edit_update_screen() in these two cases.
    This paints the buttonbar over the frame.
    
    (The problem doesn't occur when moving the frame with the keyboard because
    edit_callback(msg==MSG_KEY) calls edit_update_screen() right after handling the
    key.)
    
    Signed-off-by: Mooffie <mooffie@gmail.com>
    ---
     src/editor/editwidget.c | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/src/editor/editwidget.c b/src/editor/editwidget.c
    index 0d1b6b3..7f85545 100644
    a b edit_mouse_handle_move_resize (Widget * w, mouse_msg_t msg, mouse_event_t * even 
    10051005    { 
    10061006        /* Exit move/resize mode. */ 
    10071007        edit_execute_cmd (edit, CK_Enter, -1); 
     1008        edit_update_screen (edit);      /* Paint the buttonbar over our possibly overlapping frame. */ 
    10081009        return; 
    10091010    } 
    10101011 
    edit_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event) 
    11001101                { 
    11011102                    /* start window move */ 
    11021103                    edit_execute_cmd (edit, CK_WindowMove, -1); 
     1104                    edit_update_screen (edit);  /* Paint the buttonbar over our possibly overlapping frame. */ 
    11031105                    edit->drag_state_start = event->x; 
    11041106                } 
    11051107                break;