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 kalting; // last keystroke was Kalt
|
||||
int touched; // last mouse event was touchCallback
|
||||
int collapsed; // parked in dock
|
||||
NSMutableArray* devicelist;
|
||||
} osx;
|
||||
|
||||
|
|
@ -383,6 +384,8 @@ _screeninit(void)
|
|||
{ kEventClassCommand, kEventCommandProcess },
|
||||
{ kEventClassWindow, kEventWindowActivated },
|
||||
{ kEventClassWindow, kEventWindowDeactivated },
|
||||
{ kEventClassWindow, kEventWindowCollapsed },
|
||||
{ kEventClassWindow, kEventWindowExpanded },
|
||||
};
|
||||
const EventTypeSpec events[] = {
|
||||
{ kEventClassApplication, kEventAppShown },
|
||||
|
|
@ -517,13 +520,24 @@ eventhandler(EventHandlerCallRef next, EventRef event, void *arg)
|
|||
break;
|
||||
|
||||
case kEventWindowActivated:
|
||||
activated(1);
|
||||
if(!osx.collapsed)
|
||||
activated(1);
|
||||
return eventNotHandledErr;
|
||||
|
||||
case kEventWindowDeactivated:
|
||||
activated(0);
|
||||
return eventNotHandledErr;
|
||||
|
||||
case kEventWindowCollapsed:
|
||||
osx.collapsed = 1;
|
||||
activated(0);
|
||||
return eventNotHandledErr;
|
||||
|
||||
case kEventWindowExpanded:
|
||||
osx.collapsed = 0;
|
||||
activated(1);
|
||||
return eventNotHandledErr;
|
||||
|
||||
default:
|
||||
return eventNotHandledErr;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue