diff --git a/src/servers/app/proto7/Desktop.cpp b/src/servers/app/proto7/Desktop.cpp index c2163fd463..7bfd3b299d 100644 --- a/src/servers/app/proto7/Desktop.cpp +++ b/src/servers/app/proto7/Desktop.cpp @@ -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(); diff --git a/src/servers/app/proto7/DisplayDriver.cpp b/src/servers/app/proto7/DisplayDriver.cpp index b16c3c1b14..baf464b42e 100644 --- a/src/servers/app/proto7/DisplayDriver.cpp +++ b/src/servers/app/proto7/DisplayDriver.cpp @@ -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) diff --git a/src/servers/app/proto7/DisplayDriver.h b/src/servers/app/proto7/DisplayDriver.h index 141609dc47..fd3bb254ed 100644 --- a/src/servers/app/proto7/DisplayDriver.h +++ b/src/servers/app/proto7/DisplayDriver.h @@ -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; }; diff --git a/src/servers/app/proto7/ScreenDriver.cpp b/src/servers/app/proto7/ScreenDriver.cpp index 6b5ab97569..5d0968247e 100644 --- a/src/servers/app/proto7/ScreenDriver.cpp +++ b/src/servers/app/proto7/ScreenDriver.cpp @@ -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; diff --git a/src/servers/app/proto7/ScreenDriver.h b/src/servers/app/proto7/ScreenDriver.h index 95d6304e58..43dbba8448 100644 --- a/src/servers/app/proto7/ScreenDriver.h +++ b/src/servers/app/proto7/ScreenDriver.h @@ -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; diff --git a/src/servers/app/proto7/ServerApp.cpp b/src/servers/app/proto7/ServerApp.cpp index fd60191c34..2b29080f1f 100644 --- a/src/servers/app/proto7/ServerApp.cpp +++ b/src/servers/app/proto7/ServerApp.cpp @@ -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;