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:
@@ -149,8 +149,11 @@ TermParse::PtyReader()
|
|||||||
uchar buf[READ_BUF_SIZE];
|
uchar buf[READ_BUF_SIZE];
|
||||||
int nread = read(fFd, buf, READ_BUF_SIZE - (read_p - fBufferPosition));
|
int nread = read(fFd, buf, READ_BUF_SIZE - (read_p - fBufferPosition));
|
||||||
if (nread <= 0) {
|
if (nread <= 0) {
|
||||||
fView->NotifyQuit(errno);
|
fView->NotifyQuit(errno);
|
||||||
exit_thread(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.
|
// Copy read string to PtyBuffer.
|
||||||
|
|||||||
@@ -213,8 +213,11 @@ TermView::TermView(BMessage *archive)
|
|||||||
if (archive->FindInt32("rows", (int32 *)&fTermRows) < B_OK)
|
if (archive->FindInt32("rows", (int32 *)&fTermRows) < B_OK)
|
||||||
fTermRows = 25;
|
fTermRows = 25;
|
||||||
|
|
||||||
// TODO: Retrieve command, colors, history size, etc. from archive
|
const char *command = NULL;
|
||||||
_InitObject(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
|
void
|
||||||
TermView::MouseDown(BPoint where)
|
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;
|
int32 buttons;
|
||||||
Window()->CurrentMessage()->FindInt32("buttons", &buttons);
|
Window()->CurrentMessage()->FindInt32("buttons", &buttons);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user