|
@@ -212,6 +212,7 @@ void OS_Windows::initialize_core() {
|
|
|
crash_handler.initialize();
|
|
|
|
|
|
last_button_state = 0;
|
|
|
+ restore_mouse_trails = 0;
|
|
|
|
|
|
//RedirectIOToConsole();
|
|
|
maximized = false;
|
|
@@ -1426,6 +1427,13 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
|
|
|
video_mode.fullscreen=false;
|
|
|
}*/
|
|
|
pre_fs_valid = false;
|
|
|
+
|
|
|
+ // If the user has mouse trails enabled in windows, then sometimes the cursor disappears in fullscreen mode.
|
|
|
+ // Save number of trails so we can restore when exiting, then turn off mouse trails
|
|
|
+ SystemParametersInfoA(SPI_GETMOUSETRAILS, 0, &restore_mouse_trails, 0);
|
|
|
+ if (restore_mouse_trails > 1) {
|
|
|
+ SystemParametersInfoA(SPI_SETMOUSETRAILS, 0, 0, 0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
DWORD dwExStyle;
|
|
@@ -1770,6 +1778,10 @@ void OS_Windows::finalize() {
|
|
|
if (user_proc) {
|
|
|
SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)user_proc);
|
|
|
};
|
|
|
+
|
|
|
+ if (restore_mouse_trails > 1) {
|
|
|
+ SystemParametersInfoA(SPI_SETMOUSETRAILS, restore_mouse_trails, 0, 0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void OS_Windows::finalize_core() {
|
|
@@ -2124,6 +2136,10 @@ void OS_Windows::set_window_fullscreen(bool p_enabled) {
|
|
|
|
|
|
MoveWindow(hWnd, pos.x, pos.y, size.width, size.height, TRUE);
|
|
|
|
|
|
+ SystemParametersInfoA(SPI_GETMOUSETRAILS, 0, &restore_mouse_trails, 0);
|
|
|
+ if (restore_mouse_trails > 1) {
|
|
|
+ SystemParametersInfoA(SPI_SETMOUSETRAILS, 0, 0, 0);
|
|
|
+ }
|
|
|
} else {
|
|
|
RECT rect;
|
|
|
|
|
@@ -2143,6 +2159,10 @@ void OS_Windows::set_window_fullscreen(bool p_enabled) {
|
|
|
MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE);
|
|
|
|
|
|
pre_fs_valid = true;
|
|
|
+
|
|
|
+ if (restore_mouse_trails > 1) {
|
|
|
+ SystemParametersInfoA(SPI_SETMOUSETRAILS, restore_mouse_trails, 0, 0);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
bool OS_Windows::is_window_fullscreen() const {
|