From konsole-devel Sun Oct 20 14:04:57 2002 From: Luis Pedro Coelho Date: Sun, 20 Oct 2002 14:04:57 +0000 To: konsole-devel Subject: [Konsole-devel] [PATCH to bug 49153]: deattach/attach session -> key input is doubled X-MARC-Message: https://marc.info/?l=konsole-devel&m=103512276507858 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_Jgrs9tyBf/VQa/X" --Boundary-00=_Jgrs9tyBf/VQa/X Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, [I hope this is the right place for this]. (See the bug report at http://bugs.kde.org/show_bug.cgi?id=49153) There is another manifestation of the bug: instead of reattaching the konsole, open another session and now inputs on this new session will also appear on the dettached one. I found that the problem is that TEmulVt102::onKeyPressed is *not* disconnected from TEWidget::keyPressedSignal as it should so it gets connected twice. This looks like a Qt bug, though I was unable to build a simple case showing the bug. This is reinforced by the fact that it only shows on qt-copy. This patch works around the bug. However, I think that this patch is also better since it is more fault-tolerant, i.e. if you add a connection later there is no possibility you forget to disconnect it. HTH, -- Luis Pedro Coelho "Technology does not always equal progress." Douglas Coupland --Boundary-00=_Jgrs9tyBf/VQa/X Content-Type: text/x-diff; charset="us-ascii"; name="konsole.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="konsole.patch" Index: TEmuVt102.cpp =================================================================== RCS file: /cvs/kdebase/konsole/konsole/TEmuVt102.cpp,v retrieving revision 1.94 diff -u -3 -p -r1.94 TEmuVt102.cpp --- TEmuVt102.cpp 2002/09/14 00:15:45 1.94 +++ TEmuVt102.cpp 2002/10/20 13:59:37 @@ -95,11 +95,8 @@ void TEmuVt102::changeGUI(TEWidget* newg { if (gui==newgui) return; - QObject::disconnect(gui,SIGNAL(mouseSignal(int,int,int)), - this,SLOT(onMouse(int,int,int))); - QObject::disconnect(gui, SIGNAL(sendStringToEmu(const char*)), - this, SLOT(sendString(const char*))); - TEmulation::changeGUI(newgui); + TEmulation::changeGUI(newgui); //This disconnects everything, so we don't need to + QObject::connect(gui,SIGNAL(mouseSignal(int,int,int)), this,SLOT(onMouse(int,int,int))); QObject::connect(gui, SIGNAL(sendStringToEmu(const char*)), Index: TEmulation.cpp =================================================================== RCS file: /cvs/kdebase/konsole/konsole/TEmulation.cpp,v retrieving revision 1.44 diff -u -3 -p -r1.44 TEmulation.cpp --- TEmulation.cpp 2002/08/27 08:53:59 1.44 +++ TEmulation.cpp 2002/10/20 13:59:37 @@ -148,27 +148,7 @@ void TEmulation::connectGUI() void TEmulation::changeGUI(TEWidget* newgui) { if (gui==newgui) return; - - QObject::disconnect(gui,SIGNAL(changedImageSizeSignal(int,int)), - this,SLOT(onImageSizeChange(int,int))); - QObject::disconnect(gui,SIGNAL(changedHistoryCursor(int)), - this,SLOT(onHistoryCursorChange(int))); - QObject::disconnect(gui,SIGNAL(keyPressedSignal(QKeyEvent*)), - this,SLOT(onKeyPress(QKeyEvent*))); - QObject::disconnect(gui,SIGNAL(beginSelectionSignal(const int,const int)), - this,SLOT(onSelectionBegin(const int,const int)) ); - QObject::disconnect(gui,SIGNAL(extendSelectionSignal(const int,const int)), - this,SLOT(onSelectionExtend(const int,const int)) ); - QObject::disconnect(gui,SIGNAL(endSelectionSignal(const bool)), - this,SLOT(setSelection(const bool)) ); - QObject::disconnect(gui,SIGNAL(copySelectionSignal()), - this,SLOT(copySelection()) ); - QObject::disconnect(gui,SIGNAL(clearSelectionSignal()), - this,SLOT(clearSelection()) ); - QObject::disconnect(gui,SIGNAL(isBusySelecting(bool)), - this,SLOT(isBusySelecting(bool)) ); - QObject::disconnect(gui,SIGNAL(testIsSelected(const int, const int, bool &)), - this,SLOT(testIsSelected(const int, const int, bool &)) ); + QObject::disconnect(gui,0,this,0); // Just disconnect everything gui=newgui; connectGUI(); } --Boundary-00=_Jgrs9tyBf/VQa/X-- _______________________________________________ konsole-devel mailing list konsole-devel@mail.kde.org http://mail.kde.org/mailman/listinfo/konsole-devel