9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Jeff Sickel <jas@corpus-callosum.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] drawterm update to gui-osx/screen.c
Date: Fri, 20 Mar 2009 12:17:00 -0500	[thread overview]
Message-ID: <1DCB1697-9715-43B9-891B-89EAE039B55B@corpus-callosum.com> (raw)

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;




                 reply	other threads:[~2009-03-20 17:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1DCB1697-9715-43B9-891B-89EAE039B55B@corpus-callosum.com \
    --to=jas@corpus-callosum.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).