Ignore:
Timestamp:
11/07/07 03:32:14 (16 years ago)
Author:
Nicholas Riley
Message:

appswitch.1: Updated for appswitch 1.1.

VERSION: Updated for appswitch 1.1.

main.c: Updated copyright date in one place I forgot. Updated for
appswitch 1.1. Worked around Leopard CPS/Process Manager issue.

README: Updated for appswitch 1.1. Summarized changes. Fixed a
couple of omissions (e.g., -a). Removed now-fixed bugs; added the -S
breakage issue with Leopard and Spaces.

appswitch.xcodeproj: No substantive changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/appswitch/appswitch/main.c

    r345 r350  
    2626const char *APP_NAME;
    2727
    28 #define VERSION "1.1d2"
     28#define VERSION "1.1"
    2929
    3030struct {
     
    7272
    7373void usage() {
    74     fprintf(stderr, "usage: %s [-sShHqklLPfF] [-c creator] [-i bundleID] [-a name] [-p pid] [path]\n"
     74    fprintf(stderr, "usage: %s [-sShHqkKlLPfF] [-c creator] [-i bundleID] [-a name] [-p pid] [path]\n"
    7575            "  -s            show application, bring windows to front (do not switch)\n"
    7676            "  -S            show all applications\n"
     
    9090            "  -a name       match application by name\n"
    9191            , APP_NAME);
    92     fprintf(stderr, "appswitch "VERSION" (c) 2003-06 Nicholas Riley <http://web.sabi.net/nriley/software/>.\n"
     92    fprintf(stderr, "appswitch "VERSION" (c) 2003-07 Nicholas Riley <http://web.sabi.net/nriley/software/>.\n"
    9393            "Please send bugs, suggestions, etc. to <appswitch@sabi.net>.\n");
    9494
     
    431431    getargs(argc, argv);
    432432
    433     ProcessSerialNumber psn = matchApplication();
     433    ProcessSerialNumber psn;
     434   
     435    // required in Leopard to prevent paramErr - rdar://problem/5579375
     436    err = GetCurrentProcess(&psn);
     437    if (err != noErr) osstatusexit(err, "can't contact window server");
     438   
     439    psn = matchApplication();
    434440
    435441    const char *verb = NULL;
     
    438444        case APP_LIST: break; // already handled in matchApplication
    439445        case APP_SWITCH: err = SetFrontProcess(&psn); verb = "set front"; break;
    440         // XXX show/hide return paramErr - rdar://problem/5579375 - ask on carbon-dev later
    441446        case APP_SHOW: err = ShowHideProcess(&psn, true); verb = "show"; break;
    442447        case APP_HIDE: err = ShowHideProcess(&psn, false); verb = "hide"; break;
Note: See TracChangeset for help on using the changeset viewer.