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
This commit is contained in:
Stefano Ceccherini
2005-12-12 20:46:13 +00:00
parent 4f00613311
commit 4fbc3f5803
2 changed files with 11 additions and 28 deletions
+11 -14
View File
@@ -9,6 +9,7 @@
#include <DirectWindow.h> #include <DirectWindow.h>
#include <Screen.h>
#include <clipping.h> #include <clipping.h>
#include <DirectWindowPrivate.h> #include <DirectWindowPrivate.h>
@@ -17,8 +18,8 @@
# include <R5_AppServerLink.h> # include <R5_AppServerLink.h>
# include <R5_Session.h> # include <R5_Session.h>
# define DW_GET_SYNC_DATA 0x880 # define DW_GET_SYNC_DATA 0x880
# define DW_SET_FULLSCREEN 0x881 # define DW_SET_FULLSCREEN 0x881
# define DW_SUPPORTS_WINDOW_MODE 0xF2C # define DW_GET_SCREEN_FLAGS 0xF2C
#else #else
# include <AppServerLink.h> # include <AppServerLink.h>
# include <ServerProtocol.h> # include <ServerProtocol.h>
@@ -318,22 +319,18 @@ bool
BDirectWindow::SupportsWindowMode(screen_id id) BDirectWindow::SupportsWindowMode(screen_id id)
{ {
#ifdef HAIKU_TARGET_PLATFORM_BEOS #ifdef HAIKU_TARGET_PLATFORM_BEOS
int32 result = 0; int32 flags = 0;
_BAppServerLink_ link; _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->swrite_l(id.id);
link.fSession->sync(); link.fSession->sync();
link.fSession->sread(sizeof(result), &result); link.fSession->sread(sizeof(flags), &flags);
return result & true; return flags & B_PARALLEL_ACCESS;
#else #else
BPrivate::AppServerLink link; display_mode mode;
link.StartMessage(AS_DIRECT_WINDOW_SUPPORTS_WINDOW_MODE); status_t status = BScreen(id).GetMode(&mode);
link.Attach<screen_id>(id); if (status == B_OK)
return mode.flags & B_PARALLEL_ACCESS;
int32 reply;
if (link.FlushWithReply(reply) == B_OK
&& reply == B_OK)
return true;
#endif #endif
return false; return false;
-14
View File
@@ -432,20 +432,6 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
break; break;
} }
case AS_DIRECT_WINDOW_SUPPORTS_WINDOW_MODE:
{
// TODO: How to determine this?
screen_id id;
if (link.Read<screen_id>(&id) == B_OK) {
fLink.StartMessage(B_OK);
fLink.Attach<bool>(true);
} else
fLink.StartMessage(B_BAD_VALUE);
fLink.Flush();
break;
}
case AS_UPDATE_COLORS: case AS_UPDATE_COLORS:
{ {
// NOTE: R2: Eventually we will have windows which will notify their children of changes in // NOTE: R2: Eventually we will have windows which will notify their children of changes in