aboutsummaryrefslogtreecommitdiff
path: root/dw/fltkviewbase.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-12-08 17:35:18 +0100
committerSebastian Geerken <devnull@localhost>2014-12-08 17:35:18 +0100
commit3d521d286174264448cbd1b2315ff89f9d8e8edf (patch)
tree37515aa58dc935014b677c7212ada0fdfab7b2bd /dw/fltkviewbase.cc
parentde2139f76ee1fa4f14970914bb6c87fe46feed17 (diff)
parent2bb03c759cb44241d42e3385336a1c6b9a8d7d9f (diff)
Merged with main repo (part 1/2).
Diffstat (limited to 'dw/fltkviewbase.cc')
-rw-r--r--dw/fltkviewbase.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/dw/fltkviewbase.cc b/dw/fltkviewbase.cc
index f7e331fc..68218800 100644
--- a/dw/fltkviewbase.cc
+++ b/dw/fltkviewbase.cc
@@ -69,7 +69,7 @@ FltkViewBase::FltkViewBase (int x, int y, int w, int h, const char *label):
canvasHeight = 1;
bgColor = FL_WHITE;
mouse_x = mouse_y = 0;
- // focused_child = NULL;
+ focused_child = NULL;
exposeArea = NULL;
if (backBuffer == NULL) {
backBuffer = new BackBuffer ();
@@ -355,8 +355,6 @@ int FltkViewBase::handle (int event)
case FL_LEAVE:
theLayout->leaveNotify (this, getDwButtonState ());
break;
-#if 0
- // BUG: starting with fltk-1.3.3, we can't use fl_oldfocus.
case FL_FOCUS:
if (focused_child && find(focused_child) < children()) {
/* strangely, find() == children() if the child is not found */
@@ -364,9 +362,10 @@ int FltkViewBase::handle (int event)
}
return 1;
case FL_UNFOCUS:
- focused_child = fl_oldfocus;
+ // FLTK delivers UNFOCUS to the previously focused widget
+ if (find(Fl::focus()) < children())
+ focused_child = Fl::focus(); // remember the focused child!
return 0;
-#endif
case FL_KEYBOARD:
if (Fl::event_key() == FL_Tab)
return manageTabToFocus();