changeset: 2047:906bd4fd971d
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Fri Mar 30 00:26:35 2007 -0400
summary: The 'nil' view is no longer particularly special. Generate CreateTag events before CreteArea events.
diff -r 2f3cf6cd70eb -r 906bd4fd971d cmd/wmii/fs.c
--- a/cmd/wmii/fs.c Tue Mar 27 17:39:00 2007 -0400
+++ b/cmd/wmii/fs.c Fri Mar 30 00:26:35 2007 -0400
@@ -281,8 +281,7 @@ message_root(char *message)
return Ebadvalue;
strncpy(def.grabmod, message, sizeof(def.grabmod));
def.mod = mod;
- if(view)
- restack_view(screen->sel);
+ restack_view(screen->sel);
}
else
return Ebadcmd;
diff -r 2f3cf6cd70eb -r 906bd4fd971d cmd/wmii/main.c
--- a/cmd/wmii/main.c Tue Mar 27 17:39:00 2007 -0400
+++ b/cmd/wmii/main.c Fri Mar 30 00:26:35 2007 -0400
@@ -564,9 +564,9 @@ main(int argc, char *argv[]) {
scan_wins();
starting = False;
+ select_view("nil");
update_views();
- if(view)
- write_event("FocusTag %s\n", screen->sel->name);
+ write_event("FocusTag %s\n", screen->sel->name);
check_x_event(nil);
errstr = ixp_serverloop(&srv);
diff -r 2f3cf6cd70eb -r 906bd4fd971d cmd/wmii/view.c
--- a/cmd/wmii/view.c Tue Mar 27 17:39:00 2007 -0400
+++ b/cmd/wmii/view.c Fri Mar 30 00:26:35 2007 -0400
@@ -58,17 +58,21 @@ View *
View *
create_view(const char *name) {
static ushort id = 1;
- View **i, *v = emallocz(sizeof(View));
-
+ View **i, *v;
+
+ v = emallocz(sizeof(View));
v->id = id++;
strncpy(v->name, name, sizeof(v->name));
+
+ write_event("CreateTag %s\n", v->name);
create_area(v, nil, 0);
create_area(v, v->area, 0);
+
for(i=&view; *i; i=&(*i)->next)
if(strcmp((*i)->name, name) < 0) break;
v->next = *i;
*i = v;
- write_event("CreateTag %s\n", v->name);
+
if(!screen->sel)
assign_sel_view(v);
return v;
@@ -407,20 +411,19 @@ send:
void
update_views() {
- View *n, *v;
- View *old = screen->sel;
-
+ View *n, *v, *old;
+
+ old = screen->sel;
for(v=view; v; v=v->next)
update_frame_selectors(v);
- if(old && !strncmp(old->name, "nil", 4))
- old = nil;
- for((v=view) && (n=v->next); v; (v=n) && (n=v->next))
+
+ for(v=view; v; v=n) {
+ n=v->next;
if((v != old) && is_empty(v))
destroy_view(v);
- if(old)
- focus_view(screen, old);
- else if(screen->sel)
- focus_view(screen, screen->sel);
+ }
+
+ focus_view(screen, old);
}
uint
Received on Fri Mar 30 2007 - 06:31:29 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:30 UTC