21 |
#include <X11/Xlib.h> |
#include <X11/Xlib.h> |
22 |
#include <X11/Xutil.h> |
#include <X11/Xutil.h> |
23 |
#include <unistd.h> |
#include <unistd.h> |
24 |
|
#include <sys/time.h> |
25 |
#include <time.h> |
#include <time.h> |
26 |
#include <errno.h> |
#include <errno.h> |
27 |
|
#include <strings.h> |
28 |
#include "rdesktop.h" |
#include "rdesktop.h" |
29 |
#include "xproto.h" |
#include "xproto.h" |
30 |
|
|
64 |
static int g_red_shift_l, g_blue_shift_l, g_green_shift_l; |
static int g_red_shift_l, g_blue_shift_l, g_green_shift_l; |
65 |
|
|
66 |
/* software backing store */ |
/* software backing store */ |
67 |
static BOOL g_ownbackstore; |
BOOL g_ownbackstore = True; /* We can't rely on external BackingStore */ |
68 |
static Pixmap g_backstore = NULL; |
static Pixmap g_backstore = 0; |
69 |
|
|
70 |
/* Moving in single app mode */ |
/* Moving in single app mode */ |
71 |
static BOOL g_moving_wnd; |
static BOOL g_moving_wnd; |
792 |
warning("Screen depth is 8 bits or lower: you may want to use -C for a private colourmap\n"); |
warning("Screen depth is 8 bits or lower: you may want to use -C for a private colourmap\n"); |
793 |
} |
} |
794 |
|
|
795 |
if (DoesBackingStore(g_screen) != Always) |
if ((!g_ownbackstore) && (DoesBackingStore(g_screen) != Always)) |
796 |
|
{ |
797 |
|
warning("External BackingStore not available, using internal\n"); |
798 |
g_ownbackstore = True; |
g_ownbackstore = True; |
799 |
|
} |
800 |
|
|
801 |
test = 1; |
test = 1; |
802 |
g_host_be = !(BOOL) (*(uint8 *) (&test)); |
g_host_be = !(BOOL) (*(uint8 *) (&test)); |
899 |
if (g_gc == NULL) |
if (g_gc == NULL) |
900 |
g_gc = XCreateGC(g_display, g_wnd, 0, NULL); |
g_gc = XCreateGC(g_display, g_wnd, 0, NULL); |
901 |
|
|
902 |
if ((g_ownbackstore) && (g_backstore == NULL)) |
if ((g_ownbackstore) && (g_backstore == 0)) |
903 |
{ |
{ |
904 |
g_backstore = XCreatePixmap(g_display, g_wnd, g_width, g_height, g_depth); |
g_backstore = XCreatePixmap(g_display, g_wnd, g_width, g_height, g_depth); |
905 |
|
|
1276 |
int |
int |
1277 |
ui_select(int rdp_socket) |
ui_select(int rdp_socket) |
1278 |
{ |
{ |
1279 |
int n = (rdp_socket > g_x_socket) ? rdp_socket : g_x_socket; |
int n; |
1280 |
fd_set rfds, wfds; |
fd_set rfds, wfds; |
1281 |
struct timeval tv; |
struct timeval tv; |
1282 |
BOOL s_timeout = False; |
BOOL s_timeout = False; |
1283 |
|
|
1284 |
while (True) |
while (True) |
1285 |
{ |
{ |
1286 |
|
n = (rdp_socket > g_x_socket) ? rdp_socket : g_x_socket; |
1287 |
/* Process any events already waiting */ |
/* Process any events already waiting */ |
1288 |
if (!xwin_process_events()) |
if (!xwin_process_events()) |
1289 |
/* User quit */ |
/* User quit */ |
1783 |
/* src */ int srcx, int srcy) |
/* src */ int srcx, int srcy) |
1784 |
{ |
{ |
1785 |
SET_FUNCTION(opcode); |
SET_FUNCTION(opcode); |
|
XCopyArea(g_display, g_wnd, g_wnd, g_gc, srcx, srcy, cx, cy, x, y); |
|
1786 |
if (g_ownbackstore) |
if (g_ownbackstore) |
1787 |
|
{ |
1788 |
|
XCopyArea(g_display, g_backstore, g_wnd, g_gc, srcx, srcy, cx, cy, x, y); |
1789 |
XCopyArea(g_display, g_backstore, g_backstore, g_gc, srcx, srcy, cx, cy, x, y); |
XCopyArea(g_display, g_backstore, g_backstore, g_gc, srcx, srcy, cx, cy, x, y); |
1790 |
|
} |
1791 |
|
else |
1792 |
|
{ |
1793 |
|
XCopyArea(g_display, g_wnd, g_wnd, g_gc, srcx, srcy, cx, cy, x, y); |
1794 |
|
} |
1795 |
RESET_FUNCTION(opcode); |
RESET_FUNCTION(opcode); |
1796 |
} |
} |
1797 |
|
|