File: xdga-setmode.c

package info (click to toggle)
libx11-protocol-other-perl 31-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,760 kB
  • sloc: perl: 17,593; ansic: 666; sh: 285; lisp: 143; makefile: 42
file content (32 lines) | stat: -rw-r--r-- 651 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/extensions/Xxf86dga.h>

int
error_handler (Display *display, XErrorEvent *error)
{
  printf ("ignore error\n");
}

int
main (void)
{
  int i;
  Display *display = XOpenDisplay(NULL);
  if (! display) abort();
  Window root = DefaultRootWindow(display);
  int screen = DefaultScreen(display);
  int mode = -1;

  XSetErrorHandler(&error_handler);
  
  for (i = 0; i < 1000; i++) {
    Pixmap pixmap = XCreatePixmap(display, root, 1,1,1);
    printf ("pixmap %X\n", pixmap);
    XFreePixmap(display,pixmap);
    
    /* XDGASetMode (display, screen, mode); */
  }
  return 0;
}