Initialize & Cursor bug fixes

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2164 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
shadow303
2002-12-06 00:50:16 +00:00
parent d3ca8eec8d
commit 63683bae80
6 changed files with 14 additions and 21 deletions
+2 -2
View File
@@ -145,9 +145,9 @@ printf("init_desktop(%d)\n",workspaces);
workspace_count++;
// Instantiate and initialize display driver
gfxdriver=new ViewDriver();
// gfxdriver=new ViewDriver();
// gfxdriver=new SecondDriver();
// gfxdriver=new ScreenDriver();
gfxdriver=new ScreenDriver();
gfxdriver->Initialize();
workspacelock=new BLocker();
+7 -14
View File
@@ -13,6 +13,10 @@ DisplayDriver::DisplayDriver(void)
buffer_width=0;
buffer_height=0;
buffer_mode=-1;
// drawmode = DRAW_COPY;
is_cursor_hidden = false;
is_cursor_obscured = false;
cursor_state_changed = false;
}
DisplayDriver::~DisplayDriver(void)
@@ -62,7 +66,7 @@ bool DisplayDriver::DumpToFile(const char *path)
bool DisplayDriver::IsCursorHidden(void)
{
return (is_cursor_hidden>0)?true:false;
return is_cursor_hidden;
}
void DisplayDriver::HideCursor(void)
@@ -131,19 +135,8 @@ void DisplayDriver::SetModeInternal(int32 m)
void DisplayDriver::SetCursorHidden(bool state)
{
if(state)
{
is_cursor_hidden++;
cursor_state_changed=(is_cursor_hidden==1)?true:false;
}
else
{
if(is_cursor_hidden>0)
{
is_cursor_hidden--;
cursor_state_changed=(is_cursor_hidden==0)?true:false;
}
}
cursor_state_changed = (is_cursor_hidden != state);
is_cursor_hidden = state;
}
bool DisplayDriver::CursorStateChanged(void)
+1 -1
View File
@@ -128,7 +128,7 @@ private:
uint16 buffer_height;
int32 buffer_mode;
drawing_mode drawmode;
int32 is_cursor_hidden;
bool is_cursor_hidden;
bool is_cursor_obscured, cursor_state_changed;
BPoint cursor_hotspot;
};
+3 -2
View File
@@ -59,6 +59,7 @@ FrameBuffer::FrameBuffer(const char *title, uint32 space, status_t *st,bool debu
port_id serverport=find_port(SERVER_INPUT_PORT);
serverlink=new PortLink(serverport);
mousepos.Set(0,0);
buttons = 0;
#ifdef DEBUG_SERVER_EMU
printf("ScreenDriver:: app_server input port: %ld\n",serverlink->GetPort());
#endif
@@ -294,12 +295,12 @@ bool FrameBuffer::QuitRequested(void)
return true;
}
ScreenDriver::ScreenDriver(void)
ScreenDriver::ScreenDriver(void) : DisplayDriver()
{
status_t st;
fbuffer=new FrameBuffer("OBAppServer",B_8_BIT_640x480,&st,true);
drawmode=DRAW_COPY;
drawmode = DRAW_COPY;
// We start without a cursor
cursor=NULL;
-1
View File
@@ -103,7 +103,6 @@ protected:
void SetThickPixel16(int x, int y, int thick, uint16 col);
void SetThickPixel8(int x, int y, int thick, uint8 col);
FrameBuffer *fbuffer;
int hide_cursor;
ServerBitmap *cursor, *under_cursor;
int32 drawmode;
BRect cursorframe;
+1 -1
View File
@@ -412,7 +412,7 @@ printf("ServerApp: ActivateWorkspace(%ld)\n",*((int32*)index));
delete cursor;
cursor=new ServerBitmap(cdata);
driver->SetCursor(cursor,BPoint(cdata[2],cdata[3]));
#ifdef DEBUG_SERVERAPP_CURSOR
#ifdef DEBUG_SERVERAPP_CURSORS
printf("ServerApp: SetCursor(%d,%d,%d,%d)\n",r,g,b,a);
#endif
break;