From 264eb5ea1aa378f633de6a1b0307faf22cf00147 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Fri, 13 Nov 2020 14:24:52 +0100 Subject: [PATCH] fixed initial focus display --- src/emucore/EventHandler.cxx | 1 + src/gui/Dialog.cxx | 22 +++++++++++----------- src/gui/Widget.cxx | 4 ++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index cb372c7f9..59c17c8a8 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -324,6 +324,7 @@ void EventHandler::handleSystemEvent(SystemEvent e, int, int) case SystemEvent::WINDOW_EXPOSED: case SystemEvent::WINDOW_RESIZED: //myOSystem.frameBuffer().update(true); // force full update + // TODO: test and maybe force a render update instead myOSystem.frameBuffer().update(); break; #ifdef BSPF_UNIX diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index e1bf15f3e..95379398a 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -476,17 +476,6 @@ void Dialog::drawDialog() clearDirty(); } - // Draw outlines for focused widgets - // Don't change focus, since this will trigger lost and received - // focus events - if(_focusedWidget) - { - _focusedWidget = Widget::setFocusForChain(this, getFocusList(), - _focusedWidget, 0, false); - // if(_focusedWidget) - // _focusedWidget->draw(); // make sure the highlight color is drawn initially - } - Widget* w = _firstWidget; // Draw all children @@ -498,6 +487,17 @@ void Dialog::drawDialog() w->draw(); w = w->_next; } + + // Draw outlines for focused widgets + // Don't change focus, since this will trigger lost and received + // focus events + if(_focusedWidget) + { + _focusedWidget = Widget::setFocusForChain(this, getFocusList(), + _focusedWidget, 0, false); + //if(_focusedWidget) + // _focusedWidget->draw(); // make sure the highlight color is drawn initially + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index 1cacda9d6..93331cea1 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -269,7 +269,7 @@ Widget* Widget::setFocusForChain(GuiObject* boss, WidgetArray& arr, s.frameRect(x, y, w, h, onTop ? kDlgColor : kBGColorLo); - tmp->setDirty(); + //tmp->setDirty(); } } @@ -325,7 +325,7 @@ Widget* Widget::setFocusForChain(GuiObject* boss, WidgetArray& arr, if (onTop) s.frameRect(x, y, w, h, kWidFrameColor, FrameStyle::Dashed); - tmp->setDirty(); + //tmp->setDirty(); return tmp; }