From 4fbc3f58031322dac5276815ada9c20e66e5a70f Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Mon, 12 Dec 2005 20:46:13 +0000 Subject: [PATCH] Researched and implemented BDirectWindow::SupportsWindowMode() more correctly, both for r5 and haiku git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15523 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/game/DirectWindow.cpp | 25 +++++++++++-------------- src/servers/app/ServerApp.cpp | 14 -------------- 2 files changed, 11 insertions(+), 28 deletions(-) diff --git a/src/kits/game/DirectWindow.cpp b/src/kits/game/DirectWindow.cpp index 69002e5c46..3382c8878a 100644 --- a/src/kits/game/DirectWindow.cpp +++ b/src/kits/game/DirectWindow.cpp @@ -9,6 +9,7 @@ #include +#include #include #include @@ -17,8 +18,8 @@ # include # include # define DW_GET_SYNC_DATA 0x880 -# define DW_SET_FULLSCREEN 0x881 -# define DW_SUPPORTS_WINDOW_MODE 0xF2C +# define DW_SET_FULLSCREEN 0x881 +# define DW_GET_SCREEN_FLAGS 0xF2C #else # include # include @@ -318,22 +319,18 @@ bool BDirectWindow::SupportsWindowMode(screen_id id) { #ifdef HAIKU_TARGET_PLATFORM_BEOS - int32 result = 0; + int32 flags = 0; _BAppServerLink_ link; - link.fSession->swrite_l(DW_SUPPORTS_WINDOW_MODE); + link.fSession->swrite_l(DW_GET_SCREEN_FLAGS); link.fSession->swrite_l(id.id); link.fSession->sync(); - link.fSession->sread(sizeof(result), &result); - return result & true; + link.fSession->sread(sizeof(flags), &flags); + return flags & B_PARALLEL_ACCESS; #else - BPrivate::AppServerLink link; - link.StartMessage(AS_DIRECT_WINDOW_SUPPORTS_WINDOW_MODE); - link.Attach(id); - - int32 reply; - if (link.FlushWithReply(reply) == B_OK - && reply == B_OK) - return true; + display_mode mode; + status_t status = BScreen(id).GetMode(&mode); + if (status == B_OK) + return mode.flags & B_PARALLEL_ACCESS; #endif return false; diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp index 01fce78ed0..2a421d2274 100644 --- a/src/servers/app/ServerApp.cpp +++ b/src/servers/app/ServerApp.cpp @@ -432,20 +432,6 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) break; } - case AS_DIRECT_WINDOW_SUPPORTS_WINDOW_MODE: - { - // TODO: How to determine this? - screen_id id; - if (link.Read(&id) == B_OK) { - fLink.StartMessage(B_OK); - fLink.Attach(true); - } else - fLink.StartMessage(B_BAD_VALUE); - - fLink.Flush(); - break; - } - case AS_UPDATE_COLORS: { // NOTE: R2: Eventually we will have windows which will notify their children of changes in