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

More fullscreen work, get resize working

parent 66d352ba
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4416 passed
...@@ -781,6 +781,11 @@ static void resize_window() ...@@ -781,6 +781,11 @@ static void resize_window()
int max_width, max_height; int max_width, max_height;
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
if (fullscreen) {
// TODO: Position window correctly...
fullscreen_geometry(NULL, NULL, &width, &height);
}
else {
bitmap_get_scaled_win_size(x_cvstat.scaling, &width, &height, 0, 0); bitmap_get_scaled_win_size(x_cvstat.scaling, &width, &height, 0, 0);
if (x11_get_maxsize(&max_width, &max_height)) { if (x11_get_maxsize(&max_width, &max_height)) {
if (width > max_width || height > max_height) { if (width > max_width || height > max_height) {
...@@ -795,6 +800,7 @@ static void resize_window() ...@@ -795,6 +800,7 @@ static void resize_window()
resize_xim(); resize_xim();
return; return;
} }
}
x_cvstat.winwidth = width; x_cvstat.winwidth = width;
x_cvstat.winheight = height; x_cvstat.winheight = height;
x_cvstat.scaling = bitmap_double_mult_inside(width, height); x_cvstat.scaling = bitmap_double_mult_inside(width, height);
...@@ -917,6 +923,7 @@ local_draw_rect(struct rectlist *rect) ...@@ -917,6 +923,7 @@ local_draw_rect(struct rectlist *rect)
// Scale... // Scale...
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
if (x_cvstat.winwidth != vstat.winwidth || x_cvstat.winheight != vstat.winheight) { if (x_cvstat.winwidth != vstat.winwidth || x_cvstat.winheight != vstat.winheight) {
bitmap_drv_free_rect(rect);
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
return; return;
} }
...@@ -1070,6 +1077,10 @@ static void handle_resize_event(int width, int height) ...@@ -1070,6 +1077,10 @@ static void handle_resize_event(int width, int height)
bool resize = false; bool resize = false;
double new_scaling; double new_scaling;
if (fullscreen) {
fullscreen = false;
resize = true;
}
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
vstat.winwidth = width; vstat.winwidth = width;
vstat.winheight = height; vstat.winheight = height;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment