home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume3 / awm2 / part12 / Grab.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-02-21  |  1.4 KB  |  59 lines

  1.  
  2.  
  3.  
  4. #ifndef lint
  5. static char *rcsid_Grab_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Grab.c,v 1.2 89/02/07 20:05:05 jkh Exp $";
  6. #endif  lint
  7.  
  8. #include "X11/copyright.h"
  9. /*
  10.  *
  11.  * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  12.  *
  13.  * Copyright 1987 by Jordan Hubbard.
  14.  *
  15.  *
  16.  *                         All Rights Reserved
  17.  *
  18.  * Permission to use, copy, modify, and distribute this software and its
  19.  * documentation for any purpose and without fee is hereby granted,
  20.  * provided that the above copyright notice appear in all copies and that
  21.  * both that copyright notice and this permission notice appear in
  22.  * supporting documentation, and that the name of Ardent Computer
  23.  * Corporation or Jordan Hubbard not be used in advertising or publicity
  24.  * pertaining to distribution of the software without specific, written
  25.  * prior permission.
  26.  *
  27.  */
  28.  
  29. /*
  30.  * MODIFICATION HISTORY
  31.  *
  32.  * 002 -- Jordan Hubbard, Ardent Computer
  33.  *   Modifications for addition contexts.
  34.  */
  35.  
  36. #include "X11/Xlib.h"
  37. #include "awm.h"
  38.  
  39. void grab_pointer()
  40. {
  41.      Entry("grab_pointer")
  42.  
  43.      if (XGrabPointer( dpy, RootWindow(dpy, scr),
  44.               TRUE, (unsigned int) EVENTMASK, GrabModeAsync,
  45.               GrabModeAsync, None,
  46.               ArrowCrossCursor, CurrentTime )
  47.      != GrabSuccess )
  48.       fprintf(stderr, "awm (grab_pointer): Can't grab the mouse.");
  49.       Leave_void
  50. }
  51.  
  52. void ungrab_pointer()
  53. {
  54.      Entry("ungrab_pointer")
  55.  
  56.      XUngrabPointer(dpy, CurrentTime);
  57.      Leave_void
  58. }
  59.