|
|
@@ -71,6 +71,7 @@ static int boot_scan_pid;
|
|
|
static int boot_scan_placed;
|
|
|
static unsigned int boot_scan_deadline;
|
|
|
static unsigned int bar_kexec_busy, bar_kexec_progress, bar_kexec_total;
|
|
|
+static void remap_window_contents(void);
|
|
|
static int bar_temp_c = -1;
|
|
|
static int bar_batt_pct = -1;
|
|
|
static int bar_batt_charging;
|
|
|
@@ -1210,6 +1211,7 @@ static void move_window_pixels(struct uwin *u, int ox, int oy, int nx, int ny)
|
|
|
|
|
|
if (u_wm_begin() != 0)
|
|
|
return;
|
|
|
+ remap_window_contents();
|
|
|
if (old_on && new_on)
|
|
|
usurf_copy(&screen, nx, ny, ox, oy, u->info.w, u->info.h);
|
|
|
else
|
|
|
@@ -1252,6 +1254,7 @@ static void redraw_geom(struct uwin *u, int ox, int oy,
|
|
|
add_rect(&present, ox, oy, ow, oh);
|
|
|
add_rect(&present, u->info.x, u->info.y, u->info.w, u->info.h);
|
|
|
if (u_wm_begin() == 0) {
|
|
|
+ remap_window_contents();
|
|
|
for (i = 0; i < present.count; i++)
|
|
|
draw_rect(present.rect[i].x, present.rect[i].y,
|
|
|
present.rect[i].w, present.rect[i].h);
|
|
|
@@ -1637,6 +1640,37 @@ static void sm_close(void)
|
|
|
full_redraw = 1;
|
|
|
}
|
|
|
|
|
|
+/* A client can self-resize between the pre-frame info/map refresh and
|
|
|
+ * u_wm_begin(); that unmaps and remaps its content slot, leaving the map
|
|
|
+ * cached above pointing at released pages. Once the frame is active the
|
|
|
+ * kernel refuses further self-resizes, so re-reading the generation and
|
|
|
+ * remapping here makes the cached canvas safe for the draw calls. The
|
|
|
+ * window info itself is left for the next loop, which then sees the
|
|
|
+ * generation change and does a full redraw. */
|
|
|
+static void remap_window_contents(void)
|
|
|
+{
|
|
|
+ unsigned int i;
|
|
|
+
|
|
|
+ for (i = 0; i < WM_MAX_WINDOWS; i++) {
|
|
|
+ struct wm_window_info info;
|
|
|
+ struct wm_map_info map;
|
|
|
+
|
|
|
+ if (u_wm_info(i, &info) != 1 || !info.used) {
|
|
|
+ wins[i].mapped = 0;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (wins[i].mapped &&
|
|
|
+ wins[i].map.generation == info.content_gen)
|
|
|
+ continue;
|
|
|
+ if (u_wm_map(i, &map) == 0) {
|
|
|
+ wins[i].map = map;
|
|
|
+ wins[i].mapped = 1;
|
|
|
+ } else {
|
|
|
+ wins[i].mapped = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
static void do_update(struct wm_status *st)
|
|
|
{
|
|
|
struct wm_present_info present;
|
|
|
@@ -1897,6 +1931,7 @@ static void do_update(struct wm_status *st)
|
|
|
return;
|
|
|
}
|
|
|
full_redraw = 0;
|
|
|
+ remap_window_contents();
|
|
|
need = 1;
|
|
|
{
|
|
|
draw_rect(0, 0, fbw, fbh);
|
|
|
@@ -1964,6 +1999,7 @@ static void do_update(struct wm_status *st)
|
|
|
sm_add_present(&present);
|
|
|
if (u_wm_begin() != 0)
|
|
|
return;
|
|
|
+ remap_window_contents();
|
|
|
|
|
|
for (i = 0; i < present.count; i++)
|
|
|
draw_rect(present.rect[i].x, present.rect[i].y,
|
|
|
@@ -2390,6 +2426,7 @@ static void handle_mouse(struct wm_status *st)
|
|
|
add_rect(&present, nx, ny,
|
|
|
u->info.w, u->info.h);
|
|
|
if (u_wm_begin() == 0) {
|
|
|
+ remap_window_contents();
|
|
|
for (i = 0;
|
|
|
i < present.count; i++)
|
|
|
draw_rect(
|