Commit 46e4d409 authored by Ivan Ilin's avatar Ivan Ilin

virtual keyboard bug fixed. Linux tested

parent 9c1928d7
......@@ -168,6 +168,9 @@ void UBBoardPaletteManager::setupPalettes()
if (UBPlatformUtils::hasVirtualKeyboard())
{
mKeyboardPalette = UBKeyboardPalette::create(0);
#ifndef Q_WS_WIN
connect(mKeyboardPalette, SIGNAL(closed()), mKeyboardPalette, SLOT(onDeactivated()));
#endif
#ifndef Q_WS_MAC
mKeyboardPalette->setParent(mContainer);
#endif
......
......@@ -92,6 +92,7 @@ private slots:
void syncLocale(int nLocale);
void keyboardPaletteButtonSizeChanged(QVariant size);
void onActivated(bool b);
void onDeactivated();
void showKeyboard(bool show);
void hideKeyboard();
......
......@@ -154,15 +154,28 @@ void UBKeyboardPalette::onActivated(bool activated)
XChangeKeyboardMapping(display, min_keycodes, byte_per_code,
keySyms, max_keycodes - min_keycodes);
XFree(keySyms);
}
XFree(keySyms);
}
XCloseDisplay(display);
}
}
void UBKeyboardPalette::onDeactivated()
{
Display *display = XOpenDisplay(0);
if(display == NULL)
return;
KeySym* keySyms = (KeySym*)storage;
if (keySyms!=NULL) {
XChangeKeyboardMapping(display, min_keycodes, byte_per_code,
keySyms, max_keycodes - min_keycodes);
}
XCloseDisplay(display);
}
void setSymbolsFromButton(Display *display,
const UBKeyboardLocale& locale,
......
......@@ -102,7 +102,10 @@ void UBKeyboardPalette::onActivated(bool activated)
SetMacLocaleByIdentifier(activeLocale);
}
}
void UBKeyboardPalette::onDeactivated()
{
SetMacLocaleByIdentifier(activeLocale);
}
void UBKeyboardPalette::onLocaleChanged(UBKeyboardLocale* locale)
{
SetMacLocaleByIdentifier(locale->id);
......
......@@ -70,7 +70,10 @@ void UBKeyboardPalette::createCtrlButtons()
void UBKeyboardPalette::onActivated(bool)
{
}
void UBKeyboardPalette::onDeactivated()
{
}
void UBKeyboardPalette::onLocaleChanged(UBKeyboardLocale* )
{}
......@@ -370,6 +370,10 @@ void UBWebController::setupPalettes()
(*mToolsCurrentPalette) = new UBWebToolsPalette((*mCurrentWebBrowser),false);
(*mKeyboardCurrentPalette) = UBKeyboardPalette::create(*mCurrentWebBrowser);
#ifndef Q_WS_WIN
if (*mKeyboardCurrentPalette)
connect(*mKeyboardCurrentPalette, SIGNAL(closed()), *mKeyboardCurrentPalette, SLOT(onDeactivated()));
#endif
connect(mMainWindow->actionWebTrapFlash, SIGNAL(triggered()), this, SLOT(trapFlash()));
connect(mMainWindow->actionWebCustomCapture, SIGNAL(triggered()), this, SLOT(customCapture()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment