diff --git a/linphone-app/src/app/AppController.cpp b/linphone-app/src/app/AppController.cpp index ed85c6698..d1ae309af 100644 --- a/linphone-app/src/app/AppController.cpp +++ b/linphone-app/src/app/AppController.cpp @@ -43,6 +43,10 @@ AppController::AppController (int &argc, char *argv[]) { Q_ASSERT(!mApp); // Disable QML cache. Avoid malformed cache. qputenv("QML_DISABLE_DISK_CACHE", "true"); + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + // Useful to share camera on Fullscreen (other context) + QApplication::setAttribute(Qt::AA_ShareOpenGLContexts); + initQtAppDetails(); #ifdef ENABLE_APP_WEBVIEW #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) @@ -121,10 +125,6 @@ void AppController::stopApp(){ } void AppController::initQtAppDetails(){ - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - // Useful to share camera on Fullscreen (other context) - QApplication::setAttribute(Qt::AA_ShareOpenGLContexts); - // Do not use APPLICATION_NAME here. // The EXECUTABLE_NAME will be used in qt standard paths. It's our goal. QCoreApplication::setApplicationName(EXECUTABLE_NAME); diff --git a/linphone-app/src/components/chat-room/ChatRoomProxyModel.cpp b/linphone-app/src/components/chat-room/ChatRoomProxyModel.cpp index 48b47baae..6848d9f7d 100644 --- a/linphone-app/src/components/chat-room/ChatRoomProxyModel.cpp +++ b/linphone-app/src/components/chat-room/ChatRoomProxyModel.cpp @@ -101,7 +101,7 @@ CREATE_PARENT_MODEL_FUNCTION(deleteChatRoom) void ChatRoomProxyModel::compose (const QString& text) { - if (mChatRoomModel) + if (mChatRoomModel && !text.isEmpty()) mChatRoomModel->compose(); gCachedText = text; } diff --git a/linphone-app/ui/modules/Common/Form/DroppableTextArea.qml b/linphone-app/ui/modules/Common/Form/DroppableTextArea.qml index 17f602a47..bcec93067 100644 --- a/linphone-app/ui/modules/Common/Form/DroppableTextArea.qml +++ b/linphone-app/ui/modules/Common/Form/DroppableTextArea.qml @@ -56,6 +56,9 @@ Item { function insert(text){ textArea.insert(textArea.cursorPosition, text) } + function getText(){ + return textArea.getText(0, textArea.text.length) + } Rectangle{ anchors.fill: parent diff --git a/linphone-app/ui/modules/Linphone/Chat/Chat.qml b/linphone-app/ui/modules/Linphone/Chat/Chat.qml index 916dbea02..9d4471630 100644 --- a/linphone-app/ui/modules/Linphone/Chat/Chat.qml +++ b/linphone-app/ui/modules/Linphone/Chat/Chat.qml @@ -413,12 +413,12 @@ Rectangle { emojiVisible: chatEmojis.visible onDropped: Logic.handleFilesDropped(files) - onTextChanged: Logic.handleTextChanged(text) + onTextChanged: Logic.handleTextChanged(getText()) onValidText: { textArea.text = '' chat.bindToEnd = true if(proxyModel.chatRoomModel) { - proxyModel.sendMessage(text) + proxyModel.sendMessage(text)//Note : 'text' is coming from validText. It's not the text member. }else{ proxyModel.chatRoomModel = CallsListModel.createChat(proxyModel.peerAddress) proxyModel.sendMessage(text)