summaryrefslogtreecommitdiff
path: root/src/Fl.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2023-04-11 16:38:24 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2023-04-11 16:38:24 +0200
commit7d8195140cb3a042bea88fab8b01b5f5499f6100 (patch)
tree238f89a3d105002769abf58f1ed7293c1f6145b1 /src/Fl.cxx
parent8639c43e3a75b8eb1b525db4eb4848cf851f4f92 (diff)
Add public accessor methods Fl_Widget::needs_keyboard()
- add public getter and setter for - document the new methods - document that these methods are not yet used internally - remove unnecessary friend declaration 'NEEDS_KEYBOARD' flag - simplify Fl::focus(Fl_Widget *) using the new methods.
Diffstat (limited to 'src/Fl.cxx')
-rw-r--r--src/Fl.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index 923d277f6..f1ad4d75c 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -953,6 +953,8 @@ Fl_Widget* fl_oldfocus; // kludge for Fl_Group...
connected.
\see Fl_Widget::take_focus()
+ \see Fl_Widget::needs_keyboard() const
+ \see Fl_Widget::needs_keyboard(bool)
*/
void Fl::focus(Fl_Widget *o)
{
@@ -960,8 +962,8 @@ void Fl::focus(Fl_Widget *o)
// request an on-screen keyboard on touch screen devices if needed
Fl_Widget *prevFocus = Fl::focus();
- char hideKeyboard = ( prevFocus && (prevFocus->flags()&Fl_Widget::NEEDS_KEYBOARD) );
- char showKeyboard = (o && (o->flags()&Fl_Widget::NEEDS_KEYBOARD));
+ char hideKeyboard = (prevFocus && prevFocus->needs_keyboard());
+ char showKeyboard = (o && o->needs_keyboard());
if (hideKeyboard && !showKeyboard)
Fl::screen_driver()->release_keyboard();
if (showKeyboard && !hideKeyboard)