X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Fscreen.c;h=5201f78a1d27a9da1c3c2faeb77f82290f896a49;hb=91a1b089097cb3ba66f779df80fa7a51490aa785;hp=73429bc94168ce5cde7a61346665a0fe8da239ca;hpb=bbad88aa21f01a70faf824cbb2825bd7f9d95253;p=chaz%2Fopenbox diff --git a/openbox/screen.c b/openbox/screen.c index 73429bc9..5201f78a 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -59,7 +59,7 @@ static void screen_fallback_focus(void); guint screen_num_desktops; guint screen_num_monitors; guint screen_desktop; -guint screen_last_desktop = 1; +guint screen_last_desktop; gboolean screen_showing_desktop; ObDesktopLayout screen_desktop_layout; gchar **screen_desktop_names; @@ -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