diff options
| author | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-05-03 15:51:51 +0200 | 
|---|---|---|
| committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-05-03 15:51:51 +0200 | 
| commit | 4a248e3390a413d2f438d3f1be986968f372b2da (patch) | |
| tree | 36f644dd9aa46975dc66a27bbcb07b1d1613293c | |
| parent | 11ad9e7a504a4243dc5c5524163a7d66f9940daf (diff) | |
Fix renegade mouse click (button release) after double click.
| -rw-r--r-- | plugingui/eventhandler.cc | 7 | ||||
| -rw-r--r-- | plugingui/eventhandler.h | 3 | 
2 files changed, 10 insertions, 0 deletions
| diff --git a/plugingui/eventhandler.cc b/plugingui/eventhandler.cc index 050c2e1..a7aff12 100644 --- a/plugingui/eventhandler.cc +++ b/plugingui/eventhandler.cc @@ -38,6 +38,7 @@ GUI::EventHandler::EventHandler(GlobalContext *gctx)  {    this->gctx = gctx;    last_click = 0; +  last_was_dbl_click = false;  #ifdef WIN32    this->gctx->eventhandler = this;    event = NULL; @@ -481,8 +482,14 @@ void GUI::EventHandler::processEvents(Window *window)        break;      case Event::Button:        { +        if(last_was_dbl_click) { +          last_was_dbl_click = false; +          continue; +        }          ButtonEvent *be = (ButtonEvent *)event; +        last_was_dbl_click = be->doubleclick; +          Widget *w = window->find(be->x, be->y);          if(window->buttonDownFocus()) { diff --git a/plugingui/eventhandler.h b/plugingui/eventhandler.h index 99be2d4..69586f4 100644 --- a/plugingui/eventhandler.h +++ b/plugingui/eventhandler.h @@ -55,6 +55,9 @@ private:    int last_click;    void (*closeHandler)(void *);    void *closeHandlerPtr; + +  // Used to ignore mouse button release after a double click. +  bool last_was_dbl_click;  };  }; | 
