Patch #2332 2008-01-11 18:49

pecan

Return focus to editor during compilations
Download
2332-Return_focus_t.patch (1.0 KB)
Category
Plugin::Refinement
Status
Accepted
Close date
2008-04-04 15:03
Assigned to
biplab
Index: compilergcc.cpp
===================================================================
--- compilergcc.cpp    (revision 4767)
+++ compilergcc.cpp    (working copy)
@@ -669,10 +669,7 @@
 
 void CompilerGCC::Dispatcher(wxCommandEvent& event)
 {
-    // Memorize the currently focused window
 
-    //wxWindow* focused = wxWindow::FindFocus();
-
     int eventId = event.GetId();
 
 //    Manager::Get()->GetMessageManager()->Log(wxT("Dispatcher")));
@@ -741,11 +738,11 @@
     if (eventId == idMenuSettings)
         OnConfig(event);
 
-    // Return focus to previously focused window
-    /* NOTE (Biplab#1#): Commented the following lines to fix [Bug #10802]. Uncomment this if it
-    breaks anything or replace this with a better fix, when available. */
-    /*if (focused)
-        focused->SetFocus();*/
+    // Return focus to current editor
+    cbEditor* ed = 0;
+    if ( (ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor()) )
+        ed->GetControl()->SetFocus();
+
 }
 
 void CompilerGCC::TextURL(wxTextUrlEvent& event) 
mortenmacfly 2008-01-18 19:10

Looks good to me - got it applied since posted - no issues. Would vote for: Go ahead! :-)

biplab 2008-04-04 15:03

Thanks Pecan. :-D