diff options
author | David Reveman <davidr@novell.com> | 2008-03-10 12:25:25 -0400 |
---|---|---|
committer | David Reveman <davidr@novell.com> | 2008-03-10 12:25:25 -0400 |
commit | a2b25775137c32250dca040c11c0df8c94389f62 (patch) | |
tree | 42ebc6d0cdf583771e34b28122c17b12ee61861e | |
parent | df6a238e5f5f23668290cffc6059dd68b209b160 (diff) |
Fix focusDefaultWindow function.object-framework
-rw-r--r-- | src/display.c | 58 | ||||
-rw-r--r-- | src/screen.c | 2 |
2 files changed, 1 insertions, 59 deletions
diff --git a/src/display.c b/src/display.c index 69bd8261..3448d7c7 100644 --- a/src/display.c +++ b/src/display.c @@ -2169,64 +2169,6 @@ getCurrentTimeFromDisplay (CompDisplay *d) return event.xproperty.time; } -void -focusDefaultWindow (CompDisplay *d) -{ - CompScreen *s; - CompWindow *w; - CompWindow *focus = NULL; - - if (!d->data.clickToFocus) - { - w = findTopLevelWindowAtDisplay (d, d->below); - if (w && !(w->type & (CompWindowTypeDesktopMask | - CompWindowTypeDockMask))) - { - if ((*w->screen->focusWindow) (w)) - focus = w; - } - } - - if (!focus) - { - for (s = d->screens; s; s = s->next) - { - for (w = s->reverseWindows; w; w = w->prev) - { - if (w->type & CompWindowTypeDockMask) - continue; - - if ((*s->focusWindow) (w)) - { - if (focus) - { - if (w->type & (CompWindowTypeNormalMask | - CompWindowTypeDialogMask | - CompWindowTypeModalDialogMask)) - { - if (compareWindowActiveness (focus, w) < 0) - focus = w; - } - } - else - focus = w; - } - } - } - } - - if (focus) - { - if (focus->id != d->activeWindow) - moveInputFocusToWindow (focus); - } - else if (d->screens) - { - XSetInputFocus (d->display, d->screens->root, RevertToPointerRoot, - CurrentTime); - } -} - CompScreen * findScreenAtDisplay (CompDisplay *d, Window root) diff --git a/src/screen.c b/src/screen.c index 199677f3..7030d7f1 100644 --- a/src/screen.c +++ b/src/screen.c @@ -2674,7 +2674,7 @@ focusDefaultWindow (CompScreen *s) CompWindow *w; CompWindow *focus = NULL; - if (!d->opt[COMP_DISPLAY_OPTION_CLICK_TO_FOCUS].value.b) + if (!d->data.clickToFocus) { w = findTopLevelWindowAtDisplay (d, d->below); if (w && !(w->type & (CompWindowTypeDesktopMask | |