32 |
extern int g_height; |
extern int g_height; |
33 |
extern int g_xpos; |
extern int g_xpos; |
34 |
extern int g_ypos; |
extern int g_ypos; |
35 |
|
extern int g_pos; |
36 |
extern BOOL g_sendmotion; |
extern BOOL g_sendmotion; |
37 |
extern BOOL g_fullscreen; |
extern BOOL g_fullscreen; |
38 |
extern BOOL g_grab_keyboard; |
extern BOOL g_grab_keyboard; |
1164 |
wndwidth = g_fullscreen ? WidthOfScreen(g_screen) : g_width; |
wndwidth = g_fullscreen ? WidthOfScreen(g_screen) : g_width; |
1165 |
wndheight = g_fullscreen ? HeightOfScreen(g_screen) : g_height; |
wndheight = g_fullscreen ? HeightOfScreen(g_screen) : g_height; |
1166 |
|
|
1167 |
|
/* Handle -x-y portion of geometry string */ |
1168 |
|
if (g_xpos < 0 || (g_xpos == 0 && (g_pos & 2))) |
1169 |
|
g_xpos = WidthOfScreen(g_screen) + g_xpos - g_width; |
1170 |
|
if (g_ypos < 0 || (g_ypos == 0 && (g_pos & 4))) |
1171 |
|
g_ypos = HeightOfScreen(g_screen) + g_ypos - g_height; |
1172 |
|
|
1173 |
attribs.background_pixel = BlackPixelOfScreen(g_screen); |
attribs.background_pixel = BlackPixelOfScreen(g_screen); |
1174 |
attribs.border_pixel = WhitePixelOfScreen(g_screen); |
attribs.border_pixel = WhitePixelOfScreen(g_screen); |
1175 |
attribs.backing_store = g_ownbackstore ? NotUseful : Always; |
attribs.backing_store = g_ownbackstore ? NotUseful : Always; |
1213 |
if (sizehints) |
if (sizehints) |
1214 |
{ |
{ |
1215 |
sizehints->flags = PMinSize | PMaxSize; |
sizehints->flags = PMinSize | PMaxSize; |
1216 |
|
if (g_pos) |
1217 |
|
sizehints->flags |= PPosition; |
1218 |
sizehints->min_width = sizehints->max_width = g_width; |
sizehints->min_width = sizehints->max_width = g_width; |
1219 |
sizehints->min_height = sizehints->max_height = g_height; |
sizehints->min_height = sizehints->max_height = g_height; |
1220 |
XSetWMNormalHints(g_display, g_wnd, sizehints); |
XSetWMNormalHints(g_display, g_wnd, sizehints); |
1227 |
} |
} |
1228 |
|
|
1229 |
input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | |
input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | |
1230 |
VisibilityChangeMask | FocusChangeMask; |
VisibilityChangeMask | FocusChangeMask | StructureNotifyMask; |
1231 |
|
|
1232 |
if (g_sendmotion) |
if (g_sendmotion) |
1233 |
input_mask |= PointerMotionMask; |
input_mask |= PointerMotionMask; |
1341 |
} |
} |
1342 |
} |
} |
1343 |
|
|
1344 |
/* Process all events in Xlib queue |
/* Process events in Xlib queue |
1345 |
Returns 0 after user quit, 1 otherwise */ |
Returns 0 after user quit, 1 otherwise */ |
1346 |
static int |
static int |
1347 |
xwin_process_events(void) |
xwin_process_events(void) |
1353 |
key_translation tr; |
key_translation tr; |
1354 |
char str[256]; |
char str[256]; |
1355 |
Status status; |
Status status; |
1356 |
|
int events = 0; |
1357 |
|
|
1358 |
while (XPending(g_display) > 0) |
while ((XPending(g_display) > 0) && events++ < 20) |
1359 |
{ |
{ |
1360 |
XNextEvent(g_display, &xevent); |
XNextEvent(g_display, &xevent); |
1361 |
|
|
1599 |
case PropertyNotify: |
case PropertyNotify: |
1600 |
xclip_handle_PropertyNotify(&xevent.xproperty); |
xclip_handle_PropertyNotify(&xevent.xproperty); |
1601 |
break; |
break; |
1602 |
|
case MapNotify: |
1603 |
|
rdp_send_client_window_status(1); |
1604 |
|
break; |
1605 |
|
case UnmapNotify: |
1606 |
|
rdp_send_client_window_status(0); |
1607 |
|
break; |
1608 |
} |
} |
1609 |
} |
} |
1610 |
/* Keep going */ |
/* Keep going */ |
2278 |
RESET_FUNCTION(opcode); |
RESET_FUNCTION(opcode); |
2279 |
} |
} |
2280 |
|
|
2281 |
|
void |
2282 |
|
ui_polyline(uint8 opcode, |
2283 |
|
/* dest */ POINT * points, int npoints, |
2284 |
|
/* pen */ PEN * pen) |
2285 |
|
{ |
2286 |
|
/* TODO: set join style */ |
2287 |
|
SET_FUNCTION(opcode); |
2288 |
|
SET_FOREGROUND(pen->colour); |
2289 |
|
XDrawLines(g_display, g_wnd, g_gc, (XPoint *) points, npoints, CoordModePrevious); |
2290 |
|
if (g_ownbackstore) |
2291 |
|
XDrawLines(g_display, g_backstore, g_gc, (XPoint *) points, npoints, |
2292 |
|
CoordModePrevious); |
2293 |
|
RESET_FUNCTION(opcode); |
2294 |
|
} |
2295 |
|
|
2296 |
void |
void |
2297 |
ui_ellipse(uint8 opcode, |
ui_ellipse(uint8 opcode, |
2298 |
/* mode */ uint8 fillmode, |
/* mode */ uint8 fillmode, |