|
@@ -466,8 +466,18 @@ void zori_draw_all(void) {
|
|
|
zori_widget_raise_overdraw_event(&the_zori_root->widget);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+int zori_handle_system_event(zori_system_event * sysev) {
|
|
|
+
|
|
|
+ * Otherwise, the events go into the system. */
|
|
|
+ if (the_zori_root->console ) {
|
|
|
+ if (zori_console_active(the_zori_root->console)) {
|
|
|
+ int res = zori_widget_raise_system_event(&the_zori_root->console->widget, sysev);
|
|
|
+ if (!zori_propagate_event_p(res)) return res;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return zori_widget_raise_system_event(&the_zori_root->widget, sysev);
|
|
|
+}
|
|
|
|
|
|
|
|
|
int zori_widget_visible(struct zori_widget * widget) {
|
|
@@ -992,6 +1002,8 @@ struct zori_console * zori_console_alloc() {
|
|
|
|
|
|
struct zori_console * zori_console_initall(struct zori_console * self, int id, zori_rebox * bounds, struct zori_style * style) {
|
|
|
if(!self) return NULL;
|
|
|
+
|
|
|
+ if (the_zori_root->console) return NULL;
|
|
|
if(!zori_widget_initall(&self->widget, id, &the_zori_root->widget, bounds, style, 7, zori_console_actions)) {
|
|
|
return NULL;
|
|
|
}
|
|
@@ -1011,6 +1023,8 @@ struct zori_console * zori_console_initall(struct zori_console * self, int id, z
|
|
|
if (!self->input) { zori_console_done(&self->widget); return NULL; }
|
|
|
self->command = NULL;
|
|
|
self->command_data = NULL;
|
|
|
+
|
|
|
+ the_zori_root->console = self;
|
|
|
return self;
|
|
|
}
|
|
|
|