diff --git a/AUTHORS b/AUTHORS index a39ac5ae..5d25a7d7 100644 --- a/AUTHORS +++ b/AUTHORS @@ -99,6 +99,7 @@ PellelNitram Plailect Pēteris Birkants Rasmus Thomsen +Rio Liu Rob Frohne Romano Giannetti Ruo Li diff --git a/src/control/XournalMain.cpp b/src/control/XournalMain.cpp index a1c20c6c..033872c4 100644 --- a/src/control/XournalMain.cpp +++ b/src/control/XournalMain.cpp @@ -374,8 +374,7 @@ void ensure_input_model_compatibility() { if (imModule != nullptr) { std::string imModuleString{imModule}; if (imModuleString == "xim" || imModuleString == "gcin") { - g_setenv("GTK_IM_MODULE", "ibus", true); - g_warning("Unsupported input method: %s, changed to: ibus", imModule); + g_warning("Unsupported input method: %s", imModule); } } } diff --git a/src/gui/TextEditor.cpp b/src/gui/TextEditor.cpp index db4a7a9f..ec4d2cf4 100644 --- a/src/gui/TextEditor.cpp +++ b/src/gui/TextEditor.cpp @@ -38,7 +38,7 @@ TextEditor::TextEditor(XojPageView* gui, GtkWidget* widget, Text* text, bool own g_object_get(settings, "gtk-cursor-blink-timeout", &this->cursorBlinkTimeout, nullptr); this->imContext = gtk_im_multicontext_new(); - gtk_im_context_set_client_window(this->imContext, gtk_widget_get_window(this->widget)); + gtk_im_context_set_client_window(this->imContext, gtk_widget_get_parent_window(this->widget)); gtk_im_context_focus_in(this->imContext); g_signal_connect(this->imContext, "commit", G_CALLBACK(iMCommitCallback), this); diff --git a/src/gui/inputdevices/InputContext.cpp b/src/gui/inputdevices/InputContext.cpp index af2c867e..7bd1d8ca 100644 --- a/src/gui/inputdevices/InputContext.cpp +++ b/src/gui/inputdevices/InputContext.cpp @@ -68,10 +68,14 @@ auto InputContext::eventCallback(GtkWidget* widget, GdkEvent* event, InputContex auto InputContext::handle(GdkEvent* sourceEvent) -> bool { printDebug(sourceEvent); + GdkDevice* sourceDevice = gdk_event_get_source_device(sourceEvent); + if (sourceDevice == NULL) { + return false; + } + InputEvent event = InputEvents::translateEvent(sourceEvent, this->getSettings()); // Add the device to the list of known devices if it is currently unknown - GdkDevice* sourceDevice = gdk_event_get_source_device(sourceEvent); GdkInputSource inputSource = gdk_device_get_source(sourceDevice); if (inputSource != GDK_SOURCE_KEYBOARD && gdk_device_get_device_type(sourceDevice) != GDK_DEVICE_TYPE_MASTER && this->knownDevices.find(std::string(event.deviceName)) == this->knownDevices.end()) {