Quick fix to prevent the terminal from crashing in case it got a message
with mouse coordinates outside the window (yeah, it has been written that bad). Need to rewrite the whole mouse handling, though... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15152 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -107,6 +107,7 @@ TermBuffer::TermBuffer(int rows, int cols)
|
|||||||
mBase[i] = (term_buffer *) calloc (mColSize + 1, sizeof (term_buffer));
|
mBase[i] = (term_buffer *) calloc (mColSize + 1, sizeof (term_buffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TermBuffer::~TermBuffer()
|
TermBuffer::~TermBuffer()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < buffer_size; i++)
|
for(int i = 0; i < buffer_size; i++)
|
||||||
@@ -115,13 +116,15 @@ TermBuffer::~TermBuffer()
|
|||||||
free(mBase);
|
free(mBase);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gets a character from TermBuffer
|
|
||||||
|
//! Gets a character from TermBuffer
|
||||||
int
|
int
|
||||||
TermBuffer::GetChar(int row, int col, uchar *buf, ushort *attr)
|
TermBuffer::GetChar(int row, int col, uchar *buf, ushort *attr)
|
||||||
{
|
{
|
||||||
term_buffer *ptr;
|
if (row < 0 || col < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
ptr = (mBase[row % buffer_size] + col);
|
term_buffer *ptr = (mBase[row % buffer_size] + col);
|
||||||
|
|
||||||
if (ptr->status == A_CHAR)
|
if (ptr->status == A_CHAR)
|
||||||
memcpy(buf, (char *)(ptr->code), 4);
|
memcpy(buf, (char *)(ptr->code), 4);
|
||||||
@@ -131,7 +134,8 @@ TermBuffer::GetChar (int row, int col, uchar *buf, ushort *attr)
|
|||||||
return ptr->status;
|
return ptr->status;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a string (length = num) from given position.
|
|
||||||
|
//! Get a string (length = num) from given position.
|
||||||
int
|
int
|
||||||
TermBuffer::GetString(int row, int col, int num, uchar *buf,
|
TermBuffer::GetString(int row, int col, int num, uchar *buf,
|
||||||
ushort *attr)
|
ushort *attr)
|
||||||
|
|||||||
@@ -904,6 +904,8 @@ TermView::MouseTracking(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
edpos = theObj->BPointToCurPos(edpoint);
|
edpos = theObj->BPointToCurPos(edpoint);
|
||||||
|
if (edpos.y < 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
if(stpoint == edpoint) {
|
if(stpoint == edpoint) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user