on MouseDown(), TermView becomes the focus view (like BTextView does).

Now input works also with a replicanted Terminal, although I have to 
click on it twice(!?!?). Don't call exit_thread() anymore in 
TermParse::PtyReader(). Hope this is correct. (feel free to beat me on 
this).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21747 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2007-07-30 12:19:20 +00:00
parent 6e09c5679e
commit 9821c5c4e1
2 changed files with 15 additions and 4 deletions
+5 -2
View File
@@ -149,8 +149,11 @@ TermParse::PtyReader()
uchar buf[READ_BUF_SIZE];
int nread = read(fFd, buf, READ_BUF_SIZE - (read_p - fBufferPosition));
if (nread <= 0) {
fView->NotifyQuit(errno);
exit_thread(errno);
fView->NotifyQuit(errno);
// on the next iteration, fQuitting will probably be true,
// or the semaphore acquisition will fail, so this thread will
// be killed anyway.
continue;
}
// Copy read string to PtyBuffer.
+10 -2
View File
@@ -213,8 +213,11 @@ TermView::TermView(BMessage *archive)
if (archive->FindInt32("rows", (int32 *)&fTermRows) < B_OK)
fTermRows = 25;
// TODO: Retrieve command, colors, history size, etc. from archive
_InitObject(NULL);
const char *command = NULL;
archive->FindString("command", &command);
// TODO: Retrieve colors, history size, etc. from archive
_InitObject(command);
}
@@ -1882,6 +1885,11 @@ TermView::_WritePTY(const uchar *text, int numBytes)
void
TermView::MouseDown(BPoint where)
{
// TODO: Get rid of the extra thread for mouse tracking,
// and implement it using something like BTextView uses.
if (!IsFocus())
MakeFocus();
int32 buttons;
Window()->CurrentMessage()->FindInt32("buttons", &buttons);