~ubuntu-branches/debian/lenny/italc/lenny

« back to all changes in this revision

Viewing changes to ica/x11/x11vnc/xrandr.h

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Winnertz
  • Date: 2008-06-17 13:46:54 UTC
  • mfrom: (1.2.1 upstream) (4.1.1 gutsy)
  • Revision ID: james.westby@ubuntu.com-20080617134654-cl0gi4u524cv1ici
Tags: 1:1.0.9~rc3-1
* Package new upstream version
  - upstream ported the code to qt4.4 (Closes: #481974)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _X11VNC_XRANDR_H
 
2
#define _X11VNC_XRANDR_H
 
3
 
 
4
/* -- xrandr.h -- */
 
5
 
 
6
extern time_t last_subwin_trap;
 
7
extern int subwin_trap_count;
 
8
extern XErrorHandler old_getimage_handler;
 
9
 
 
10
extern int xrandr_present;
 
11
extern int xrandr_width;
 
12
extern int xrandr_height;
 
13
extern int xrandr_rotation;
 
14
extern Time xrandr_timestamp;
 
15
extern Time xrandr_cfg_time;
 
16
 
 
17
extern void initialize_xrandr(void);
 
18
extern int check_xrandr_event(char *msg);
 
19
extern int known_xrandr_mode(char *s);
 
20
 
 
21
#define XRANDR_SET_TRAP_RET(x,y)  \
 
22
        if (subwin || xrandr) { \
 
23
                trapped_getimage_xerror = 0; \
 
24
                old_getimage_handler = XSetErrorHandler(trap_getimage_xerror); \
 
25
                if (check_xrandr_event(y)) { \
 
26
                        trapped_getimage_xerror = 0; \
 
27
                        XSetErrorHandler(old_getimage_handler);  \
 
28
                        X_UNLOCK; \
 
29
                        return(x); \
 
30
                } \
 
31
        }
 
32
#define XRANDR_CHK_TRAP_RET(x,y)  \
 
33
        if (subwin || xrandr) { \
 
34
                if (trapped_getimage_xerror) { \
 
35
                        if (subwin) { \
 
36
                                static int last = 0; \
 
37
                                subwin_trap_count++; \
 
38
                                if (time(NULL) > last_subwin_trap + 60) { \
 
39
                                        rfbLog("trapped GetImage xerror" \
 
40
                                            " in SUBWIN mode. [%d]\n", \
 
41
                                            subwin_trap_count); \
 
42
                                        last_subwin_trap = time(NULL); \
 
43
                                        last = subwin_trap_count; \
 
44
                                } \
 
45
                                if (subwin_trap_count - last > 30) { \
 
46
                                        /* window probably iconified */ \
 
47
                                        usleep(1000*1000); \
 
48
                                } \
 
49
                        } else { \
 
50
                                rfbLog("trapped GetImage xerror" \
 
51
                                    " in XRANDR mode.\n"); \
 
52
                        } \
 
53
                        trapped_getimage_xerror = 0; \
 
54
                        XSetErrorHandler(old_getimage_handler);  \
 
55
                        check_xrandr_event(y); \
 
56
                        X_UNLOCK; \
 
57
                        return(x); \
 
58
                } \
 
59
        }
 
60
 
 
61
#endif /* _X11VNC_XRANDR_H */