mirror of https://github.com/procxx/kepka.git
Fixed dead keys in photo / file caption input field #1418
Another attempt to fix dead keys input problem after main window looses focus to popup menu or photo viewer #2007 #1074
This commit is contained in:
parent
12c20faa44
commit
f6af535f8f
|
@ -926,13 +926,26 @@ void MainWindow::layerHidden() {
|
||||||
setInnerFocus();
|
setInnerFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::onReActivate() {
|
||||||
|
if (auto w = App::wnd()) {
|
||||||
|
if (auto f = QApplication::focusWidget()) {
|
||||||
|
f->clearFocus();
|
||||||
|
}
|
||||||
|
w->windowHandle()->requestActivate();
|
||||||
|
w->activate();
|
||||||
|
if (auto f = QApplication::focusWidget()) {
|
||||||
|
f->clearFocus();
|
||||||
|
}
|
||||||
|
w->setInnerFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::hideMediaview() {
|
void MainWindow::hideMediaview() {
|
||||||
if (_mediaView && !_mediaView->isHidden()) {
|
if (_mediaView && !_mediaView->isHidden()) {
|
||||||
_mediaView->hide();
|
_mediaView->hide();
|
||||||
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
||||||
if (App::wnd()) {
|
onReActivate();
|
||||||
App::wnd()->activateWindow();
|
QTimer::singleShot(200, this, SLOT(onReActivate()));
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -282,6 +282,8 @@ public slots:
|
||||||
void onLogoutSure();
|
void onLogoutSure();
|
||||||
void updateGlobalMenu(); // for OS X top menu
|
void updateGlobalMenu(); // for OS X top menu
|
||||||
|
|
||||||
|
void onReActivate();
|
||||||
|
|
||||||
void notifyUpdateAllPhotos();
|
void notifyUpdateAllPhotos();
|
||||||
|
|
||||||
void app_activateClickHandler(ClickHandlerPtr handler, Qt::MouseButton button);
|
void app_activateClickHandler(ClickHandlerPtr handler, Qt::MouseButton button);
|
||||||
|
|
|
@ -765,11 +765,11 @@ void InputArea::startBorderAnimation() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputArea::focusInEvent(QFocusEvent *e) {
|
void InputArea::focusInEvent(QFocusEvent *e) {
|
||||||
_inner.setFocus();
|
QTimer::singleShot(0, &_inner, SLOT(setFocus()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputArea::mousePressEvent(QMouseEvent *e) {
|
void InputArea::mousePressEvent(QMouseEvent *e) {
|
||||||
_inner.setFocus();
|
QTimer::singleShot(0, &_inner, SLOT(setFocus()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputArea::contextMenuEvent(QContextMenuEvent *e) {
|
void InputArea::contextMenuEvent(QContextMenuEvent *e) {
|
||||||
|
@ -1457,11 +1457,11 @@ void InputField::startBorderAnimation() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputField::focusInEvent(QFocusEvent *e) {
|
void InputField::focusInEvent(QFocusEvent *e) {
|
||||||
_inner.setFocus();
|
QTimer::singleShot(0, &_inner, SLOT(setFocus()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputField::mousePressEvent(QMouseEvent *e) {
|
void InputField::mousePressEvent(QMouseEvent *e) {
|
||||||
_inner.setFocus();
|
QTimer::singleShot(0, &_inner, SLOT(setFocus()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputField::contextMenuEvent(QContextMenuEvent *e) {
|
void InputField::contextMenuEvent(QContextMenuEvent *e) {
|
||||||
|
|
|
@ -235,6 +235,12 @@ public:
|
||||||
bool hasFocus() const {
|
bool hasFocus() const {
|
||||||
return _inner.hasFocus();
|
return _inner.hasFocus();
|
||||||
}
|
}
|
||||||
|
void setFocus() {
|
||||||
|
_inner.setFocus();
|
||||||
|
}
|
||||||
|
void clearFocus() {
|
||||||
|
_inner.clearFocus();
|
||||||
|
}
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
|
|
|
@ -521,8 +521,9 @@ PopupMenu::~PopupMenu() {
|
||||||
clearActions(true);
|
clearActions(true);
|
||||||
delete _menu;
|
delete _menu;
|
||||||
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
||||||
if (App::wnd()) {
|
if (auto w = App::wnd()) {
|
||||||
App::wnd()->activateWindow();
|
w->onReActivate();
|
||||||
|
QTimer::singleShot(200, w, SLOT(onReActivate()));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue