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 atime;
|
||||||
__u64 mtime;
|
__u64 mtime;
|
||||||
__u64 ctime;
|
__u64 ctime;
|
||||||
#if (__FreeBSD__ >= 10 && __OSX_VERSION__ >= 100500)
|
#if (__FreeBSD__ >= 10 && OSX_VERSION >= 100500)
|
||||||
__u64 crtime;
|
__u64 crtime;
|
||||||
#endif /* __FreeBSD__ >= 10 */
|
#endif /* __FreeBSD__ >= 10 */
|
||||||
__u32 atimensec;
|
__u32 atimensec;
|
||||||
__u32 mtimensec;
|
__u32 mtimensec;
|
||||||
__u32 ctimensec;
|
__u32 ctimensec;
|
||||||
#if (__FreeBSD__ >= 10 && __OSX_VERSION__ >= 100500)
|
#if (__FreeBSD__ >= 10 && OSX_VERSION >= 100500)
|
||||||
__u32 crtimensec;
|
__u32 crtimensec;
|
||||||
#endif /* __FreeBSD__ >= 10 */
|
#endif /* __FreeBSD__ >= 10 */
|
||||||
__u32 mode;
|
__u32 mode;
|
||||||
|
|
@ -80,7 +80,7 @@ struct fuse_attr {
|
||||||
__u32 rdev;
|
__u32 rdev;
|
||||||
#if (__FreeBSD__ >= 10)
|
#if (__FreeBSD__ >= 10)
|
||||||
__u32 flags; /* file flags; see chflags(2) */
|
__u32 flags; /* file flags; see chflags(2) */
|
||||||
#if __OSX_VERSION__ < 100500
|
#if OSX_VERSION < 100500
|
||||||
__u32 padding;
|
__u32 padding;
|
||||||
#endif /* __OSX_VERSION__ < 100500 */
|
#endif /* __OSX_VERSION__ < 100500 */
|
||||||
#endif /* __FreeBSD__ >= 10 */
|
#endif /* __FreeBSD__ >= 10 */
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,9 @@ extern Rectangle mouserect;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
char *label;
|
char *label;
|
||||||
|
int newlabel;
|
||||||
char *winsize;
|
char *winsize;
|
||||||
|
QLock labellock;
|
||||||
|
|
||||||
Rectangle fullscreenr;
|
Rectangle fullscreenr;
|
||||||
Rectangle screenr;
|
Rectangle screenr;
|
||||||
|
|
@ -88,7 +90,7 @@ attachscreen(char *label, char *winsize)
|
||||||
{
|
{
|
||||||
if(label == nil)
|
if(label == nil)
|
||||||
label = "gnot a label";
|
label = "gnot a label";
|
||||||
osx.label = label;
|
osx.label = strdup(label);
|
||||||
osx.winsize = winsize;
|
osx.winsize = winsize;
|
||||||
if(osx.screenimage == nil){
|
if(osx.screenimage == nil){
|
||||||
screeninit();
|
screeninit();
|
||||||
|
|
@ -244,6 +246,14 @@ eventhandler(EventHandlerCallRef next, EventRef event, void *arg)
|
||||||
{
|
{
|
||||||
OSStatus result;
|
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);
|
result = CallNextEventHandler(next, event);
|
||||||
|
|
||||||
switch(GetEventClass(event)){
|
switch(GetEventClass(event)){
|
||||||
|
|
@ -828,6 +838,36 @@ setlabel(char *label)
|
||||||
CFRelease(cs);
|
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
|
static void
|
||||||
seticon(void)
|
seticon(void)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ void putsnarf(char*);
|
||||||
|
|
||||||
void mousetrack(int, int, int, int);
|
void mousetrack(int, int, int, int);
|
||||||
void keystroke(int);
|
void keystroke(int);
|
||||||
|
void kicklabel(char*);
|
||||||
|
|
||||||
extern Rectangle mouserect;
|
extern Rectangle mouserect;
|
||||||
extern int mouseresized;
|
extern int mouseresized;
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,7 @@ runmsg(Wsysmsg *m)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Tlabel:
|
case Tlabel:
|
||||||
setlabel(m->label);
|
kicklabel(m->label);
|
||||||
replymsg(m);
|
replymsg(m);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue