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:
@@ -145,9 +145,9 @@ printf("init_desktop(%d)\n",workspaces);
|
|||||||
workspace_count++;
|
workspace_count++;
|
||||||
|
|
||||||
// Instantiate and initialize display driver
|
// Instantiate and initialize display driver
|
||||||
gfxdriver=new ViewDriver();
|
// gfxdriver=new ViewDriver();
|
||||||
// gfxdriver=new SecondDriver();
|
// gfxdriver=new SecondDriver();
|
||||||
// gfxdriver=new ScreenDriver();
|
gfxdriver=new ScreenDriver();
|
||||||
gfxdriver->Initialize();
|
gfxdriver->Initialize();
|
||||||
|
|
||||||
workspacelock=new BLocker();
|
workspacelock=new BLocker();
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ DisplayDriver::DisplayDriver(void)
|
|||||||
buffer_width=0;
|
buffer_width=0;
|
||||||
buffer_height=0;
|
buffer_height=0;
|
||||||
buffer_mode=-1;
|
buffer_mode=-1;
|
||||||
|
// drawmode = DRAW_COPY;
|
||||||
|
is_cursor_hidden = false;
|
||||||
|
is_cursor_obscured = false;
|
||||||
|
cursor_state_changed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayDriver::~DisplayDriver(void)
|
DisplayDriver::~DisplayDriver(void)
|
||||||
@@ -62,7 +66,7 @@ bool DisplayDriver::DumpToFile(const char *path)
|
|||||||
|
|
||||||
bool DisplayDriver::IsCursorHidden(void)
|
bool DisplayDriver::IsCursorHidden(void)
|
||||||
{
|
{
|
||||||
return (is_cursor_hidden>0)?true:false;
|
return is_cursor_hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayDriver::HideCursor(void)
|
void DisplayDriver::HideCursor(void)
|
||||||
@@ -131,19 +135,8 @@ void DisplayDriver::SetModeInternal(int32 m)
|
|||||||
|
|
||||||
void DisplayDriver::SetCursorHidden(bool state)
|
void DisplayDriver::SetCursorHidden(bool state)
|
||||||
{
|
{
|
||||||
if(state)
|
cursor_state_changed = (is_cursor_hidden != state);
|
||||||
{
|
is_cursor_hidden = 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DisplayDriver::CursorStateChanged(void)
|
bool DisplayDriver::CursorStateChanged(void)
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ private:
|
|||||||
uint16 buffer_height;
|
uint16 buffer_height;
|
||||||
int32 buffer_mode;
|
int32 buffer_mode;
|
||||||
drawing_mode drawmode;
|
drawing_mode drawmode;
|
||||||
int32 is_cursor_hidden;
|
bool is_cursor_hidden;
|
||||||
bool is_cursor_obscured, cursor_state_changed;
|
bool is_cursor_obscured, cursor_state_changed;
|
||||||
BPoint cursor_hotspot;
|
BPoint cursor_hotspot;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ FrameBuffer::FrameBuffer(const char *title, uint32 space, status_t *st,bool debu
|
|||||||
port_id serverport=find_port(SERVER_INPUT_PORT);
|
port_id serverport=find_port(SERVER_INPUT_PORT);
|
||||||
serverlink=new PortLink(serverport);
|
serverlink=new PortLink(serverport);
|
||||||
mousepos.Set(0,0);
|
mousepos.Set(0,0);
|
||||||
|
buttons = 0;
|
||||||
#ifdef DEBUG_SERVER_EMU
|
#ifdef DEBUG_SERVER_EMU
|
||||||
printf("ScreenDriver:: app_server input port: %ld\n",serverlink->GetPort());
|
printf("ScreenDriver:: app_server input port: %ld\n",serverlink->GetPort());
|
||||||
#endif
|
#endif
|
||||||
@@ -294,12 +295,12 @@ bool FrameBuffer::QuitRequested(void)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreenDriver::ScreenDriver(void)
|
ScreenDriver::ScreenDriver(void) : DisplayDriver()
|
||||||
{
|
{
|
||||||
status_t st;
|
status_t st;
|
||||||
fbuffer=new FrameBuffer("OBAppServer",B_8_BIT_640x480,&st,true);
|
fbuffer=new FrameBuffer("OBAppServer",B_8_BIT_640x480,&st,true);
|
||||||
|
|
||||||
drawmode=DRAW_COPY;
|
drawmode = DRAW_COPY;
|
||||||
|
|
||||||
// We start without a cursor
|
// We start without a cursor
|
||||||
cursor=NULL;
|
cursor=NULL;
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ protected:
|
|||||||
void SetThickPixel16(int x, int y, int thick, uint16 col);
|
void SetThickPixel16(int x, int y, int thick, uint16 col);
|
||||||
void SetThickPixel8(int x, int y, int thick, uint8 col);
|
void SetThickPixel8(int x, int y, int thick, uint8 col);
|
||||||
FrameBuffer *fbuffer;
|
FrameBuffer *fbuffer;
|
||||||
int hide_cursor;
|
|
||||||
ServerBitmap *cursor, *under_cursor;
|
ServerBitmap *cursor, *under_cursor;
|
||||||
int32 drawmode;
|
int32 drawmode;
|
||||||
BRect cursorframe;
|
BRect cursorframe;
|
||||||
|
|||||||
@@ -412,7 +412,7 @@ printf("ServerApp: ActivateWorkspace(%ld)\n",*((int32*)index));
|
|||||||
delete cursor;
|
delete cursor;
|
||||||
cursor=new ServerBitmap(cdata);
|
cursor=new ServerBitmap(cdata);
|
||||||
driver->SetCursor(cursor,BPoint(cdata[2],cdata[3]));
|
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);
|
printf("ServerApp: SetCursor(%d,%d,%d,%d)\n",r,g,b,a);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user