Bladeren bron

tools: do not grab focus before the entry widget is realized

Daniele Bartolini 4 jaren geleden
bovenliggende
commit
00759fe5bb
2 gewijzigde bestanden met toevoegingen van 1 en 6 verwijderingen
  1. 1 0
      tools/level_editor/level_editor.vala
  2. 0 6
      tools/widgets/console_view.vala

+ 1 - 0
tools/level_editor/level_editor.vala

@@ -2101,6 +2101,7 @@ public class LevelEditorApplication : Gtk.Application
 		else
 		{
 			_console_view.show_all();
+			_console_view._entry.grab_focus_without_selecting();
 		}
 	}
 

+ 0 - 6
tools/widgets/console_view.vala

@@ -144,7 +144,6 @@ public class ConsoleView : Gtk.Box
 		this.pack_start(_scrolled_window, true, true, 0);
 		this.pack_start(_entry_hbox, false, true, 0);
 
-		this.show.connect(on_show);
 		this.destroy.connect(on_destroy);
 		this.button_release_event.connect(on_button_released);
 		this.motion_notify_event.connect(on_motion_notify);
@@ -225,11 +224,6 @@ public class ConsoleView : Gtk.Box
 		return Gdk.EVENT_PROPAGATE;
 	}
 
-	private void on_show()
-	{
-		_entry.grab_focus_without_selecting();
-	}
-
 	private void on_destroy()
 	{
 		_console_view_valid = false;