merge
This commit is contained in:
commit
77ac358321
4 changed files with 29 additions and 18 deletions
|
|
@ -77,10 +77,10 @@ rcstart(int argc, char **argv, int *pfd, int *tfd)
|
|||
*/
|
||||
notifyoff("sys: window size change");
|
||||
|
||||
putenv("TERM", "9term");
|
||||
pid = fork();
|
||||
switch(pid){
|
||||
case 0:
|
||||
putenv("TERM", "9term");
|
||||
sfd = childpty(fd, slave);
|
||||
dup(sfd, 0);
|
||||
dup(sfd, 1);
|
||||
|
|
|
|||
|
|
@ -513,7 +513,8 @@ rowload(Row *row, char *file, int initing)
|
|||
double percent;
|
||||
Biobuf *b, *bout;
|
||||
char *buf, *l, *t, *fontname;
|
||||
Rune *r, rune, *fontr;
|
||||
Rune *r, *fontr;
|
||||
int rune;
|
||||
Column *c, *c1, *c2;
|
||||
uint q0, q1;
|
||||
Rectangle r1, r2;
|
||||
|
|
@ -739,7 +740,7 @@ rowload(Row *row, char *file, int initing)
|
|||
rune = Bgetrune(b);
|
||||
if(rune == '\n')
|
||||
line++;
|
||||
if(rune == (Rune)Beof){
|
||||
if(rune == Beof){
|
||||
free(r);
|
||||
Bterm(bout);
|
||||
free(bout);
|
||||
|
|
|
|||
|
|
@ -238,27 +238,27 @@ void
|
|||
xcpu(int first)
|
||||
{
|
||||
static int stathz;
|
||||
union {
|
||||
ulong x[20];
|
||||
struct clockinfo *ci;
|
||||
struct clockinfo ci;
|
||||
} u;
|
||||
int n;
|
||||
|
||||
if(first){
|
||||
if(rsys("kern.clockrate", (char*)&x, sizeof x) < sizeof ci)
|
||||
if(rsys("kern.clockrate", (char*)u.x, sizeof u.x) < sizeof u.ci)
|
||||
stathz = 128;
|
||||
else{
|
||||
ci = (struct clockinfo*)x;
|
||||
stathz = ci->stathz;
|
||||
}
|
||||
else
|
||||
stathz = u.ci.stathz;
|
||||
return;
|
||||
}
|
||||
|
||||
if((n=rsys("kern.cp_time", (char*)x, sizeof x)) < 5*sizeof(ulong))
|
||||
if((n=rsys("kern.cp_time", (char*)u.x, sizeof u.x)) < 5*sizeof(ulong))
|
||||
return;
|
||||
|
||||
Bprint(&bout, "user %lud %d\n", x[CP_USER]+x[CP_NICE], stathz);
|
||||
Bprint(&bout, "sys %lud %d\n", x[CP_SYS], stathz);
|
||||
Bprint(&bout, "cpu %lud %d\n", x[CP_USER]+x[CP_NICE]+x[CP_SYS], stathz);
|
||||
Bprint(&bout, "idle %lud %d\n", x[CP_IDLE], stathz);
|
||||
Bprint(&bout, "user %lud %d\n", u.x[CP_USER]+u.x[CP_NICE], stathz);
|
||||
Bprint(&bout, "sys %lud %d\n", u.x[CP_SYS], stathz);
|
||||
Bprint(&bout, "cpu %lud %d\n", u.x[CP_USER]+u.x[CP_NICE]+u.x[CP_SYS], stathz);
|
||||
Bprint(&bout, "idle %lud %d\n", u.x[CP_IDLE], stathz);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ struct {
|
|||
QLock flushlock;
|
||||
int active;
|
||||
int infullscreen;
|
||||
int kalting; // last keystroke was Kalt
|
||||
} osx;
|
||||
|
||||
enum
|
||||
|
|
@ -346,8 +347,14 @@ mouseevent(EventRef event)
|
|||
// (Modifiers typed while holding the button go into kbuttons,
|
||||
// but this one does not.)
|
||||
if(but == 1){
|
||||
if(mod & optionKey)
|
||||
if(mod & optionKey) {
|
||||
// Take the ALT away from the keyboard handler.
|
||||
if(osx.kalting) {
|
||||
osx.kalting = 0;
|
||||
keystroke(Kalt);
|
||||
}
|
||||
but = 2;
|
||||
}
|
||||
else if(mod & cmdKey)
|
||||
but = 4;
|
||||
}
|
||||
|
|
@ -434,6 +441,7 @@ kbdevent(EventRef event)
|
|||
switch(GetEventKind(event)){
|
||||
case kEventRawKeyDown:
|
||||
case kEventRawKeyRepeat:
|
||||
osx.kalting = 0;
|
||||
if(mod == cmdKey){
|
||||
if(ch == 'F' || ch == 'f'){
|
||||
if(osx.isfullscreen && msec() - osx.fullscreentime > 500)
|
||||
|
|
@ -475,8 +483,10 @@ kbdevent(EventRef event)
|
|||
|
||||
case kEventRawKeyModifiersChanged:
|
||||
if(!osx.buttons && !osx.kbuttons){
|
||||
if(mod == optionKey)
|
||||
if(mod == optionKey) {
|
||||
osx.kalting = 1;
|
||||
keystroke(Kalt);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -813,7 +823,7 @@ setlabel(char *label)
|
|||
{
|
||||
CFStringRef cs;
|
||||
|
||||
cs = CFStringCreateWithBytes(nil, (uchar*)osx.label, strlen(osx.label), kCFStringEncodingUTF8, false);
|
||||
cs = CFStringCreateWithBytes(nil, (uchar*)label, strlen(label), kCFStringEncodingUTF8, false);
|
||||
SetWindowTitleWithCFString(osx.window, cs);
|
||||
CFRelease(cs);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue