|
|
|
@ -86,6 +86,11 @@ |
|
|
|
|
|
|
|
|
|
#include "core/memcheck.h" |
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11 |
|
|
|
|
#include <QProcess> |
|
|
|
|
bool onboardIsAlreadyRunning = true; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
UBBoardController::UBBoardController(UBMainWindow* mainWindow) |
|
|
|
|
: UBDocumentContainer(mainWindow->centralWidget()) |
|
|
|
|
, mMainWindow(mainWindow) |
|
|
|
@ -160,6 +165,12 @@ void UBBoardController::init() |
|
|
|
|
|
|
|
|
|
UBBoardController::~UBBoardController() |
|
|
|
|
{ |
|
|
|
|
#ifdef Q_WS_X11 |
|
|
|
|
if(!onboardIsAlreadyRunning){ |
|
|
|
|
QProcess newProcess; |
|
|
|
|
newProcess.startDetached("killall onboard"); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
delete mDisplayView; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -816,7 +827,32 @@ void UBBoardController::showKeyboard(bool show) |
|
|
|
|
{ |
|
|
|
|
if(show) |
|
|
|
|
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); |
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11 |
|
|
|
|
static bool isFirstTime = true; |
|
|
|
|
if(isFirstTime){ |
|
|
|
|
QProcess isAlreadyRunningProcess; |
|
|
|
|
QString psAuxGrepC = "ps aux"; |
|
|
|
|
isAlreadyRunningProcess.start(psAuxGrepC); |
|
|
|
|
isAlreadyRunningProcess.waitForFinished(); |
|
|
|
|
QString output(isAlreadyRunningProcess.readAll()); |
|
|
|
|
if(output.count("onboard") != 0) |
|
|
|
|
onboardIsAlreadyRunning = true; |
|
|
|
|
else |
|
|
|
|
onboardIsAlreadyRunning = false; |
|
|
|
|
|
|
|
|
|
isFirstTime = false; |
|
|
|
|
} |
|
|
|
|
if(UBSettings::settings()->useSystemOnScreenKeybard->get().toBool()){ |
|
|
|
|
QProcess newProcess; |
|
|
|
|
newProcess.startDetached("/usr/bin/onboard"); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
mPaletteManager->showVirtualKeyboard(show); |
|
|
|
|
#else |
|
|
|
|
mPaletteManager->showVirtualKeyboard(show); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|