File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ namespace Ev3devKit {
6868 Object ();
6969 init ();
7070 Ui . Screen . active_screen = new Ui .Screen ();
71+ notify[" is-active" ]. connect ((s, p) = > {
72+ Ui . Screen . can_draw = is_active;
73+ });
7174 }
7275
7376 public override bool event (Grx .Event event ) {
Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ namespace Ev3devKit.Ui {
3737 Queue<uint?> key_queue;
3838 Context context;
3939
40+ /**
41+ * Hack to prevent drawing during console switching.
42+ */
43+ internal static bool can_draw { get ; set ; default = true ; }
44+
4045 /**
4146 * Gets and sets the foreground color.
4247 *
@@ -254,7 +259,7 @@ namespace Ev3devKit.Ui {
254259 */
255260 protected bool draw () {
256261 handle_input ();
257- if (dirty) {
262+ if (dirty && can_draw ) {
258263 set_current_context (context);
259264 Window ? top_window = null ;
260265 Window ? top_dialog = null ;
You can’t perform that action at this time.
0 commit comments