From 2ef3b39c6a100cf6b73828e7c7bf7f2b001a798c Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Thu, 29 Nov 2018 00:06:33 +0000 Subject: 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 --- src/Fl_Check_Browser.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Fl_Check_Browser.cxx b/src/Fl_Check_Browser.cxx index c08f5142d..22bdf9b3c 100644 --- a/src/Fl_Check_Browser.cxx +++ b/src/Fl_Check_Browser.cxx @@ -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); } -- cgit v1.2.3