summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Reveman <davidr@novell.com>2008-03-10 12:25:25 -0400
committerDavid Reveman <davidr@novell.com>2008-03-10 12:25:25 -0400
commita2b25775137c32250dca040c11c0df8c94389f62 (patch)
tree42ebc6d0cdf583771e34b28122c17b12ee61861e
parentdf6a238e5f5f23668290cffc6059dd68b209b160 (diff)
downloadcore-object-framework.tar.gz
core-object-framework.tar.bz2
Fix focusDefaultWindow function.object-framework
-rw-r--r--src/display.c58
-rw-r--r--src/screen.c2
2 files changed, 1 insertions, 59 deletions
diff --git a/src/display.c b/src/display.c
index 69bd826..3448d7c 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 199677f..7030d7f 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 |