diff options
author | Danny Baumann <dannybaumann@web.de> | 2008-10-02 15:34:45 +0200 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2008-10-02 15:34:45 +0200 |
commit | ca7cb636f9f28759f193712ef72672b267f9a1b6 (patch) | |
tree | c16eb1620049b6988cf84fc3a1bd9d672f6bf978 /src | |
parent | 46e4aa0308fe542f2586835e86ee249ebea6fafb (diff) |
Handle desktops a bit better.
Diffstat (limited to 'src')
-rw-r--r-- | src/event.c | 22 | ||||
-rw-r--r-- | src/screen.c | 3 | ||||
-rw-r--r-- | src/window.c | 5 |
3 files changed, 17 insertions, 13 deletions
diff --git a/src/event.c b/src/event.c index 1039ec7c..545fce07 100644 --- a/src/event.c +++ b/src/event.c @@ -1995,23 +1995,26 @@ handleEvent (CompDisplay *d, } } - w->managed = TRUE; - if (w->state & CompWindowStateHiddenMask) if (!w->minimized && !w->inShowDesktopMode) doMapProcessing = FALSE; if (doMapProcessing) { - Bool allowFocus; - CompStackingUpdateMode stackingMode; - w->initialViewportX = w->screen->x; w->initialViewportY = w->screen->y; w->initialTimestampSet = FALSE; applyStartupProperties (w->screen, w); + } + + w->managed = TRUE; + + if (doMapProcessing) + { + Bool allowFocus; + CompStackingUpdateMode stackingMode; if (!w->placed) { @@ -2065,12 +2068,11 @@ handleEvent (CompDisplay *d, (*w->screen->leaveShowDesktopMode) (w->screen, w); + if (allowFocus && !onCurrentDesktop (w)) + setCurrentDesktop (w->screen, w->desktop); + if (!(w->state & CompWindowStateHiddenMask)) - { - w->pendingMaps++; - XMapWindow (d->display, w->id); - setWindowState (d, w->id, w->state); - } + showWindow (w); if (allowFocus) moveInputFocusToWindow (w); diff --git a/src/screen.c b/src/screen.c index 80e83f19..081ad515 100644 --- a/src/screen.c +++ b/src/screen.c @@ -3734,8 +3734,7 @@ applyStartupProperties (CompScreen *screen, window->initialViewportY = s->viewportY; workspace = sn_startup_sequence_get_workspace (s->sequence); - if (workspace >= 0) - window->desktop = workspace; + setDesktopForWindow (window, workspace); window->initialTimestamp = sn_startup_sequence_get_timestamp (s->sequence); diff --git a/src/window.c b/src/window.c index 8b24eacb..4eb938a5 100644 --- a/src/window.c +++ b/src/window.c @@ -4826,7 +4826,10 @@ isWindowFocusAllowed (CompWindow *w, if (level == FOCUS_PREVENTION_LEVEL_HIGH) return FALSE; - /* not in current viewport */ + /* not in current viewport or desktop */ + if (!onCurrentDesktop (w)) + return FALSE; + defaultViewportForWindow (w, &vx, &vy); if (vx != viewportX || vy != viewportY) return FALSE; |