Bug 141320 - GDB cmd prompt (integrated debugger) does not restore focus after entering a command
Summary: GDB cmd prompt (integrated debugger) does not restore focus after entering a ...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: CPP Debugger (show other bugs)
Version: 3.4.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-07 09:32 UTC by Christopher Layne
Modified: 2007-06-28 14:44 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 Christopher Layne 2007-02-07 09:32:31 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 4.1.1 
OS:                Linux

Enter a simple command like:

p /t some_variable

You get what you expect and then focus jumps away from the input field. This is counter-intuitive as most people entering manual gdb commands into the input field will be entering additional data into the "GDB cmd" field.

$ svn diff src/kdevelop/3.4/languages/cpp/debugger/gdboutputwidget.cpp
Index: src/kdevelop/3.4/languages/cpp/debugger/gdboutputwidget.cpp
===================================================================
--- src/kdevelop/3.4/languages/cpp/debugger/gdboutputwidget.cpp      (revision 631142)
+++ src/kdevelop/3.4/languages/cpp/debugger/gdboutputwidget.cpp      (working copy)
@@ -242,6 +242,7 @@
     m_gdbView->scrollToBottom();
     m_gdbView->setUpdatesEnabled(true);
     m_gdbView->update();
+    m_userGDBCmdEditor->setFocus();
 }

 /***************************************************************************/

Is what I added to get it to work for me. Debugger hotkeys still function properly while the input remains focused. Intuitively when using a debugger action like "step over" the focus is removed - but not removed if you're manually entering commands to gdb.
Comment 1 Wolfgang Wirth 2007-06-14 10:34:33 UTC
same here. A solution like proposed above would be great!
Comment 2 Aleksey Midenkov 2007-06-28 13:58:50 UTC
Somebody, please commit this patch.
Comment 3 Jens Dagerbo 2007-06-28 14:22:37 UTC
I would expect it to be safe. The case we had so much trouble with came from updating of the breakpoint editor markers, but I can't see any marker changes happening from entering a gdb command (event though in some cases there should be marker changes) so we shouldn't end up in that mess from this.

But why does the focus move away from the input box in the first place?
Comment 4 Andreas Pakulat 2007-06-28 14:38:11 UTC
Maybe due to the workaround to the breakpoint-table problem? Anyway, I'll apply and commit the patch.
Comment 5 Andreas Pakulat 2007-06-28 14:44:26 UTC
SVN commit 681287 by apaku:

Set focus on gdb edit field after executing a user-supplied gdb command.
Thanks to Christopher Layne for the patch.
BUG:141320


 M  +1 -0      gdboutputwidget.cpp  


--- branches/KDE/3.5/kdevelop/languages/cpp/debugger/gdboutputwidget.cpp #681286:681287
@@ -242,6 +242,7 @@
     m_gdbView->scrollToBottom();
     m_gdbView->setUpdatesEnabled(true);
     m_gdbView->update();
+    m_userGDBCmdEditor->setFocus();
 }
 
 /***************************************************************************/