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

Some X client optimizations.

- Only call cb_flush() if a new rect was queued.
- Ensure bitmap_drv_request_some_pixels() is only called once in
  response to an expose request.

This should fix issue #565.
parent 87f05b6d
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4286 passed
...@@ -722,11 +722,11 @@ static void blinker_thread(void *data) ...@@ -722,11 +722,11 @@ static void blinker_thread(void *data)
screen->update_pixels = 0; screen->update_pixels = 0;
pthread_mutex_unlock(&screenlock); pthread_mutex_unlock(&screenlock);
cb_drawrect(rect); cb_drawrect(rect);
cb_flush();
} }
else { else {
pthread_mutex_unlock(&screenlock); pthread_mutex_unlock(&screenlock);
} }
cb_flush();
} }
} }
......
...@@ -805,11 +805,13 @@ static void expose_rect(int x, int y, int width, int height) ...@@ -805,11 +805,13 @@ static void expose_rect(int x, int y, int width, int height)
last = NULL; last = NULL;
bitmap_drv_request_some_pixels(sx, sy, ex-sx+1, ey-sy+1); bitmap_drv_request_some_pixels(sx, sy, ex-sx+1, ey-sy+1);
} }
else {
// Do nothing... // Do nothing...
if (sx == ex || sy == ey) if (sx == ex || sy == ey)
return; return;
bitmap_drv_request_some_pixels(sx, sy, ex-sx+1, ey-sy+1); bitmap_drv_request_some_pixels(sx, sy, ex-sx+1, ey-sy+1);
} }
}
static bool static bool
xlat_mouse_xy(int *x, int *y) xlat_mouse_xy(int *x, int *y)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment