diff --git a/src/add-ons/accelerants/vesa/mode.cpp b/src/add-ons/accelerants/vesa/mode.cpp index 6286bc9287..054fc0368f 100644 --- a/src/add-ons/accelerants/vesa/mode.cpp +++ b/src/add-ons/accelerants/vesa/mode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2011, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2005-2015, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -162,6 +162,13 @@ vesa_set_display_mode(display_mode* _mode) if (vesa_propose_display_mode(&mode, &mode, &mode) != B_OK) return B_BAD_VALUE; + if (gInfo->shared_info->current_mode.virtual_width == mode.virtual_width + && gInfo->shared_info->current_mode.virtual_height + == mode.virtual_height + && gInfo->shared_info->current_mode.space == mode.space) { + return B_OK; + } + vesa_mode* modes = gInfo->vesa_modes; for (uint32 i = gInfo->shared_info->vesa_mode_count; i-- > 0;) { // search mode in VESA mode list @@ -169,8 +176,9 @@ vesa_set_display_mode(display_mode* _mode) if (modes[i].width == mode.virtual_width && modes[i].height == mode.virtual_height && get_color_space_for_depth(modes[i].bits_per_pixel) - == mode.space) + == mode.space) { return ioctl(gInfo->device, VESA_SET_DISPLAY_MODE, &i, sizeof(i)); + } } return B_UNSUPPORTED;