From 0dcbaee24ad7b51f69440f4d23c2a74eda29bad1 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Tue, 7 Oct 2008 05:47:57 +0000 Subject: [PATCH] Screen was assuming setting a 800x600 mode would work anyway, but currently the Intel driver only supports the 'native' mode for laptop panels. Added a 'strict' parameter to SetBestMode which, if true, fails if it doesn't find any mode with the passed width. If false, and can't find any good mode, just uses the first mode in the list (could be improved). This fixes bug #2350 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27898 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/Screen.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/servers/app/Screen.cpp b/src/servers/app/Screen.cpp index f9eac9a708..1975e0f309 100644 --- a/src/servers/app/Screen.cpp +++ b/src/servers/app/Screen.cpp @@ -124,7 +124,7 @@ Screen::SetMode(uint16 width, uint16 height, uint32 colorSpace, status_t Screen::SetBestMode(uint16 width, uint16 height, uint32 colorSpace, - float frequency) + float frequency, bool strict) { // search for a matching mode display_mode* modes = NULL; @@ -138,9 +138,14 @@ Screen::SetBestMode(uint16 width, uint16 height, uint32 colorSpace, int32 index = _FindBestMode(modes, count, width, height, colorSpace, frequency); if (index < 0) { - debug_printf("Finding best mode failed"); - delete[] modes; - return B_ERROR; + if (strict) { + debug_printf("Finding best mode failed"); + delete[] modes; + return B_ERROR; + } else { + index = 0; + // Just use the first mode in the list + } } display_mode mode = modes[index];