small optimization heh for screen_set_desktop - set the root proerty less
initialize screen_last_desktop properly
This commit is contained in:
parent
ad8e8d4988
commit
1f71a0db72
1 changed files with 4 additions and 2 deletions
|
@ -368,6 +368,7 @@ void screen_startup(gboolean reconfig)
|
||||||
else
|
else
|
||||||
screen_set_num_desktops(config_desktops_num);
|
screen_set_num_desktops(config_desktops_num);
|
||||||
|
|
||||||
|
screen_desktop = screen_num_desktops; /* something invalid */
|
||||||
/* start on the current desktop when a wm was already running */
|
/* start on the current desktop when a wm was already running */
|
||||||
if (PROP_GET32(RootWindow(ob_display, ob_screen),
|
if (PROP_GET32(RootWindow(ob_display, ob_screen),
|
||||||
net_current_desktop, cardinal, &d) &&
|
net_current_desktop, cardinal, &d) &&
|
||||||
|
@ -380,6 +381,7 @@ void screen_startup(gboolean reconfig)
|
||||||
else
|
else
|
||||||
screen_set_desktop(MIN(config_screen_firstdesk,
|
screen_set_desktop(MIN(config_screen_firstdesk,
|
||||||
screen_num_desktops) - 1, FALSE);
|
screen_num_desktops) - 1, FALSE);
|
||||||
|
screen_last_desktop = screen_desktop;
|
||||||
|
|
||||||
/* don't start in showing-desktop mode */
|
/* don't start in showing-desktop mode */
|
||||||
screen_showing_desktop = FALSE;
|
screen_showing_desktop = FALSE;
|
||||||
|
@ -506,13 +508,13 @@ void screen_set_desktop(guint num, gboolean dofocus)
|
||||||
|
|
||||||
g_assert(num < screen_num_desktops);
|
g_assert(num < screen_num_desktops);
|
||||||
|
|
||||||
|
if (old == num) return;
|
||||||
|
|
||||||
old = screen_desktop;
|
old = screen_desktop;
|
||||||
screen_desktop = num;
|
screen_desktop = num;
|
||||||
PROP_SET32(RootWindow(ob_display, ob_screen),
|
PROP_SET32(RootWindow(ob_display, ob_screen),
|
||||||
net_current_desktop, cardinal, num);
|
net_current_desktop, cardinal, num);
|
||||||
|
|
||||||
if (old == num) return;
|
|
||||||
|
|
||||||
screen_last_desktop = old;
|
screen_last_desktop = old;
|
||||||
|
|
||||||
ob_debug("Moving to desktop %d\n", num+1);
|
ob_debug("Moving to desktop %d\n", num+1);
|
||||||
|
|
Loading…
Reference in a new issue