Theoretically it should now be possible to open a MiniTerminal

with coordinates specified as arguments, but this somehow
(and why ever) does hinder /bin/sh from execution (under R5
at least). If someone could point me to the problem I'd be greatful.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12105 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2005-03-28 17:04:50 +00:00
parent ebc1161965
commit ee897a16b0
3 changed files with 25 additions and 7 deletions

View File

@ -5,14 +5,15 @@
* Distributed under the Haiku License. * Distributed under the Haiku License.
*/ */
#include <stdio.h>
#include "MiniApp.h" #include "MiniApp.h"
#include "MiniWin.h" #include "MiniWin.h"
#include "MiniView.h" #include "MiniView.h"
MiniApp::MiniApp() MiniApp::MiniApp(BRect bounds)
: BApplication("application/x-vnd.Haiku.MiniTerminal") : BApplication("application/x-vnd.Haiku.MiniTerminal")
{ {
fWindow = new MiniWin(BRect(50, 50, 630, 435).OffsetToCopy(640, 480)); fWindow = new MiniWin(bounds);
fWindow->Show(); fWindow->Show();
} }
@ -30,9 +31,26 @@ MiniApp::~MiniApp()
int int
main(void) main(int argc, const char *argv[])
{ {
MiniApp *app = new MiniApp(); BRect bounds(50, 50, 630, 435);
if (argc >= 3) {
BPoint offset;
sscanf(argv[1], "%f", &offset.x);
sscanf(argv[2], "%f", &offset.y);
bounds.OffsetTo(offset);
}
if (argc >= 5) {
BPoint size;
sscanf(argv[3], "%f", &size.x);
sscanf(argv[4], "%f", &size.y);
bounds.right = bounds.left + size.x;
bounds.bottom = bounds.top + size.y;
}
MiniApp *app = new MiniApp(bounds);
app->Run(); app->Run();
delete app; delete app;
return 0; return 0;

View File

@ -7,7 +7,7 @@ class MiniWin;
class MiniApp : public BApplication { class MiniApp : public BApplication {
public: public:
MiniApp(); MiniApp(BRect bounds);
virtual ~MiniApp(); virtual ~MiniApp();
virtual void ReadyToRun(); virtual void ReadyToRun();

View File

@ -90,9 +90,9 @@ MiniView::Start()
setsid(); setsid();
// move our stdin and stdout to the console // move our stdin and stdout to the console
dup2(fSlaveFD, 0); /*dup2(fSlaveFD, 0);
dup2(fSlaveFD, 1); dup2(fSlaveFD, 1);
dup2(fSlaveFD, 2); dup2(fSlaveFD, 2);*/
if (SpawnThreads() != B_OK) if (SpawnThreads() != B_OK)
TRACE(("error in SpawnThreads\n")); TRACE(("error in SpawnThreads\n"));