* [9fans] drawterm update to gui-osx/screen.c
@ 2009-03-20 17:17 Jeff Sickel
0 siblings, 0 replies; only message in thread
From: Jeff Sickel @ 2009-03-20 17:17 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
This is the same patch that I applied to devdraw, just in the current
drawterm code base. kEventAppShown gets called when the application
comes out from being hidden/screen saver/etc. Without catching it and
passing it on, we get a blank white window until a resize or
fullscreen event occurs.
-jas
[cpu:cmd/drawterm/gui-osx] jas% cvs diff .
? plan9bunny.icns
cvs diff: Diffing .
Index: screen.c
===================================================================
RCS file: /cvs/drawterm/gui-osx/screen.c,v
retrieving revision 1.12
diff -r1.12 screen.c
95,98d94
< // devRect.origin.x = 0;
< // devRect.origin.y = 0;
< // devRect.size.width = 1024;
< // devRect.size.height = 768;
115c111
< static OSStatus ApplicationQuitEventHandler(EventHandlerCallRef
nextHandler, EventRef event, void *userData);
---
> static OSStatus ApplicationEventHandler(EventHandlerCallRef next,
EventRef event, void *arg);
167c163,164
< const EventTypeSpec quit_events[] = {
---
> const EventTypeSpec app_events[] = {
> { kEventClassApplication, kEventAppShown },
187,189c184,186
< NewEventHandlerUPP (ApplicationQuitEventHandler),
< GetEventTypeCount(quit_events),
< quit_events,
---
> NewEventHandlerUPP (ApplicationEventHandler),
> GetEventTypeCount(app_events),
> app_events,
341c338,339
< static OSStatus ApplicationQuitEventHandler(EventHandlerCallRef
nextHandler, EventRef event, void *userData)
---
> // and other Application events
> static OSStatus ApplicationEventHandler(EventHandlerCallRef next,
EventRef event, void *arg)
343,345c341,354
< exit(0);
< // QuitApplicationEventLoop();
< return noErr;
---
> OSStatus result = noErr;
> switch(GetEventKind(event)){
> case kEventAppShown:;
> Rectangle r = Rect(0, 0, bounds.size.width, bounds.size.height);
> flushmemscreen(r);
> result = eventNotHandledErr;
> break;
>
> case kEventAppQuit:
> exit(0);
> // QuitApplicationEventLoop();
> }
>
> return result;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-20 17:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-20 17:17 [9fans] drawterm update to gui-osx/screen.c Jeff Sickel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).