From: Mikael Magnusson Date: Sat, 9 Feb 2008 10:43:26 +0000 (+0100) Subject: Fix a minor issue with lastdesktop right after startup. X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=d5a25283dceb4b0eb7f1dcba1ac15674f6422fbe;p=chaz%2Fopenbox Fix a minor issue with lastdesktop right after startup. --- diff --git a/openbox/screen.c b/openbox/screen.c index da490778..5201f78a 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -620,10 +620,15 @@ void screen_set_desktop(guint num, gboolean dofocus) /* If screen_desktop_timeout is true, then we've been on this desktop long enough and we can save it as the last desktop. */ - /* save the "last desktop" as the "old desktop" */ - screen_old_desktop = screen_last_desktop; - /* save the desktop we're coming from as the "last desktop" */ - screen_last_desktop = previous; + if (screen_last_desktop == previous) + /* this is the startup state only */ + screen_old_desktop = screen_desktop; + else { + /* save the "last desktop" as the "old desktop" */ + screen_old_desktop = screen_last_desktop; + /* save the desktop we're coming from as the "last desktop" */ + screen_last_desktop = previous; + } } else { /* If screen_desktop_timeout is false, then we just got to this desktop