diff --git a/SheepShaver/src/BeOS/video_beos.cpp b/SheepShaver/src/BeOS/video_beos.cpp index df94bdd5..770af26a 100644 --- a/SheepShaver/src/BeOS/video_beos.cpp +++ b/SheepShaver/src/BeOS/video_beos.cpp @@ -758,6 +758,16 @@ void video_set_palette(void) } +/* + * Can we set the MacOS cursor image into the window? + */ + +bool video_can_change_cursor(void) +{ + return (display_type != DIS_SCREEN); +} + + /* * Set cursor image for window */ diff --git a/SheepShaver/src/Unix/video_x.cpp b/SheepShaver/src/Unix/video_x.cpp index 7681bde0..aa69fb71 100644 --- a/SheepShaver/src/Unix/video_x.cpp +++ b/SheepShaver/src/Unix/video_x.cpp @@ -57,6 +57,7 @@ using std::sort; // Constants const char KEYCODE_FILE_NAME[] = DATADIR "/keycodes"; +static const bool mac_cursor_enabled = false; // Flag: Enable MacOS to X11 copy of cursor? // Global variables static int32 frame_skip; @@ -505,18 +506,29 @@ static bool open_window(int width, int height) XSetState(x_display, the_gc, black_pixel, white_pixel, GXcopy, AllPlanes); // Create cursor - cursor_image = XCreateImage(x_display, vis, 1, XYPixmap, 0, (char *)MacCursor + 4, 16, 16, 16, 2); - cursor_image->byte_order = MSBFirst; - cursor_image->bitmap_bit_order = MSBFirst; - cursor_mask_image = XCreateImage(x_display, vis, 1, XYPixmap, 0, (char *)MacCursor + 36, 16, 16, 16, 2); - cursor_mask_image->byte_order = MSBFirst; - cursor_mask_image->bitmap_bit_order = MSBFirst; - cursor_map = XCreatePixmap(x_display, the_win, 16, 16, 1); - cursor_mask_map = XCreatePixmap(x_display, the_win, 16, 16, 1); - cursor_gc = XCreateGC(x_display, cursor_map, 0, 0); - cursor_mask_gc = XCreateGC(x_display, cursor_mask_map, 0, 0); - mac_cursor = XCreatePixmapCursor(x_display, cursor_map, cursor_mask_map, &black, &white, 0, 0); - cursor_changed = false; + if (mac_cursor_enabled) { + cursor_image = XCreateImage(x_display, vis, 1, XYPixmap, 0, (char *)MacCursor + 4, 16, 16, 16, 2); + cursor_image->byte_order = MSBFirst; + cursor_image->bitmap_bit_order = MSBFirst; + cursor_mask_image = XCreateImage(x_display, vis, 1, XYPixmap, 0, (char *)MacCursor + 36, 16, 16, 16, 2); + cursor_mask_image->byte_order = MSBFirst; + cursor_mask_image->bitmap_bit_order = MSBFirst; + cursor_map = XCreatePixmap(x_display, the_win, 16, 16, 1); + cursor_mask_map = XCreatePixmap(x_display, the_win, 16, 16, 1); + cursor_gc = XCreateGC(x_display, cursor_map, 0, 0); + cursor_mask_gc = XCreateGC(x_display, cursor_mask_map, 0, 0); + mac_cursor = XCreatePixmapCursor(x_display, cursor_map, cursor_mask_map, &black, &white, 0, 0); + cursor_changed = false; + } + + // Create no_cursor + else { + mac_cursor = XCreatePixmapCursor(x_display, + XCreatePixmap(x_display, the_win, 1, 1, 1), + XCreatePixmap(x_display, the_win, 1, 1, 1), + &black, &white, 0, 0); + XDefineCursor(x_display, the_win, mac_cursor); + } // Init blitting routines bool native_byte_order; @@ -2074,6 +2086,16 @@ void video_set_palette(void) } +/* + * Can we set the MacOS cursor image into the window? + */ + +bool video_can_change_cursor(void) +{ + return mac_cursor_enabled && (display_type != DIS_SCREEN); +} + + /* * Set cursor image for window */ @@ -2319,7 +2341,7 @@ static void *redraw_func(void *arg) update_display(); // Set new cursor image if it was changed - if (cursor_changed) { + if (mac_cursor_enabled && cursor_changed) { cursor_changed = false; memcpy(cursor_image->data, MacCursor + 4, 32); memcpy(cursor_mask_image->data, MacCursor + 36, 32); diff --git a/SheepShaver/src/include/video.h b/SheepShaver/src/include/video.h index bc3a05c4..c1257287 100644 --- a/SheepShaver/src/include/video.h +++ b/SheepShaver/src/include/video.h @@ -138,6 +138,7 @@ extern void VideoQuitFullScreen(void); extern void video_set_palette(void); extern void video_set_cursor(void); +extern bool video_can_change_cursor(void); extern int16 video_mode_change(VidLocals *csSave, uint32 ParamPtr); extern int16 VSLDoInterruptService(uint32 arg1); diff --git a/SheepShaver/src/video.cpp b/SheepShaver/src/video.cpp index a121a3ed..09fcfc99 100644 --- a/SheepShaver/src/video.cpp +++ b/SheepShaver/src/video.cpp @@ -448,7 +448,7 @@ static int16 VideoControl(uint32 pb, VidLocals *csSave) MacCursor[3] = ReadMacInt8(0x887); // Set new cursor image - if (display_type == DIS_SCREEN) + if (!video_can_change_cursor()) return controlErr; if (changed) video_set_cursor();