[gnome-shell/ewlsh/console-domain-fix] Add module entry.js to setup console domain




commit 82a9e952525280eb57333966012d6a37f773878f
Author: Evan Welsh <contact evanwelsh com>
Date:   Fri Aug 20 20:42:27 2021 -0500

    Add module entry.js to setup console domain

 js/js-resources.gresource.xml |  1 +
 js/ui/entry.js                |  6 ++++++
 src/gnome-shell-plugin.c      | 13 +++++--------
 3 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/js/js-resources.gresource.xml b/js/js-resources.gresource.xml
index 6dc01b9240..b063f8774f 100644
--- a/js/js-resources.gresource.xml
+++ b/js/js-resources.gresource.xml
@@ -56,6 +56,7 @@
     <file>ui/dnd.js</file>
     <file>ui/edgeDragAction.js</file>
     <file>ui/endSessionDialog.js</file>
+    <file>ui/entry.js</file>
     <file>ui/environment.js</file>
     <file>ui/extensionDownloader.js</file>
     <file>ui/extensionSystem.js</file>
diff --git a/js/ui/entry.js b/js/ui/entry.js
new file mode 100644
index 0000000000..3da17d9886
--- /dev/null
+++ b/js/ui/entry.js
@@ -0,0 +1,6 @@
+import { setConsoleLogDomain } from 'console';
+
+setConsoleLogDomain('GNOME Shell');
+
+imports.ui.environment.init();
+imports.ui.main.start();
\ No newline at end of file
diff --git a/src/gnome-shell-plugin.c b/src/gnome-shell-plugin.c
index 39af545ace..ba68c0c8c0 100644
--- a/src/gnome-shell-plugin.c
+++ b/src/gnome-shell-plugin.c
@@ -106,7 +106,7 @@ gnome_shell_plugin_start (MetaPlugin *plugin)
 {
   GnomeShellPlugin *shell_plugin = GNOME_SHELL_PLUGIN (plugin);
   GError *error = NULL;
-  int status;
+  uint8_t status;
   GjsContext *gjs_context;
   ClutterBackend *backend;
 
@@ -126,13 +126,10 @@ gnome_shell_plugin_start (MetaPlugin *plugin)
 
   gjs_context = _shell_global_get_gjs_context (shell_plugin->global);
 
-  if (!gjs_context_eval (gjs_context,
-                         "imports.ui.environment.init();"
-                         "imports.ui.main.start();",
-                         -1,
-                         "<main>",
-                         &status,
-                         &error))
+  if (!gjs_context_eval_module_file (gjs_context,
+                                     "resource:///org/gnome/shell/ui/entry.js",
+                                     &status,
+                                     &error))
     {
       g_message ("Execution of main.js threw exception: %s", error->message);
       g_error_free (error);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]