Bug 139014 - Default editor loses focus when you hit enter
Summary: Default editor loses focus when you hit enter
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: CPP Debugger (show other bugs)
Version: 3.3.5
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-19 17:31 UTC by Eric Torstenson
Modified: 2007-01-08 02:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Torstenson 2006-12-19 17:31:04 UTC
Version:           3.3.5 (using KDE KDE 3.5.5)
Installed from:    Fedora RPMs
Compiler:          gcc 4 
OS:                Linux

This might be related to having several projects open at once (different instances of kdevelop in separate windows). And has been happening for a while now, but all of a sudden it is getting much worse. 

Basically, every once in a while, when I hit return, the main editor seems to lose focus (the cursor stops blinking and non-controlish key strokes of any kind do nothing- so no typing, just "Cntrl S" and those types of things do work). I then have to use the mouse to regain focus in order to type. Previously, this would occur once or twice an hour, but this morning, it happens after every single return!

I have 3 copies of KDevelop open, about 8 terminals and a couple instances of konqueror opened (plus some mozilla stuff and a copy of open office). 

The only thing that I don't always have open is konqueror- I only use it when I am doing specific tasks. At this particular point, I am not debugging anything in KDevelop, and have probably restarted all instances since I last used the debugger. My view is either "class view, plain" or "file selector" for all instances (at this moment, all are set to "class view").

Closing down all of the konqueror windows did nothing. Closing down all of the kdevelop applications and restarting them seems to work.
Comment 1 Jens Dagerbo 2006-12-28 05:54:45 UTC
Weird! I actually remember seeing this.. on a random cvs checkout several years ago! Haven't seen it since...

What UI mode are you using? Does it happen with all UI modes? (Settings->Configure KDevelop->User Interface)

Can you please try 3.4 RC2 and see if you can reproduce it there?
Comment 2 Christian Schneider 2007-01-06 10:08:49 UTC
I can confirm this bug for KDevelop 3.4 up to SVN revision 620175, but I can't reproduce it though. It happens approx. in 10% of my coding sessions (C++ with QMake). Closing and re-opening the project helps out.

When I encounter this behaviour, I usually have only one instance of KDevelop opened. The editor window loses its focus whenever a new line is inserted, either when pressing enter or when pasting text with CTRL+V that contains a newline. This happens for every newline, I haven't seen that it just occurs for some newlines, like Eric.

I have no KTE plugins activated.
Comment 3 Jens Dagerbo 2007-01-06 10:17:17 UTC
Really strange, this one.. I'm not aware of any code in KDevelop that would trigger particularly on newlines.

When it happens, does it then happen in every file? The behaviour remains if you switch to a different file? If it does, could you try opening a non code text document from outside the project directory and type in that? (This latter file should have a lot less KDevelop code working on it.) In this scenario, please also try opening a new code file from within your project, to make sure simply opening a new document doesn't "fix" it.
Comment 4 Eric Torstenson 2007-01-06 17:14:41 UTC
I keep forgetting to check UI mode. I certainly haven't changed that, so it would be whatever is the default in fedora releases. 

As for other files, I "think" it happens, but I generally don't edit files other than makefiles and cpp/h files (the makes would be named weird and almost never show up with highlighted text). However, I can't say I've ever tried to switch over to one of the non-code files once this is happening. 

Lately, I think once it gets stuck, it seems to be stuck. However, a couple of months ago, the problem seemed to be intermittent. So perhaps it has gotten worse with a later release of the IDE or some KDE components (or possibly gnome). I should have mentioned that I am not using KDE directly- but using KDevelop through gnome. 
Comment 5 Jens Dagerbo 2007-01-07 21:50:45 UTC
I had the focus disappear on me just now.. and found it on the breakpointswidget!

There's something fishy about that table...
Comment 6 Alexander Dymo 2007-01-08 02:42:48 UTC
SVN commit 621018 by dymo:

A hack to bring focus back to editor from debugger breakpoint widget on editor markers change.
This doesn't allow the editor ocassionally loose focus. Actual problem lies in
GDBTable widget or QTable so fixing that by using listview doesn't make sense just before the release.
BUG: 139014


 M  +4 -1      debugger.cpp  


--- branches/kdevelop/3.4/languages/lib/debugger/debugger.cpp #621017:621018
@@ -29,7 +29,7 @@
 // {
 //     if (!s_instance)
 //         s_instance = new Debugger;
-// 
+//
 //     return s_instance;
 // }
 
@@ -170,6 +170,9 @@
                 if (m->type & Breakpoint)
                     emit toggledBreakpoint( doc->url().path(), m->line );
             }
+
+            //bring focus back to the editor
+            m_partController->activatePart(m_partController->partForURL( doc->url() ));
         }
     }
 }