diff options
author | inmarket <andrewh@inmarket.com.au> | 2015-10-13 01:00:48 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2015-10-13 01:00:48 +1000 |
commit | 9d3fc8b36cb57fa23c0b838a54a8bc67328f9672 (patch) | |
tree | fee15031006a070adb49279540067e90aa6be934 /src/gwin/gwin_wm.c | |
parent | 92b000291826ca78c30f205c104ac330484b82c9 (diff) | |
parent | 10c7471149453cea6686aa6f61ec6dac0525c47b (diff) | |
download | uGFX-9d3fc8b36cb57fa23c0b838a54a8bc67328f9672.tar.gz uGFX-9d3fc8b36cb57fa23c0b838a54a8bc67328f9672.tar.bz2 uGFX-9d3fc8b36cb57fa23c0b838a54a8bc67328f9672.zip |
Merge branch 'master' into Keil
Diffstat (limited to 'src/gwin/gwin_wm.c')
-rw-r--r-- | src/gwin/gwin_wm.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/gwin/gwin_wm.c b/src/gwin/gwin_wm.c index 00365c36..ef7333fa 100644 --- a/src/gwin/gwin_wm.c +++ b/src/gwin/gwin_wm.c @@ -162,7 +162,6 @@ extern const GWindowManager GNullWindowManager; GWindowManager * _GWINwm; bool_t _gwinFlashState; - static gfxSem gwinsem; static gfxQueueASync _GWINList; #if GWIN_NEED_FLASHING @@ -331,14 +330,23 @@ void _gwinUpdate(GHandle gh) { if (!gh->parent || (gh->parent->flags & GWIN_FLG_SYSVISIBLE)) { // We have been made visible gh->flags |= (GWIN_FLG_SYSVISIBLE|GWIN_FLG_NEEDREDRAW|GWIN_FLG_BGREDRAW); + + // Do we want to grab the focus + _gwinFixFocus(gh); + RedrawPending |= DOREDRAW_VISIBLES; } break; case (GWIN_FLG_VISIBLE|GWIN_FLG_SYSVISIBLE): if (!gh->parent || (gh->parent->flags & GWIN_FLG_SYSVISIBLE)) break; + // Parent has been made invisible gh->flags &= ~GWIN_FLG_SYSVISIBLE; + + // No focus for us anymore + _gwinFixFocus(gh); + break; case GWIN_FLG_SYSVISIBLE: // We have been made invisible @@ -346,6 +354,10 @@ void _gwinUpdate(GHandle gh) { if (!gh->parent || (gh->parent->flags & GWIN_FLG_SYSVISIBLE)) { // The parent is visible so we must clear the area we took gh->flags |= (GWIN_FLG_NEEDREDRAW|GWIN_FLG_BGREDRAW); + + // No focus for us anymore + _gwinFixFocus(gh); + RedrawPending |= DOREDRAW_INVISIBLES; } break; @@ -455,6 +467,10 @@ void gwinRedraw(GHandle gh) { if (visible) { if (!(gh->flags & GWIN_FLG_VISIBLE)) { gh->flags |= (GWIN_FLG_VISIBLE|GWIN_FLG_SYSVISIBLE|GWIN_FLG_NEEDREDRAW|GWIN_FLG_BGREDRAW); + + // Do we want to grab the focus + _gwinFixFocus(gh); + RedrawPending |= DOREDRAW_VISIBLES; TriggerRedraw(); } @@ -462,6 +478,10 @@ void gwinRedraw(GHandle gh) { if ((gh->flags & GWIN_FLG_VISIBLE)) { gh->flags &= ~(GWIN_FLG_VISIBLE|GWIN_FLG_SYSVISIBLE); gh->flags |= (GWIN_FLG_NEEDREDRAW|GWIN_FLG_BGREDRAW); + + // No focus for us anymore + _gwinFixFocus(gh); + RedrawPending |= DOREDRAW_INVISIBLES; TriggerRedraw(); } @@ -482,6 +502,10 @@ void gwinRedraw(GHandle gh) { for(gh = gwinGetNextWindow(0); gh; gh = gwinGetNextWindow(gh)) { if ((gh->flags & (GWIN_FLG_SYSENABLED|GWIN_FLG_ENABLED)) == GWIN_FLG_ENABLED && (!gh->parent || (gh->parent->flags & GWIN_FLG_SYSENABLED))) { gh->flags |= GWIN_FLG_SYSENABLED; // Fix it + + // Do we want to grab the focus + _gwinFixFocus(gh); + _gwinUpdate(gh); } } @@ -495,6 +519,10 @@ void gwinRedraw(GHandle gh) { for(gh = gwinGetNextWindow(0); gh; gh = gwinGetNextWindow(gh)) { if ((gh->flags & GWIN_FLG_SYSENABLED) && (!(gh->flags & GWIN_FLG_ENABLED) || (gh->parent && !(gh->parent->flags & GWIN_FLG_SYSENABLED)))) { gh->flags &= ~GWIN_FLG_SYSENABLED; // Fix it + + // No focus for us anymore + _gwinFixFocus(gh); + _gwinUpdate(gh); } } @@ -506,11 +534,19 @@ void gwinRedraw(GHandle gh) { if (enabled) { if (!(gh->flags & GWIN_FLG_ENABLED)) { gh->flags |= (GWIN_FLG_ENABLED|GWIN_FLG_SYSENABLED); + + // Do we want to grab the focus + _gwinFixFocus(gh); + _gwinUpdate(gh); } } else { if ((gh->flags & GWIN_FLG_ENABLED)) { gh->flags &= ~(GWIN_FLG_ENABLED|GWIN_FLG_SYSENABLED); + + // No focus for us anymore + _gwinFixFocus(gh); + _gwinUpdate(gh); } } |