mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
Kernel: Force y offset 0 when switching between console & graphics modes
This fixes a weird bug that when sometimes a user tried to switch to console mode, the screen was frozen on graphics mode. After a hour of debugging this, it became apparent that the problem was that we left the y offset of the bochs graphics device in an invalid state, so it was not zero because the WindowServer changed it, and the framebuffer console code is not aware of horizontal and vertical offsets of the framebuffer screen, leading to the problem that the framebuffer console updates the first framebuffer (y offset = 0), but hardware was indicated to show the second framebuffer (y offset = first framebuffer height). Therefore, when doing a switch between these modes, always set the y offset to be zero.
This commit is contained in:
parent
659b0d7fb4
commit
9bec9c2b78
|
@ -56,6 +56,10 @@ bool DisplayConnector::console_mode() const
|
|||
void DisplayConnector::set_display_mode(Badge<GraphicsManagement>, DisplayMode mode)
|
||||
{
|
||||
SpinlockLocker locker(m_control_lock);
|
||||
{
|
||||
SpinlockLocker locker(m_modeset_lock);
|
||||
[[maybe_unused]] auto result = set_y_offset(0);
|
||||
}
|
||||
m_console_mode = mode == DisplayMode::Console ? true : false;
|
||||
if (m_console_mode)
|
||||
enable_console();
|
||||
|
|
Loading…
Reference in a new issue