merge
This commit is contained in:
commit
4a34106c7d
4 changed files with 46 additions and 5 deletions
|
|
@ -64,13 +64,13 @@ struct fuse_attr {
|
|||
__u64 atime;
|
||||
__u64 mtime;
|
||||
__u64 ctime;
|
||||
#if (__FreeBSD__ >= 10 && __OSX_VERSION__ >= 100500)
|
||||
#if (__FreeBSD__ >= 10 && OSX_VERSION >= 100500)
|
||||
__u64 crtime;
|
||||
#endif /* __FreeBSD__ >= 10 */
|
||||
__u32 atimensec;
|
||||
__u32 mtimensec;
|
||||
__u32 ctimensec;
|
||||
#if (__FreeBSD__ >= 10 && __OSX_VERSION__ >= 100500)
|
||||
#if (__FreeBSD__ >= 10 && OSX_VERSION >= 100500)
|
||||
__u32 crtimensec;
|
||||
#endif /* __FreeBSD__ >= 10 */
|
||||
__u32 mode;
|
||||
|
|
@ -80,7 +80,7 @@ struct fuse_attr {
|
|||
__u32 rdev;
|
||||
#if (__FreeBSD__ >= 10)
|
||||
__u32 flags; /* file flags; see chflags(2) */
|
||||
#if __OSX_VERSION__ < 100500
|
||||
#if OSX_VERSION < 100500
|
||||
__u32 padding;
|
||||
#endif /* __OSX_VERSION__ < 100500 */
|
||||
#endif /* __FreeBSD__ >= 10 */
|
||||
|
|
|
|||
|
|
@ -29,7 +29,9 @@ extern Rectangle mouserect;
|
|||
|
||||
struct {
|
||||
char *label;
|
||||
int newlabel;
|
||||
char *winsize;
|
||||
QLock labellock;
|
||||
|
||||
Rectangle fullscreenr;
|
||||
Rectangle screenr;
|
||||
|
|
@ -88,7 +90,7 @@ attachscreen(char *label, char *winsize)
|
|||
{
|
||||
if(label == nil)
|
||||
label = "gnot a label";
|
||||
osx.label = label;
|
||||
osx.label = strdup(label);
|
||||
osx.winsize = winsize;
|
||||
if(osx.screenimage == nil){
|
||||
screeninit();
|
||||
|
|
@ -244,6 +246,14 @@ eventhandler(EventHandlerCallRef next, EventRef event, void *arg)
|
|||
{
|
||||
OSStatus result;
|
||||
|
||||
if(osx.newlabel) {
|
||||
// dummy message so we update the label
|
||||
qlock(&osx.labellock);
|
||||
setlabel(osx.label);
|
||||
osx.newlabel = 0;
|
||||
qunlock(&osx.labellock);
|
||||
}
|
||||
|
||||
result = CallNextEventHandler(next, event);
|
||||
|
||||
switch(GetEventClass(event)){
|
||||
|
|
@ -828,6 +838,36 @@ setlabel(char *label)
|
|||
CFRelease(cs);
|
||||
}
|
||||
|
||||
void
|
||||
kicklabel(char *label)
|
||||
{
|
||||
char *p;
|
||||
|
||||
p = strdup(label);
|
||||
if(p == nil)
|
||||
return;
|
||||
qlock(&osx.labellock);
|
||||
free(osx.label);
|
||||
osx.newlabel = 1;
|
||||
osx.label = p;
|
||||
qunlock(&osx.labellock);
|
||||
|
||||
// TODO(rsc): It would be great to send an OS X event to the
|
||||
// event handling loop to force the update of the label,
|
||||
// but I cannot manage to do this.
|
||||
// int i;
|
||||
// EventRef ev;
|
||||
/*
|
||||
ev = 0;
|
||||
i = CreateEvent(nil, kEventClassApplication, 0, 0, 0, &ev);
|
||||
if(i != 0)
|
||||
fprint(2, "CreateEvent: %d\n", i);
|
||||
i = SendEventToEventTarget(ev, GetUserFocusEventTarget());
|
||||
if(i != 0)
|
||||
fprint(2, "SendEventToEventTarget %p: %d\n", ev, i);
|
||||
*/
|
||||
}
|
||||
|
||||
static void
|
||||
seticon(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ void putsnarf(char*);
|
|||
|
||||
void mousetrack(int, int, int, int);
|
||||
void keystroke(int);
|
||||
void kicklabel(char*);
|
||||
|
||||
extern Rectangle mouserect;
|
||||
extern int mouseresized;
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ runmsg(Wsysmsg *m)
|
|||
break;
|
||||
|
||||
case Tlabel:
|
||||
setlabel(m->label);
|
||||
kicklabel(m->label);
|
||||
replymsg(m);
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue