From d444f5b78eacb2db7654288c9848cabe6a2a5f61 Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 21 Nov 2016 10:37:54 -0300 Subject: [PATCH] Minor change in Manager::processFocusMovementMessage --- src/ui/manager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ui/manager.cpp b/src/ui/manager.cpp index fdb8d8226..060c9b368 100644 --- a/src/ui/manager.cpp +++ b/src/ui/manager.cpp @@ -1533,6 +1533,9 @@ void Manager::broadcastKeyMsg(Message* msg) Focus Movement ***********************************************************************/ +// TODO rewrite this function, it is based in an old code from the +// Allegro library GUI code + bool Manager::processFocusMovementMessage(Message* msg) { int (*cmp)(Widget*, int, int) = NULL; @@ -1612,7 +1615,7 @@ bool Manager::processFocusMovementMessage(Message* msg) for (i=c; i (*cmp) (list[j], x, y)) { + if ((*cmp)(list[i], x, y) > (*cmp)(list[j], x, y)) { Widget* tmp = list[i]; list[i] = list[j]; list[j] = tmp; @@ -1621,7 +1624,7 @@ bool Manager::processFocusMovementMessage(Message* msg) } // Check if the new widget to put the focus is not in the wrong way. - if ((*cmp) (list[c], x, y) < std::numeric_limits::max()) + if ((*cmp)(list[c], x, y) < std::numeric_limits::max()) focus = list[c]; } // If only there are one widget, put the focus in this