devdraw: flush window on kEventAppShow
This commit is contained in:
parent
9a0e004842
commit
834d2a4dff
1 changed files with 9 additions and 2 deletions
|
|
@ -80,6 +80,7 @@ enum
|
||||||
};
|
};
|
||||||
|
|
||||||
void screeninit(void);
|
void screeninit(void);
|
||||||
|
void _flushmemscreen(Rectangle r);
|
||||||
|
|
||||||
Memimage*
|
Memimage*
|
||||||
attachscreen(char *label, char *winsize)
|
attachscreen(char *label, char *winsize)
|
||||||
|
|
@ -126,7 +127,7 @@ _screeninit(void)
|
||||||
CFSTR("Full Screen"), 0, CmdFullScreen, &ix);
|
CFSTR("Full Screen"), 0, CmdFullScreen, &ix);
|
||||||
SetMenuItemCommandKey(osx.vmenu, ix, 0, 'F');
|
SetMenuItemCommandKey(osx.vmenu, ix, 0, 'F');
|
||||||
AppendMenuItemTextWithCFString(osx.vmenu,
|
AppendMenuItemTextWithCFString(osx.vmenu,
|
||||||
CFSTR("Ctl-Opt exits full screen"),
|
CFSTR("Cmd-F exits full screen"),
|
||||||
kMenuItemAttrDisabled, CmdFullScreen, &ix);
|
kMenuItemAttrDisabled, CmdFullScreen, &ix);
|
||||||
InsertMenu(osx.vmenu, GetMenuID(osx.wmenu));
|
InsertMenu(osx.vmenu, GetMenuID(osx.wmenu));
|
||||||
DrawMenuBar();
|
DrawMenuBar();
|
||||||
|
|
@ -165,6 +166,7 @@ _screeninit(void)
|
||||||
{ kEventClassWindow, kEventWindowDeactivated },
|
{ kEventClassWindow, kEventWindowDeactivated },
|
||||||
};
|
};
|
||||||
const EventTypeSpec events[] = {
|
const EventTypeSpec events[] = {
|
||||||
|
{ kEventClassApplication, kEventAppShown },
|
||||||
{ kEventClassKeyboard, kEventRawKeyDown },
|
{ kEventClassKeyboard, kEventRawKeyDown },
|
||||||
{ kEventClassKeyboard, kEventRawKeyModifiersChanged },
|
{ kEventClassKeyboard, kEventRawKeyModifiersChanged },
|
||||||
{ kEventClassKeyboard, kEventRawKeyRepeat },
|
{ kEventClassKeyboard, kEventRawKeyRepeat },
|
||||||
|
|
@ -244,6 +246,11 @@ eventhandler(EventHandlerCallRef next, EventRef event, void *arg)
|
||||||
result = CallNextEventHandler(next, event);
|
result = CallNextEventHandler(next, event);
|
||||||
|
|
||||||
switch(GetEventClass(event)){
|
switch(GetEventClass(event)){
|
||||||
|
case kEventClassApplication:;
|
||||||
|
Rectangle r = Rect(0, 0, Dx(osx.screenr), Dy(osx.screenr));
|
||||||
|
_flushmemscreen(r);
|
||||||
|
return eventNotHandledErr;
|
||||||
|
|
||||||
case kEventClassKeyboard:
|
case kEventClassKeyboard:
|
||||||
return kbdevent(event);
|
return kbdevent(event);
|
||||||
|
|
||||||
|
|
@ -267,7 +274,7 @@ eventhandler(EventHandlerCallRef next, EventRef event, void *arg)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kEventClassWindow:;
|
case kEventClassWindow:
|
||||||
switch(GetEventKind(event)){
|
switch(GetEventKind(event)){
|
||||||
case kEventWindowClosed:
|
case kEventWindowClosed:
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue