Bug 119245 - Input is send to session even after it's been detached
Summary: Input is send to session even after it's been detached
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 1.6
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-30 16:56 UTC by Teemu Rytilahti
Modified: 2007-11-28 10:52 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
konsole-3.5.1-detach-send2all.patch (951 bytes, patch)
2006-02-24 17:57 UTC, Diego Elio Pettenò
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Teemu Rytilahti 2005-12-30 16:56:14 UTC
Version:           1.6 (using KDE 3.5.0, Kubuntu Package 4:3.5.0-0ubuntu3 dapper)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.14.3

Start a couple of sessions and select "Send input to all sessions". After doing that, detach one tab and start writing something on the session whose input is to be send to all sessions. The input appears also on that tab which has been detached, which it shouldn't imho do.
Comment 1 Kurt Hindenburg 2005-12-31 23:15:49 UTC
Two issues to take into account:
1. The detached session is the Master; that is this session's input is sent to all the other....
  The other slave sessions should return to normal input.
2. The detached session is a slave; this session's input comes from another session.
  The other slave sessions should continue as is.

I would say the detached session should no longer be a master nor a slave.
Comment 2 Diego Elio Pettenò 2006-02-24 16:04:50 UTC
Worse than that.. if a session is detached and then send input to all is disabled, the input is still sent to the detached window.

I think it would be the case to make sure that detached session does not receive send input to all.. both bad for usability (just IMHO), and bad for this bugged behaviour.
Comment 3 Diego Elio Pettenò 2006-02-24 17:57:40 UTC
Created attachment 14855 [details]
konsole-3.5.1-detach-send2all.patch

This is the patch I've wrote to make sure that on detach the session is
correctly detached from "send input to all sessions" kind of thing.
Comment 4 Kurt Hindenburg 2006-02-24 20:08:26 UTC
Thanks for that patch... seems to work except for one condition:
1. Detach the session (A) that is the master
2. Add another tab (B) to the detached konsole so that A and B are in the same Konsole.
3. Set the detached session A as the master
4. Commands from A don't go to B correctly.

Example: typing "echo 4" from A, sends "exi4" to B.  exit was the last command from B.
Comment 5 Kurt Hindenburg 2006-02-24 20:26:14 UTC
Also, not sure what the last disconnect is expected to do... gets warning:

QObject::disconnect: Unexpected null parameter
Comment 6 Kurt Hindenburg 2006-02-25 18:58:37 UTC
SVN commit 513592 by hindenburg:

Correct 'Send input to all sessions' after detaching session.
Thanks for the patch flameeyes

BUG: 119245


 M  +13 -0     konsole.cpp  


--- branches/KDE/3.5/kdebase/konsole/konsole/konsole.cpp #513591:513592
@@ -3621,6 +3621,19 @@
   sessions.remove(_se);
   delete ra;
 
+  if ( _se->isMasterMode() ) {
+    // Disable master mode when detaching master
+    setMasterMode(false);
+  } else {
+    QPtrListIterator<TESession> from_it(sessions);
+    for(; from_it.current(); ++from_it) {
+      TESession *from = from_it.current();
+      if(from->isMasterMode())
+        disconnect(from->widget(), SIGNAL(keyPressedSignal(QKeyEvent*)),
+	           _se->getEmulation(), SLOT(onKeyPress(QKeyEvent*)));
+    }
+  }
+
   QColor se_tabtextcolor = tabwidget->tabColor( _se->widget() );
 
   disconnect( _se,SIGNAL(done(TESession*)),
Comment 7 Gerard Mensoif 2007-11-28 10:52:17 UTC
For me this was more of a feature than a bug. Having the input sent to multiple screens that you can see because they have been detached. If you use tabbed session you don't see what you type in the other screen what can be dangerous. So it would be very nice if you could choose if you want to send the input to detached screen, or not.  I was using an old version of kde so I didn't notice this change faster, but now that I upgraded I am missing this feature/bug.

Thanks
Gerard