Fix FL_PUSH event handling of Fl_Check_Browser (STR #3004).

Test if the FL_PUSH event is inside the widget area and inside
the scrollbars (if scrollbars are visible).


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13138 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Albrecht Schlosser 2018-11-29 00:06:33 +00:00
parent 91bb8bce1f
commit 2ef3b39c6a
2 changed files with 9 additions and 4 deletions

View File

@ -142,6 +142,7 @@ Changes in FLTK 1.4.0 Released: ??? ?? 2019
Bug Fixes
- (add new items here)
- Fix FL_PUSH event handling of Fl_Check_Browser (STR #3004).
- Fix a potential crash when a program exits before it opens a window
(Windows only, STR #3484).
- Fix Fl_PNG_Image error handling. An error was potentially caused

View File

@ -1,9 +1,9 @@
//
// "$Id$"
//
// Fl_Check_Browser header file for the Fast Light Tool Kit (FLTK).
// Fl_Check_Browser implementation for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2010 by Bill Spitzak and others.
// Copyright 1998-2018 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@ -310,8 +310,12 @@ void Fl_Check_Browser::check_none() {
}
int Fl_Check_Browser::handle(int event) {
if (event==FL_PUSH)
deselect();
if (event == FL_PUSH) {
int X, Y, W, H;
bbox(X, Y, W, H);
if (Fl::event_inside(X, Y, W, H))
deselect();
}
return Fl_Browser_::handle(event);
}