fix: crash when using ibus as the input method
This commit is contained in:
parent
0bb941e7fd
commit
5bf6da785c
1
NEWS.md
1
NEWS.md
|
@ -17,6 +17,7 @@ Red Panda C++ Version 2.25
|
|||
- enhancement: After compiler settings changed, run/debug current file will auto recompile.
|
||||
- ehhancement: Show selected char counts in status bar.
|
||||
- enhancement: Differentiate /* and /** when calculate auto indents.
|
||||
- fix: crash when using ibus as the input method.
|
||||
|
||||
Red Panda C++ Version 2.24
|
||||
|
||||
|
|
|
@ -57,8 +57,6 @@
|
|||
|
||||
QHash<ParserLanguage,std::weak_ptr<CppParser>> Editor::mSharedParsers;
|
||||
|
||||
int Editor::mShouldDisableSuggestionInInputMethodEvent = -1;
|
||||
|
||||
Editor::Editor(QWidget *parent):
|
||||
Editor(parent,"untitled",ENCODING_AUTO_DETECT,nullptr,true,nullptr)
|
||||
{
|
||||
|
@ -1341,20 +1339,6 @@ void Editor::mouseReleaseEvent(QMouseEvent *event)
|
|||
void Editor::inputMethodEvent(QInputMethodEvent *event)
|
||||
{
|
||||
QSynedit::QSynEdit::inputMethodEvent(event);
|
||||
#ifdef Q_OS_UNIX
|
||||
if (mShouldDisableSuggestionInInputMethodEvent == -1) {
|
||||
//not inited
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
//input method is ibus, disable suggestion
|
||||
mShouldDisableSuggestionInInputMethodEvent =
|
||||
(env.value("QT_IM_MODULE")=="ibus" )? 1 : 0;
|
||||
}
|
||||
if (mShouldDisableSuggestionInInputMethodEvent == 1) {
|
||||
if (pMainWindow->completionPopup()->isVisible())
|
||||
pMainWindow->completionPopup()->close();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
QString s = event->commitString();
|
||||
if (s.isEmpty())
|
||||
return;
|
||||
|
|
|
@ -355,9 +355,6 @@ private:
|
|||
QMap<QString,StatementKind> mIdentCache;
|
||||
|
||||
static QHash<ParserLanguage,std::weak_ptr<CppParser>> mSharedParsers;
|
||||
#ifdef Q_OS_UNIX
|
||||
static int mShouldDisableSuggestionInInputMethodEvent;
|
||||
#endif
|
||||
|
||||
// QWidget interface
|
||||
protected:
|
||||
|
|
|
@ -35,6 +35,8 @@ HeaderCompletionPopup::HeaderCompletionPopup(QWidget* parent):QWidget(parent)
|
|||
layout()->addWidget(mListView);
|
||||
layout()->setMargin(0);
|
||||
|
||||
mListView->setFocus();
|
||||
|
||||
mSearchLocal = false;
|
||||
mCurrentFile = "";
|
||||
mPhrase = "";
|
||||
|
@ -281,11 +283,6 @@ void HeaderCompletionPopup::setParser(const PCppParser &newParser)
|
|||
mParser = newParser;
|
||||
}
|
||||
|
||||
void HeaderCompletionPopup::showEvent(QShowEvent *)
|
||||
{
|
||||
mListView->setFocus();
|
||||
}
|
||||
|
||||
void HeaderCompletionPopup::hideEvent(QHideEvent *)
|
||||
{
|
||||
mCompletionList.clear();
|
||||
|
|
|
@ -100,7 +100,6 @@ private:
|
|||
|
||||
// QWidget interface
|
||||
protected:
|
||||
void showEvent(QShowEvent *event) override;
|
||||
void hideEvent(QHideEvent *event) override;
|
||||
|
||||
// QObject interface
|
||||
|
|
Loading…
Reference in New Issue