mirror of
https://github.com/panda3d/panda3d.git
synced 2026-04-21 05:59:27 -05:00
keep cursor hidden when switching to fullscreen (LP bug #784153)
This commit is contained in:
@@ -1352,7 +1352,24 @@ os_open_window(WindowProperties &req_properties) {
|
||||
if (req_properties.has_icon_filename()) {
|
||||
set_icon_filename(req_properties.get_icon_filename());
|
||||
}
|
||||
|
||||
|
||||
if (req_properties.has_cursor_hidden()) {
|
||||
_properties.set_cursor_hidden(req_properties.get_cursor_hidden());
|
||||
_cursor_hidden = req_properties.get_cursor_hidden();
|
||||
if (_cursor_hidden) {
|
||||
if (!_display_hide_cursor) {
|
||||
CGDisplayHideCursor(kCGDirectMainDisplay);
|
||||
_display_hide_cursor = true;
|
||||
}
|
||||
} else {
|
||||
if (_display_hide_cursor) {
|
||||
CGDisplayShowCursor(kCGDirectMainDisplay);
|
||||
_display_hide_cursor = false;
|
||||
}
|
||||
}
|
||||
req_properties.clear_cursor_hidden();
|
||||
}
|
||||
|
||||
_properties.set_open(true);
|
||||
|
||||
if (_properties.has_size()) {
|
||||
@@ -2024,19 +2041,19 @@ set_properties_now(WindowProperties &properties) {
|
||||
if (properties.has_cursor_hidden()) {
|
||||
_properties.set_cursor_hidden(properties.get_cursor_hidden());
|
||||
_cursor_hidden = properties.get_cursor_hidden();
|
||||
if (_cursor_hidden && _input_devices[0].has_pointer()) {
|
||||
if (_cursor_hidden) {
|
||||
if (!_display_hide_cursor) {
|
||||
CGDisplayHideCursor(kCGDirectMainDisplay);
|
||||
CGDisplayHideCursor(kCGDirectMainDisplay);
|
||||
_display_hide_cursor = true;
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
if (_display_hide_cursor) {
|
||||
CGDisplayShowCursor(kCGDirectMainDisplay);
|
||||
CGDisplayShowCursor(kCGDirectMainDisplay);
|
||||
_display_hide_cursor = false;
|
||||
}
|
||||
}
|
||||
properties.clear_cursor_hidden();
|
||||
}
|
||||
}
|
||||
properties.clear_cursor_hidden();
|
||||
}
|
||||
|
||||
if (properties.has_minimized()) {
|
||||
if (_properties.get_minimized() != properties.get_minimized()) {
|
||||
|
||||
Reference in New Issue
Block a user