aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/gwin_wm.c
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2015-10-13 01:00:10 +1000
committerinmarket <andrewh@inmarket.com.au>2015-10-13 01:00:10 +1000
commit10c7471149453cea6686aa6f61ec6dac0525c47b (patch)
tree11c872b10ad42872de3d44d7fec3aa5388ee90e4 /src/gwin/gwin_wm.c
parentddf79cd411e2cbdb58c485851b16be496109ab3b (diff)
parent5cf81b6fbe76cd5decab8e532fd607202abbc6c6 (diff)
downloaduGFX-10c7471149453cea6686aa6f61ec6dac0525c47b.tar.gz
uGFX-10c7471149453cea6686aa6f61ec6dac0525c47b.tar.bz2
uGFX-10c7471149453cea6686aa6f61ec6dac0525c47b.zip
Merge branch 'TextEdit'
Diffstat (limited to 'src/gwin/gwin_wm.c')
-rw-r--r--src/gwin/gwin_wm.c38
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);
}
}