1 |
/* -*- c-basic-offset: 8 -*- |
/* -*- c-basic-offset: 8 -*- |
2 |
rdesktop: A Remote Desktop Protocol client. |
rdesktop: A Remote Desktop Protocol client. |
3 |
User interface services - X Window System |
User interface services - X Window System |
4 |
Copyright (C) Matthew Chapman 1999-2007 |
Copyright (C) Matthew Chapman 1999-2008 |
5 |
Copyright 2007 Pierre Ossman <ossman@cendio.se> for Cendio AB |
Copyright 2007 Pierre Ossman <ossman@cendio.se> for Cendio AB |
6 |
|
|
7 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
110 |
static XModifierKeymap *g_mod_map; |
static XModifierKeymap *g_mod_map; |
111 |
/* Maps logical (xmodmap -pp) pointing device buttons (0-based) back |
/* Maps logical (xmodmap -pp) pointing device buttons (0-based) back |
112 |
to physical (1-based) indices. */ |
to physical (1-based) indices. */ |
113 |
static unsigned char g_pointer_log_to_phys_map[16]; |
static unsigned char g_pointer_log_to_phys_map[32]; |
114 |
static Cursor g_current_cursor; |
static Cursor g_current_cursor; |
115 |
static RD_HCURSOR g_null_cursor = NULL; |
static RD_HCURSOR g_null_cursor = NULL; |
116 |
static Atom g_protocol_atom, g_kill_atom; |
static Atom g_protocol_atom, g_kill_atom; |
1525 |
int i, pointer_buttons; |
int i, pointer_buttons; |
1526 |
|
|
1527 |
pointer_buttons = XGetPointerMapping(g_display, phys_to_log_map, sizeof(phys_to_log_map)); |
pointer_buttons = XGetPointerMapping(g_display, phys_to_log_map, sizeof(phys_to_log_map)); |
1528 |
for (i = 0; i < pointer_buttons; ++i) |
if (pointer_buttons > sizeof(phys_to_log_map)) |
1529 |
{ |
pointer_buttons = sizeof(phys_to_log_map); |
1530 |
/* This might produce multiple logical buttons mapping |
|
1531 |
to a single physical one, but hey, that's |
/* if multiple physical buttons map to the same logical button, then |
1532 |
life... */ |
* use the lower numbered physical one */ |
1533 |
|
for (i = pointer_buttons-1; i >= 0; i--) |
1534 |
|
{ |
1535 |
|
/* a user could specify arbitrary values for the logical button |
1536 |
|
* number, ignore any that are abnormally large */ |
1537 |
|
if (phys_to_log_map[i] > sizeof(g_pointer_log_to_phys_map)) |
1538 |
|
continue; |
1539 |
g_pointer_log_to_phys_map[phys_to_log_map[i] - 1] = i + 1; |
g_pointer_log_to_phys_map[phys_to_log_map[i] - 1] = i + 1; |
1540 |
} |
} |
1541 |
} |
} |
1925 |
ewmh_init(); |
ewmh_init(); |
1926 |
if (g_seamless_rdp) |
if (g_seamless_rdp) |
1927 |
{ |
{ |
|
seamless_restack_test(); |
|
1928 |
seamless_init(); |
seamless_init(); |
1929 |
} |
} |
1930 |
|
|
2101 |
if (g_null_cursor == NULL) |
if (g_null_cursor == NULL) |
2102 |
g_null_cursor = ui_create_cursor(0, 0, 1, 1, null_pointer_mask, null_pointer_data); |
g_null_cursor = ui_create_cursor(0, 0, 1, 1, null_pointer_mask, null_pointer_data); |
2103 |
|
|
2104 |
|
if (g_seamless_rdp) |
2105 |
|
{ |
2106 |
|
seamless_restack_test(); |
2107 |
|
} |
2108 |
|
|
2109 |
return True; |
return True; |
2110 |
} |
} |
2111 |
|
|