- if (!desktop_popup) {
- desktop_popup = g_new(ObPagerPopup*, screen_num_monitors);
- for (i = 0; i < screen_num_monitors; i++) {
+ if (screen_num_monitors < onum) {
+ /* free some of the pager popups */
+ for (i = screen_num_monitors; i < onum; ++i)
+ pager_popup_free(desktop_popup[i]);
+ desktop_popup = g_renew(ObPagerPopup*, desktop_popup,
+ screen_num_monitors);
+ }
+ else {
+ /* add some more pager popups */
+ desktop_popup = g_renew(ObPagerPopup*, desktop_popup,
+ screen_num_monitors);
+ for (i = onum; i < screen_num_monitors; ++i) {