Version: 2.1 (using Devel) Installed from: Compiled sources OS: Linux Steps to Reproduce: 1. Open Dolphin. 2. Press F4. Result: Terminal part does not gain focus. Pressing tab focuses it. Looking at Part.cpp, it sets a focus proxy, but _viewManager->activeView() is NULL at this point, so the call does nothing.
Created attachment 23890 [details] Delays the focus proxy setting This patch fixes the problem... I think. I suspect this is not the correct way to solve the problem, and I'm not familiar enough with the code to know how it all fits together. But... it seems that this call should be in the view manager or something like that. Would one ever _not_ want this focus proxy to be set? i.e. is there any point to having focus on the view manager (or view controller or whatever) I'm guessing the rationale is because the part is single-session, whereas Konsole itself can be tabbed and such, but is there a reason even then not to have a focus proxy? (I don't know exactly the jobs of all the parts or what focus will do in each case.) Also, there seems to be a Part::newTab() method, so can the KPart mimic Konsole entirely? Sorry if the above is horribly inaccurate and just random. :-) Again, I'm not familiar with the code.
SVN commit 785436 by knight: Backport startup focus fix for embedded terminal. BUG: 159275 M +2 -1 Part.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=785436
> _viewManager->activeView() is NULL at this point, so the call does nothing. Well spotted, thank-you. I fixed this by using the view associated with the controller passed to Part::activeViewChanged() in the 4.0 branch and moved the focus proxy setting into ViewManager in the 4.1 branch (SVN commit r785440) > is there any point to having focus on the view manager The view manager itself is not a widget, but it does have a 'main' widget (a splitter used to divide multiple views within a window). This splitter widget's focus proxy should be set to the visible terminal display which wasn't happening. > Also, there seems to be a Part::newTab() method, > so can the KPart mimic Konsole entirely? With some work, yes. Only the small amount of code in the Application and MainWindow classes are unique to the Konsole application and only the Part class is unique to the embedded terminal. Everything else is shared between the two. Tabs are just turned off in the part via the setNavigationMethod() call when the part is created because I have not sorted out how integration with other applications such as Kate and KDevelop which provide their own tabbed views is going to work.