From 10cabdfe8570963bd0ed12c4aca8ad469ba3d4ea Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sat, 9 Feb 2008 11:43:26 +0100 Subject: [PATCH] Fix a minor issue with lastdesktop right after startup. --- openbox/screen.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/openbox/screen.c b/openbox/screen.c index fcd0de8c..91353538 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -606,10 +606,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 -- 2.44.0