minor tweaks

This commit is contained in:
David Rose 2009-08-22 22:17:05 +00:00
parent f6863b7b7a
commit cf6a220cb7
4 changed files with 14 additions and 15 deletions

View File

@ -1183,9 +1183,13 @@ make_splash_window() {
// Don't know where to put it yet.
return;
}
if (_wparams.get_window_type() == P3D_WT_toplevel && !_stuff_to_download) {
// If it's a toplevel window, then we don't want a splash window
// until we have stuff to download.
if (_wparams.get_window_type() == P3D_WT_hidden) {
// We're hidden, and so is the splash window.
return;
}
if (_wparams.get_window_type() != P3D_WT_embedded && !_stuff_to_download) {
// If it's a toplevel or fullscreen window, then we don't want a
// splash window until we have stuff to download.
return;
}

View File

@ -78,8 +78,9 @@ set_wparams(const P3DWindowParams &wparams) {
r.top = _wparams.get_win_y();
r.left = _wparams.get_win_x();
if (r.top == 0 && r.left == 0) {
r.top = 250;
r.left = 210;
// These are the same defaults used by Panda's osxGraphicsWindow.
r.top = 50;
r.left = 10;
}
r.right = r.left + _wparams.get_win_width();

View File

@ -191,9 +191,7 @@ new_stream(NPMIMEType type, NPStream *stream, bool seekable, uint16 *stype) {
// We don't want the rest of this stream any more, but we can't
// just return NPERR_GENERIC_ERROR, though--that seems to freak
// out Mozilla. Instead, we'll "accept" it for now, and then
// immediately stop it when we get the first write_stream()
// call.
// out Firefox.
stream->notifyData = new PPDownloadRequest(PPDownloadRequest::RT_instance_data);
*stype = NP_NORMAL;
@ -255,11 +253,10 @@ write_stream(NPStream *stream, int offset, int len, void *buffer) {
return len;
case PPDownloadRequest::RT_instance_data:
// Here's a stream we don't really want. But stopping it early
// Here's a stream we don't really want. But stopping it here
// seems to freak out Safari. (And stopping it before it starts
// freaks out Firefox.)
// Whatever. We'll just quietly ignore the data.
// freaks out Firefox.) Whatever. We'll just quietly ignore the
// data.
return len;
default:
@ -301,8 +298,6 @@ destroy_stream(NPStream *stream, NPReason reason) {
break;
case PPDownloadRequest::RT_instance_data:
// We won't get a url_notify on this one, so delete it now.
delete req;
break;
default:

View File

@ -386,7 +386,6 @@ read_contents_file(Filename contents_filename, const string &download_url,
ifstream in;
contents_filename.set_text();
if (!contents_filename.open_read(in)) {
cerr << "Couldn't read " << contents_filename.to_os_specific() << "\n";
return false;
}