From: Andreas Fink Date: Wed, 29 Dec 2010 10:51:23 +0000 (+0000) Subject: *fix* segfault when removing last virtual desktop while being on it X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=817b510c94ad9b5e9e0fb9d437e79d47bc2c7fe8;p=chaz%2Ftint2 *fix* segfault when removing last virtual desktop while being on it --- diff --git a/src/tint.c b/src/tint.c index bc915eb..5c96d54 100644 --- a/src/tint.c +++ b/src/tint.c @@ -524,6 +524,9 @@ void event_property_notify (XEvent *e) else if (at == server.atom._NET_NUMBER_OF_DESKTOPS) { if (!taskbar_enabled) return; server.nb_desktop = server_get_number_of_desktop (); + if (server.nb_desktop <= server.desktop) { + server.desktop = server.nb_desktop-1; + } cleanup_taskbar(); init_taskbar(); for (i=0 ; i < nb_panel ; i++) {