瀏覽代碼

Kernel: Set console active before try to enable graphical mode

We should first enable the VirtualConsole and then enable graphical
mode, to ensure proper display output on the switched-to virtual console
that has been chosen. When de-activating graphical mode, we do the
de-activating first then enable the VirtualConsole to ensure proper text
output on screen.
Liav A 3 年之前
父節點
當前提交
ec925cbb89
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      Kernel/TTY/ConsoleManagement.cpp

+ 3 - 2
Kernel/TTY/ConsoleManagement.cpp

@@ -84,9 +84,10 @@ void ConsoleManagement::switch_to(unsigned index)
     // if needed. This will ensure we clear the screen and also that WindowServer won't print anything
     // in between.
     if (m_active_console->is_graphical() && !was_graphical) {
+        m_active_console->set_active(true);
         GraphicsManagement::the().activate_graphical_mode();
-    }
-    if (!m_active_console->is_graphical() && was_graphical) {
+        return;
+    } else if (!m_active_console->is_graphical() && was_graphical) {
         GraphicsManagement::the().deactivate_graphical_mode();
     }
     m_active_console->set_active(true);