devdraw: release multitouch mouse when app is collapsed (minimized)
R=rsc CC=plalonde, r http://codereview.appspot.com/181129
This commit is contained in:
parent
100ec44e51
commit
7d9c0f0f0e
1 changed files with 15 additions and 1 deletions
|
|
@ -60,6 +60,7 @@ struct {
|
||||||
int infullscreen;
|
int infullscreen;
|
||||||
int kalting; // last keystroke was Kalt
|
int kalting; // last keystroke was Kalt
|
||||||
int touched; // last mouse event was touchCallback
|
int touched; // last mouse event was touchCallback
|
||||||
|
int collapsed; // parked in dock
|
||||||
NSMutableArray* devicelist;
|
NSMutableArray* devicelist;
|
||||||
} osx;
|
} osx;
|
||||||
|
|
||||||
|
|
@ -383,6 +384,8 @@ _screeninit(void)
|
||||||
{ kEventClassCommand, kEventCommandProcess },
|
{ kEventClassCommand, kEventCommandProcess },
|
||||||
{ kEventClassWindow, kEventWindowActivated },
|
{ kEventClassWindow, kEventWindowActivated },
|
||||||
{ kEventClassWindow, kEventWindowDeactivated },
|
{ kEventClassWindow, kEventWindowDeactivated },
|
||||||
|
{ kEventClassWindow, kEventWindowCollapsed },
|
||||||
|
{ kEventClassWindow, kEventWindowExpanded },
|
||||||
};
|
};
|
||||||
const EventTypeSpec events[] = {
|
const EventTypeSpec events[] = {
|
||||||
{ kEventClassApplication, kEventAppShown },
|
{ kEventClassApplication, kEventAppShown },
|
||||||
|
|
@ -517,13 +520,24 @@ eventhandler(EventHandlerCallRef next, EventRef event, void *arg)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kEventWindowActivated:
|
case kEventWindowActivated:
|
||||||
activated(1);
|
if(!osx.collapsed)
|
||||||
|
activated(1);
|
||||||
return eventNotHandledErr;
|
return eventNotHandledErr;
|
||||||
|
|
||||||
case kEventWindowDeactivated:
|
case kEventWindowDeactivated:
|
||||||
activated(0);
|
activated(0);
|
||||||
return eventNotHandledErr;
|
return eventNotHandledErr;
|
||||||
|
|
||||||
|
case kEventWindowCollapsed:
|
||||||
|
osx.collapsed = 1;
|
||||||
|
activated(0);
|
||||||
|
return eventNotHandledErr;
|
||||||
|
|
||||||
|
case kEventWindowExpanded:
|
||||||
|
osx.collapsed = 0;
|
||||||
|
activated(1);
|
||||||
|
return eventNotHandledErr;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return eventNotHandledErr;
|
return eventNotHandledErr;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue