cure wmiiwm sudden death on removal of last remaining page

This commit is contained in:
Sander van Dijk 2006-01-21 22:45:11 +01:00
parent a8f1f17fb8
commit f08f943282
2 changed files with 12 additions and 7 deletions

View File

@ -103,10 +103,12 @@ destroy_page(Page * p)
}
if(p == pages) {
if(p->next)
if(p->next) {
p->next->prev = nil;
pages = p->next;
pages->index = 0;
pages = p->next;
pages->index = 0;
} else
pages = nil;
} else {
p->prev->next = p->next;
if(p->next)
@ -132,8 +134,11 @@ destroy_page(Page * p)
void
focus_page(Page * p)
{
if(!p)
if(!p) {
XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
invoke_wm_event(def[WM_EVENT_PAGE_UPDATE]);
return;
}
if((p != selpage)) {
if(selpage) {

6
rc/wmiirc Normal file → Executable file
View File

@ -111,9 +111,9 @@ wmiir write /wm/event/clientupdate \
'text=`{wmiir read /wm/sel/layout/sel/frame/sel/name}' ^\
'wmiir write /bar/'^$clab^'/data $"text'
wmiir write /wm/event/pageupdate \
'wmiir write /bar/'^$plab^'/data `{wmiir read /wm/sel/name} &&' ^\
'wmiir write /bar/'^$klab^'/data `{wmiir read /keys/lookup|sed ''s|/mode/||''} && ' ^\
'wmiir write /bar/'^$llab^'/data `{wmiir read /wm/sel/layout/sel/name}'
'text=`{wmiir read /wm/sel/name}; wmiir write /bar/'^$plab^'/data $"text &&' ^\
'text=`{wmiir read /keys/lookup|sed ''s|/mode/||''}; wmiir write /bar/'^$klab^'/data $"text && ' ^\
'text=`{wmiir read /wm/sel/layoutname}; wmiir write /bar/'^$llab^'/data $"text'
for(page in `{wmiir read /wm | grep '^[0-9]'}) {
framesconf /wm/$page/layout/float/frame