From 85c7d8ea97be4479817a409ba941d5362aa877b2 Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Mon, 7 Jul 2014 00:38:08 +0200 Subject: [PATCH] Removed mouse use since is not working, removed some prints and avoid passing mousemove events if the left button is not pressed. --- app/PreprocessedTerminal.qml | 6 ++++-- app/app.qmlproject.user | 2 +- konsole-qml-plugin/src/Emulation.cpp | 2 +- konsole-qml-plugin/src/Session.cpp | 8 ++++++-- konsole-qml-plugin/src/TerminalDisplay.cpp | 20 ++------------------ 5 files changed, 14 insertions(+), 24 deletions(-) diff --git a/app/PreprocessedTerminal.qml b/app/PreprocessedTerminal.qml index c0f957d..f33c5c2 100644 --- a/app/PreprocessedTerminal.qml +++ b/app/PreprocessedTerminal.qml @@ -149,8 +149,10 @@ Item{ } } onPositionChanged: { - var coord = correctDistortion(mouse.x, mouse.y); - kterminal.mouseMove(coord.width, coord.height); + if (pressedButtons & Qt.LeftButton){ + var coord = correctDistortion(mouse.x, mouse.y); + kterminal.mouseMove(coord.width, coord.height); + } } onPressed: { if (mouse.button == Qt.LeftButton){ diff --git a/app/app.qmlproject.user b/app/app.qmlproject.user index 0d90895..4444003 100644 --- a/app/app.qmlproject.user +++ b/app/app.qmlproject.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/konsole-qml-plugin/src/Emulation.cpp b/konsole-qml-plugin/src/Emulation.cpp index 00af010..3e854dc 100644 --- a/konsole-qml-plugin/src/Emulation.cpp +++ b/konsole-qml-plugin/src/Emulation.cpp @@ -64,7 +64,7 @@ Emulation::Emulation() : QObject::connect(&_bulkTimer2, SIGNAL(timeout()), this, SLOT(showBulk()) ); // listen for mouse status changes - connect( this , SIGNAL(programUsesMouseChanged(bool)) , + connect( this , SIGNAL(programUsesMouseChanged(bool)) , SLOT(usesMouseChanged(bool)) ); } diff --git a/konsole-qml-plugin/src/Session.cpp b/konsole-qml-plugin/src/Session.cpp index 4d59d51..41b9738 100644 --- a/konsole-qml-plugin/src/Session.cpp +++ b/konsole-qml-plugin/src/Session.cpp @@ -199,8 +199,12 @@ void Session::addView(KTerminalDisplay * widget) // allow emulation to notify view when the foreground process // indicates whether or not it is interested in mouse signals - connect( _emulation , SIGNAL(programUsesMouseChanged(bool)) , widget , - SLOT(setUsesMouse(bool)) ); + + // TODO Disabled since at the moment it is not working properly. + // Remember to reenable that once it' is's working. + + //connect( _emulation , SIGNAL(programUsesMouseChanged(bool)) , widget , + // SLOT(setUsesMouse(bool)) ); //widget->setUsesMouse( _emulation->programUsesMouse() ); diff --git a/konsole-qml-plugin/src/TerminalDisplay.cpp b/konsole-qml-plugin/src/TerminalDisplay.cpp index d4fb265..4c08db3 100644 --- a/konsole-qml-plugin/src/TerminalDisplay.cpp +++ b/konsole-qml-plugin/src/TerminalDisplay.cpp @@ -185,8 +185,6 @@ KTerminalDisplay::KTerminalDisplay(QQuickItem *parent) : _topMargin = DEFAULT_TOP_MARGIN; _leftMargin = DEFAULT_LEFT_MARGIN; - connect(this, SIGNAL(mouseSignal(int,int,int,int)), this, SLOT(banana(int,int,int,int))); - // setup timers for blinking cursor and text _blinkTimer = new QTimer(this); connect(_blinkTimer, SIGNAL(timeout()), this, SLOT(blinkEvent())); @@ -216,10 +214,6 @@ KTerminalDisplay::~KTerminalDisplay() delete[] _image; } -void KTerminalDisplay::banana(int x, int y, int z, int w){ - qDebug() << "Called banana " << x << " " << y << " " << z << " " << w; -} - void KTerminalDisplay::setSession(KSession * session) { if (m_session != session) { @@ -480,9 +474,6 @@ void KTerminalDisplay::mousePress(qreal x, qreal y){ if (m_focusOnClick) forcedFocus(); if (m_showVKBonClick) ShowVKB(true); - QPoint pos(x,y); - qDebug() << "Mousepress " <