FLTK logo

[fltk.coredev] RFC: Fl::focus(Fl_Widget*) should be independent of Fl_Widget::visible_focus()

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

RFC: Fl::focus(Fl_Widget*) should be independent of Fl_Widget::visible_focus() Albrecht Schlosser Jan 11, 2022  
  All,

I filed issue #366 "Fl::focus(Fl_Widget*) should be independent of Fl_Widget::visible_focus()"
https://github.com/fltk/fltk/issues/366

Abstract:

"Setting the focus to a widget that has disabled keyboard navigation by calling Fl_Widget::clear_visible_focus() or Fl_Widget::visible_focus(0) fails because Fl::focus(Fl_Widget*) tests the Fl_Widget::visible_focus() attribute. This should not be done since Fl::focus(Fl_Widget*) should set the focus to the widget unconditionally."

For further information and links to documentation and code please see the GitHub issue (link above).

I suggest to remove the offending statement
(https://github.com/fltk/fltk/blob/42a93eb8dec6e3c637442e23e156b3f72c7f8ca7/src/Fl.cxx#L829)

if (o && !o->visible_focus()) return;

but I wanted to ask for comments and opinions first.

This check exists since the new VISIBLE_FOCUS flag had been introduced in 2002 but I believe that this is a bug.
https://github.com/fltk/fltk/blob/57cef6a4bde017e205e54271e769de0db596d893/src/Fl.cxx#L422

A related issue is
issue #365 "Make class Fl_Simple_Terminal refuse the focus"
https://github.com/fltk/fltk/issues/365

Comments, anybody?

Please use this thread for discussion or add a comment to the GitHub issue. Thanks.

--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/108e79aa-46aa-f98c-eebd-da9d13e3774c%40online.de.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.