tdevdraw: flush window on kEventAppShow - plan9port - [fork] Plan 9 from user space
HTML git clone git://src.adamsgaard.dk/plan9port
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 834d2a4dffe28ce4119d610028e9e48c59cefe4d
DIR parent 9a0e0048423b0afe1da390354eca315d06ef165b
HTML Author: Jeff Sicket <jas@corpus-callosum.com>
Date: Sun, 17 May 2009 11:07:09 -0700
devdraw: flush window on kEventAppShow
Diffstat:
M src/cmd/devdraw/osx-screen.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
DIR diff --git a/src/cmd/devdraw/osx-screen.c b/src/cmd/devdraw/osx-screen.c
t@@ -80,6 +80,7 @@ enum
};
void screeninit(void);
+void _flushmemscreen(Rectangle r);
Memimage*
attachscreen(char *label, char *winsize)
t@@ -126,7 +127,7 @@ _screeninit(void)
CFSTR("Full Screen"), 0, CmdFullScreen, &ix);
SetMenuItemCommandKey(osx.vmenu, ix, 0, 'F');
AppendMenuItemTextWithCFString(osx.vmenu,
- CFSTR("Ctl-Opt exits full screen"),
+ CFSTR("Cmd-F exits full screen"),
kMenuItemAttrDisabled, CmdFullScreen, &ix);
InsertMenu(osx.vmenu, GetMenuID(osx.wmenu));
DrawMenuBar();
t@@ -165,6 +166,7 @@ _screeninit(void)
{ kEventClassWindow, kEventWindowDeactivated },
};
const EventTypeSpec events[] = {
+ { kEventClassApplication, kEventAppShown },
{ kEventClassKeyboard, kEventRawKeyDown },
{ kEventClassKeyboard, kEventRawKeyModifiersChanged },
{ kEventClassKeyboard, kEventRawKeyRepeat },
t@@ -244,6 +246,11 @@ eventhandler(EventHandlerCallRef next, EventRef event, void *arg)
result = CallNextEventHandler(next, event);
switch(GetEventClass(event)){
+ case kEventClassApplication:;
+ Rectangle r = Rect(0, 0, Dx(osx.screenr), Dy(osx.screenr));
+ _flushmemscreen(r);
+ return eventNotHandledErr;
+
case kEventClassKeyboard:
return kbdevent(event);
t@@ -267,7 +274,7 @@ eventhandler(EventHandlerCallRef next, EventRef event, void *arg)
}
break;
- case kEventClassWindow:;
+ case kEventClassWindow:
switch(GetEventKind(event)){
case kEventWindowClosed:
exit(0);