From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3e1162e60701021434x2b4645lbadc2eb581264c47@mail.gmail.com> Date: Tue, 2 Jan 2007 14:34:28 -0800 From: "David Leimbach" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] winwatch In-Reply-To: <5ae4abb1c9261dbdfe9e4828d5620e27@proxima.alt.za> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5ae4abb1c9261dbdfe9e4828d5620e27@proxima.alt.za> Topicbox-Message-UUID: fcd99172-ead1-11e9-9d60-3106f5b1d025 I implemented hide once, then decided I didn't need it :-). So did a few other people. And given your comment about communicating with mice is probably well warranted :-) See: http://research.microsoft.com/Users/luca/Papers/Squeak.pdf On 1/1/07, lucio@proxima.alt.za wrote: > I replaced the code in click() with the following to add a half-baked > facility to hide a window with winwatch. It uses the B3-B1 chord, but > somehow loses the ability to pick a window with B3 when the winwatch > window is not active. > > void > click(Mouse m) > { > int fd, w, b = m.buttons; > Point xy = m.xy; > char buf[128]; > > do > m = emouse(); > while(m.buttons == b); > > while (b) { > for(w = 0; w < nwin; w++) > if(ptinrect(xy, win[w].r)) > break; > if(w < nwin) { > sprint(buf, "/dev/wsys/%d/wctl", win[w].n); > switch (b & 7) { > case 1: > break; > case 2: > case 3: > break; > case 4: > case 6: > case 7: > if((fd = open(buf, OWRITE)) < 0) > return; > write(fd, "unhide\n", 7); > write(fd, "top\n", 4); > write(fd, "current\n", 8); > close(fd); > break; > case 5: > if((fd = open(buf, OWRITE)) < 0) > return; > write(fd, "top\n", 4); > write(fd, "hide\n", 7); > close(fd); > break; > } > } > b = m.buttons; > xy = m.xy; > do { > m = emouse(); > } while (m.buttons); > } > } > > I am a little disappointed as to how complicated it is to implement > mouse functionality. It seems a lot easier to expect the interactive > human to recover from unexpected conditions rather than try to design > the interaction so no condition is unexpected. This is not a > criticism of Plan 9, far from it. It is the realisation that by > putting a computer on every desk we (computer programmer, glorified or > otherwise) have turned computers from convenient slaves to eliminate > tedium to instruments requiring constant human attention. > > ++L > >