57 |
|
|
58 |
|
// Constants |
59 |
|
const char KEYCODE_FILE_NAME[] = DATADIR "/keycodes"; |
60 |
+ |
static const bool mac_cursor_enabled = false; // Flag: Enable MacOS to X11 copy of cursor? |
61 |
|
|
62 |
|
// Global variables |
63 |
|
static int32 frame_skip; |
506 |
|
XSetState(x_display, the_gc, black_pixel, white_pixel, GXcopy, AllPlanes); |
507 |
|
|
508 |
|
// Create cursor |
509 |
< |
cursor_image = XCreateImage(x_display, vis, 1, XYPixmap, 0, (char *)MacCursor + 4, 16, 16, 16, 2); |
510 |
< |
cursor_image->byte_order = MSBFirst; |
511 |
< |
cursor_image->bitmap_bit_order = MSBFirst; |
512 |
< |
cursor_mask_image = XCreateImage(x_display, vis, 1, XYPixmap, 0, (char *)MacCursor + 36, 16, 16, 16, 2); |
513 |
< |
cursor_mask_image->byte_order = MSBFirst; |
514 |
< |
cursor_mask_image->bitmap_bit_order = MSBFirst; |
515 |
< |
cursor_map = XCreatePixmap(x_display, the_win, 16, 16, 1); |
516 |
< |
cursor_mask_map = XCreatePixmap(x_display, the_win, 16, 16, 1); |
517 |
< |
cursor_gc = XCreateGC(x_display, cursor_map, 0, 0); |
518 |
< |
cursor_mask_gc = XCreateGC(x_display, cursor_mask_map, 0, 0); |
519 |
< |
mac_cursor = XCreatePixmapCursor(x_display, cursor_map, cursor_mask_map, &black, &white, 0, 0); |
520 |
< |
cursor_changed = false; |
509 |
> |
if (mac_cursor_enabled) { |
510 |
> |
cursor_image = XCreateImage(x_display, vis, 1, XYPixmap, 0, (char *)MacCursor + 4, 16, 16, 16, 2); |
511 |
> |
cursor_image->byte_order = MSBFirst; |
512 |
> |
cursor_image->bitmap_bit_order = MSBFirst; |
513 |
> |
cursor_mask_image = XCreateImage(x_display, vis, 1, XYPixmap, 0, (char *)MacCursor + 36, 16, 16, 16, 2); |
514 |
> |
cursor_mask_image->byte_order = MSBFirst; |
515 |
> |
cursor_mask_image->bitmap_bit_order = MSBFirst; |
516 |
> |
cursor_map = XCreatePixmap(x_display, the_win, 16, 16, 1); |
517 |
> |
cursor_mask_map = XCreatePixmap(x_display, the_win, 16, 16, 1); |
518 |
> |
cursor_gc = XCreateGC(x_display, cursor_map, 0, 0); |
519 |
> |
cursor_mask_gc = XCreateGC(x_display, cursor_mask_map, 0, 0); |
520 |
> |
mac_cursor = XCreatePixmapCursor(x_display, cursor_map, cursor_mask_map, &black, &white, 0, 0); |
521 |
> |
cursor_changed = false; |
522 |
> |
} |
523 |
> |
|
524 |
> |
// Create no_cursor |
525 |
> |
else { |
526 |
> |
mac_cursor = XCreatePixmapCursor(x_display, |
527 |
> |
XCreatePixmap(x_display, the_win, 1, 1, 1), |
528 |
> |
XCreatePixmap(x_display, the_win, 1, 1, 1), |
529 |
> |
&black, &white, 0, 0); |
530 |
> |
XDefineCursor(x_display, the_win, mac_cursor); |
531 |
> |
} |
532 |
|
|
533 |
|
// Init blitting routines |
534 |
|
bool native_byte_order; |
2087 |
|
|
2088 |
|
|
2089 |
|
/* |
2090 |
+ |
* Can we set the MacOS cursor image into the window? |
2091 |
+ |
*/ |
2092 |
+ |
|
2093 |
+ |
bool video_can_change_cursor(void) |
2094 |
+ |
{ |
2095 |
+ |
return mac_cursor_enabled && (display_type != DIS_SCREEN); |
2096 |
+ |
} |
2097 |
+ |
|
2098 |
+ |
|
2099 |
+ |
/* |
2100 |
|
* Set cursor image for window |
2101 |
|
*/ |
2102 |
|
|
2341 |
|
update_display(); |
2342 |
|
|
2343 |
|
// Set new cursor image if it was changed |
2344 |
< |
if (cursor_changed) { |
2344 |
> |
if (mac_cursor_enabled && cursor_changed) { |
2345 |
|
cursor_changed = false; |
2346 |
|
memcpy(cursor_image->data, MacCursor + 4, 32); |
2347 |
|
memcpy(cursor_mask_image->data, MacCursor + 36, 32); |