Skip to content

Commit

Permalink
Shell|Unix: Cleaned up SIGWINCH handling, prevent Ctrl-C signal
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 25, 2013
1 parent ac0a37e commit 27a4d8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
21 changes: 8 additions & 13 deletions doomsday/tools/shell/shell-text/src/cursesapp.cpp
Expand Up @@ -34,8 +34,7 @@

static void windowResized(int)
{
Q_ASSERT(qApp);
static_cast<CursesApp *>(qApp)->windowWasResized();
ungetch(KEY_RESIZE);
}

/**
Expand Down Expand Up @@ -126,6 +125,7 @@ struct CursesApp::Instance
cbreak();
noecho();
nonl();
raw(); // Ctrl-C shouldn't cause a signal
nodelay(rootWin, TRUE);
keypad(rootWin, TRUE);
}
Expand Down Expand Up @@ -180,12 +180,17 @@ struct CursesApp::Instance
self.quit(); // development only
return;

case KEY_ENTER:
case 0xd: // Enter
code = Qt::Key_Enter;
break;

case 0x7f: // Delete
code = Qt::Key_Backspace;
break;

case 0x4: // Ctrl-D
case KEY_DC:
case 0x4: // Ctrl-D
code = Qt::Key_Delete;
break;

Expand Down Expand Up @@ -288,11 +293,6 @@ struct CursesApp::Instance
}
}

void windowWasResized() // called from signal handler
{
ungetch(KEY_RESIZE);
}

void update()
{
rootWidget->draw();
Expand All @@ -314,11 +314,6 @@ TextRootWidget &CursesApp::rootWidget()
return *d->rootWidget;
}

void CursesApp::windowWasResized() // called from signal handler
{
d->windowWasResized();
}

void CursesApp::refresh()
{
d->refresh();
Expand Down
2 changes: 0 additions & 2 deletions doomsday/tools/shell/shell-text/src/cursesapp.h
Expand Up @@ -32,8 +32,6 @@ class CursesApp : public QCoreApplication

TextRootWidget &rootWidget();

void windowWasResized();

protected slots:
void refresh();

Expand Down

0 comments on commit 27a4d8a

Please sign in to comment.