Skip to content
Snippets Groups Projects
Commit acc0bffc authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fixup vstat after bitmap_drv_init_mode()

Now that vstat is what was last drawn on the screen we need to
save/restore the width/height around calls to bitmap_drv_init_mode().
parent 96252a52
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4243 passed
...@@ -494,6 +494,7 @@ static void resize_window() ...@@ -494,6 +494,7 @@ static void resize_window()
static void init_mode_internal(int mode) static void init_mode_internal(int mode)
{ {
int mw, mh; int mw, mh;
int ow, oh;
x11_get_maxsize(&mw, &mh); x11_get_maxsize(&mw, &mh);
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
...@@ -501,8 +502,15 @@ static void init_mode_internal(int mode) ...@@ -501,8 +502,15 @@ static void init_mode_internal(int mode)
release_buffer(last); release_buffer(last);
last = NULL; last = NULL;
} }
ow = vstat.winwidth;
oh = vstat.winheight;
bitmap_drv_init_mode(mode, NULL, NULL, mw, mh); bitmap_drv_init_mode(mode, NULL, NULL, mw, mh);
x_cvstat = vstat;
vstat.winwidth = ow;
vstat.winheight = oh;
pthread_mutex_unlock(&vstatlock);
resize_window(); resize_window();
pthread_mutex_lock(&vstatlock);
x_cvstat = vstat; x_cvstat = vstat;
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
resize_xim(); resize_xim();
...@@ -557,6 +565,7 @@ static int video_init() ...@@ -557,6 +565,7 @@ static int video_init()
bitmap_drv_init(x11_drawrect, x11_flush); bitmap_drv_init(x11_drawrect, x11_flush);
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
bitmap_drv_init_mode(vstat.mode, NULL, NULL, 0, 0); bitmap_drv_init_mode(vstat.mode, NULL, NULL, 0, 0);
x_cvstat = vstat;
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
init_mode_internal(x_cvstat.mode); init_mode_internal(x_cvstat.mode);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment