Changeset 1090


Ignore:
Timestamp:
Jun 6, 2008, 10:24:50 AM (10 years ago)
Author:
Daniel Kahn Gillmor
Message:

[svn-upgrade] Integrating new upstream version, xdotool (20080606)

Location:
branches/upstream/xdotool/current
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/upstream/xdotool/current/CHANGELIST

    r1085 r1090  
     120080606:
     2  * Correctly report an error if xdotool is invoked with an invalid command.
     3  * Fix invalid error code reporting from 'windowraise'
     4
    1520080603:
    26  * Daniel Kahn Gillmor reported a problem with return codes from xdotool. All
  • branches/upstream/xdotool/current/t/no_crashes_please.sh

    r1085 r1090  
    33try () {
    44  "$@" > /dev/null
    5  
     5
    66  if [ $? -ne 0 ]; then
    77    echo "FAILURE: $@"
     
    2828
    2929wid=`$xdotool search xdotool_test_window`
    30 try $xdotool windowsize $wid 50 50
     30try $xdotool windowraise $wid
     31try $xdotool windowsize $wid 500 500
    3132try $xdotool windowfocus $wid
    3233try $xdotool windowmove $wid 300 300
  • branches/upstream/xdotool/current/xdo.c

    r1085 r1090  
    11/* xdo library
    22 *
    3  * $Id: xdo.c 1891 2008-06-03 09:00:20Z jordansissel $
     3 * $Id: xdo.c 1917 2008-06-06 06:59:27Z jordansissel $
    44 *
    55 * - getwindowfocus contributed by Lee Pumphret
     
    260260  /* XXX: XSendEvent returns 0 on conversion failure, nonzero otherwise.
    261261   * Manpage says it will only generate BadWindow or BadValue errors */
    262   printf("netact:%d\n", ret);
    263262  return _is_success("XSendEvent[EWMH:_NET_ACTIVE_WINDOW]", ret == 0);
    264263}
     
    451450  ret = XRaiseWindow(xdo->xdpy, wid);
    452451  XFlush(xdo->xdpy);
    453   return _is_success("XRaiseWindow", ret);
     452  return _is_success("XRaiseWindow", ret == 0);
    454453}
    455454
  • branches/upstream/xdotool/current/xdotool.c

    r1085 r1090  
    33 * command line interface to the xdo library
    44 *
    5  * $Id: xdotool.c 1891 2008-06-03 09:00:20Z jordansissel $
     5 * $Id: xdotool.c 1894 2008-06-03 16:42:45Z jordansissel $
    66 *
    77 * getwindowfocus contributed by Lee Pumphret
     
    9090int main(int argc, char **argv) {
    9191  char *cmd;
    92   int ret = 0;
     92  char *prog;
     93  int ret = 0;
     94  int cmd_found = 0;
    9395  int i;
    9496
     
    99101  }
    100102
    101   cmd = *++argv; /* argv[1] */
    102   argc -= 1; /* ignore arg0 (program name) */
     103  prog = *argv;
     104  argv++; argc--;
     105  cmd = *argv; /* argv[1] */
    103106
    104107  xdo = xdo_new(getenv("DISPLAY"));
     
    108111  }
    109112
    110   for (i = 0; dispatch[i].name != NULL; i++) {
     113  for (i = 0; dispatch[i].name != NULL && !cmd_found; i++) {
    111114    if (!strcasecmp(dispatch[i].name, cmd)) {
    112115      ret = dispatch[i].func(argc, argv);
    113       break;
     116      cmd_found = 1;
    114117    }
     118  }
     119
     120  if (!cmd_found) {
     121    fprintf(stderr, "Unknown command: %s\n", cmd);
     122    fprintf(stderr, "Run '%s help' if you want a command list\n", prog);
     123    ret = 1;
    115124  }
    116125
Note: See TracChangeset for help on using the changeset viewer.