|
@@ -25,10 +25,6 @@
|
|
|
#define WM_CLOSE_INSET 3
|
|
#define WM_CLOSE_INSET 3
|
|
|
#define WM_CLOSE_ICON_PX 16
|
|
#define WM_CLOSE_ICON_PX 16
|
|
|
|
|
|
|
|
-/* Soft drop shadow around normal windows: this many pixels outside every
|
|
|
|
|
- * edge. Geometry damage expands by it and the shadow pass paints the ring. */
|
|
|
|
|
-#define WM_SHADOW_SPREAD 10
|
|
|
|
|
-
|
|
|
|
|
struct uwin {
|
|
struct uwin {
|
|
|
struct wm_window_info info;
|
|
struct wm_window_info info;
|
|
|
struct wm_map_info map;
|
|
struct wm_map_info map;
|
|
@@ -88,10 +84,9 @@ static unsigned int wall_rgb32[65536];
|
|
|
/* Settings pushed by the Settings app through SYS_WM_PREFS. The kernel
|
|
/* Settings pushed by the Settings app through SYS_WM_PREFS. The kernel
|
|
|
* keeps them across a WM restart; the app loads the file at boot and pushes
|
|
* keeps them across a WM restart; the app loads the file at boot and pushes
|
|
|
* it here. */
|
|
* it here. */
|
|
|
-static struct wm_prefs prefs = { 1, 1, 1, WM_DEFAULT_BG_RGB, { 0, 0, 0, 0 } };
|
|
|
|
|
|
|
+static struct wm_prefs prefs = { 1, 1, WM_DEFAULT_BG_RGB, { 0, 0, 0, 0 } };
|
|
|
static unsigned int prefs_seq_seen;
|
|
static unsigned int prefs_seq_seen;
|
|
|
static int prefs_seen_valid;
|
|
static int prefs_seen_valid;
|
|
|
-static int shadow_px = WM_SHADOW_SPREAD;
|
|
|
|
|
static unsigned int desktop_rgb = WM_DEFAULT_BG_RGB;
|
|
static unsigned int desktop_rgb = WM_DEFAULT_BG_RGB;
|
|
|
/* Settings app launcher: SYS_WM_OPEN_SETTINGS bumps a request counter in
|
|
/* Settings app launcher: SYS_WM_OPEN_SETTINGS bumps a request counter in
|
|
|
* wm_status. One window is reused, and a section request for a running app
|
|
* wm_status. One window is reused, and a section request for a running app
|
|
@@ -987,85 +982,6 @@ static unsigned int rect_sub(struct orect *out, const struct orect *r,
|
|
|
return n;
|
|
return n;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* cur = cur minus cut, using nxt as scratch. Returns the new rectangle
|
|
|
|
|
- * count; 0 also means the region is empty or the scratch list overflowed. */
|
|
|
|
|
-static unsigned int region_sub(struct orect *cur, unsigned int ncur,
|
|
|
|
|
- struct orect *nxt, const struct orect *cut)
|
|
|
|
|
-{
|
|
|
|
|
- unsigned int k, n = 0;
|
|
|
|
|
-
|
|
|
|
|
- for (k = 0; k < ncur; k++) {
|
|
|
|
|
- if (n + 4 > OCC_MAX)
|
|
|
|
|
- return 0;
|
|
|
|
|
- n += rect_sub(&nxt[n], &cur[k], cut);
|
|
|
|
|
- }
|
|
|
|
|
- for (k = 0; k < n; k++)
|
|
|
|
|
- cur[k] = nxt[k];
|
|
|
|
|
- return n;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-/* Soft shadows are painted after the windows, back to front, so a front
|
|
|
|
|
- * window's shadow falls on the windows behind it while every window and
|
|
|
|
|
- * every window in front of it occludes that shadow. Only the damage
|
|
|
|
|
- * rectangle is touched. */
|
|
|
|
|
-static void draw_shadows(const struct orect *dmg)
|
|
|
|
|
-{
|
|
|
|
|
- static struct orect cur[OCC_MAX], nxt[OCC_MAX];
|
|
|
|
|
- int order[WM_MAX_WINDOWS];
|
|
|
|
|
- unsigned int n = build_order(order), i, j, ncur;
|
|
|
|
|
-
|
|
|
|
|
- if (shadow_px <= 0)
|
|
|
|
|
- return;
|
|
|
|
|
- for (i = n; i-- > 0;) {
|
|
|
|
|
- struct uwin *u = &wins[order[i]];
|
|
|
|
|
- struct orect own, fr;
|
|
|
|
|
- int x0, y0, x1, y1;
|
|
|
|
|
-
|
|
|
|
|
- if (!u->info.used || u->info.popover)
|
|
|
|
|
- continue;
|
|
|
|
|
- x0 = u->info.x - shadow_px;
|
|
|
|
|
- y0 = u->info.y - shadow_px;
|
|
|
|
|
- x1 = u->info.x + (int)u->info.w + shadow_px;
|
|
|
|
|
- y1 = u->info.y + (int)u->info.h + shadow_px;
|
|
|
|
|
- if (x0 < dmg->x) x0 = dmg->x;
|
|
|
|
|
- if (y0 < dmg->y) y0 = dmg->y;
|
|
|
|
|
- if (x1 > dmg->x + (int)dmg->w) x1 = dmg->x + (int)dmg->w;
|
|
|
|
|
- if (y1 > dmg->y + (int)dmg->h) y1 = dmg->y + (int)dmg->h;
|
|
|
|
|
- if (y0 < WM_BAR_H) y0 = WM_BAR_H;
|
|
|
|
|
- if (x1 <= x0 || y1 <= y0)
|
|
|
|
|
- continue;
|
|
|
|
|
- cur[0].x = x0;
|
|
|
|
|
- cur[0].y = y0;
|
|
|
|
|
- cur[0].w = (unsigned int)(x1 - x0);
|
|
|
|
|
- cur[0].h = (unsigned int)(y1 - y0);
|
|
|
|
|
- ncur = 1;
|
|
|
|
|
- own.x = u->info.x;
|
|
|
|
|
- own.y = u->info.y;
|
|
|
|
|
- own.w = u->info.w;
|
|
|
|
|
- own.h = u->info.h;
|
|
|
|
|
- ncur = region_sub(cur, ncur, nxt, &own);
|
|
|
|
|
- for (j = 0; j < i && ncur; j++) {
|
|
|
|
|
- struct uwin *f = &wins[order[j]];
|
|
|
|
|
-
|
|
|
|
|
- if (!f->info.used)
|
|
|
|
|
- continue;
|
|
|
|
|
- fr.x = f->info.x;
|
|
|
|
|
- fr.y = f->info.y;
|
|
|
|
|
- fr.w = f->info.w;
|
|
|
|
|
- fr.h = f->info.h;
|
|
|
|
|
- ncur = region_sub(cur, ncur, nxt, &fr);
|
|
|
|
|
- }
|
|
|
|
|
- if (!ncur)
|
|
|
|
|
- continue;
|
|
|
|
|
- for (j = 0; j < ncur; j++)
|
|
|
|
|
- usurf_window_shadow(&screen, u->info.x, u->info.y,
|
|
|
|
|
- (int)u->info.w, (int)u->info.h,
|
|
|
|
|
- shadow_px,
|
|
|
|
|
- cur[j].x, cur[j].y,
|
|
|
|
|
- cur[j].w, cur[j].h);
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
static void wall_build_maps(void)
|
|
static void wall_build_maps(void)
|
|
|
{
|
|
{
|
|
|
unsigned int i;
|
|
unsigned int i;
|
|
@@ -1143,7 +1059,6 @@ static void wall_load(void)
|
|
|
|
|
|
|
|
static void apply_prefs(void)
|
|
static void apply_prefs(void)
|
|
|
{
|
|
{
|
|
|
- shadow_px = prefs.shadow ? WM_SHADOW_SPREAD : 0;
|
|
|
|
|
desktop_rgb = prefs.bg_rgb & 0x00FFFFFFu;
|
|
desktop_rgb = prefs.bg_rgb & 0x00FFFFFFu;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1271,15 +1186,6 @@ static void draw_rect_naive(int x, int y, unsigned int w, unsigned int h)
|
|
|
y < wins[i].info.y + (int)wins[i].info.h &&
|
|
y < wins[i].info.y + (int)wins[i].info.h &&
|
|
|
y + (int)h > wins[i].info.y)
|
|
y + (int)h > wins[i].info.y)
|
|
|
draw_window_clip(i, x, y, w, h);
|
|
draw_window_clip(i, x, y, w, h);
|
|
|
- {
|
|
|
|
|
- struct orect dmg;
|
|
|
|
|
-
|
|
|
|
|
- dmg.x = x;
|
|
|
|
|
- dmg.y = y;
|
|
|
|
|
- dmg.w = w;
|
|
|
|
|
- dmg.h = h;
|
|
|
|
|
- draw_shadows(&dmg);
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void draw_rect(int x, int y, unsigned int w, unsigned int h)
|
|
static void draw_rect(int x, int y, unsigned int w, unsigned int h)
|
|
@@ -1351,11 +1257,8 @@ static void draw_rect(int x, int y, unsigned int w, unsigned int h)
|
|
|
draw_window_clip((unsigned int)order[i], cur[j].x,
|
|
draw_window_clip((unsigned int)order[i], cur[j].x,
|
|
|
cur[j].y, cur[j].w, cur[j].h);
|
|
cur[j].y, cur[j].w, cur[j].h);
|
|
|
}
|
|
}
|
|
|
- if (overflow) {
|
|
|
|
|
|
|
+ if (overflow)
|
|
|
draw_rect_naive(dmg.x, dmg.y, dmg.w, dmg.h);
|
|
draw_rect_naive(dmg.x, dmg.y, dmg.w, dmg.h);
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- draw_shadows(&dmg);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* Invisible resize border: edge bits for a point in the band around the
|
|
/* Invisible resize border: edge bits for a point in the band around the
|
|
@@ -1529,26 +1432,6 @@ static void add_rect(struct wm_present_info *p, int x, int y,
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* The rectangle a window occupies including its drop shadow, clipped below
|
|
|
|
|
- * the top bar. */
|
|
|
|
|
-static void window_shadow_rect(struct orect *r, int x, int y,
|
|
|
|
|
- unsigned int w, unsigned int h)
|
|
|
|
|
-{
|
|
|
|
|
- r->x = x - shadow_px;
|
|
|
|
|
- r->y = y - shadow_px;
|
|
|
|
|
- r->w = w + 2 * (unsigned int)shadow_px;
|
|
|
|
|
- r->h = h + 2 * (unsigned int)shadow_px;
|
|
|
|
|
- if (r->y < WM_BAR_H) {
|
|
|
|
|
- unsigned int cut = (unsigned int)(WM_BAR_H - r->y);
|
|
|
|
|
-
|
|
|
|
|
- if (cut >= r->h)
|
|
|
|
|
- r->h = 0;
|
|
|
|
|
- else
|
|
|
|
|
- r->h -= cut;
|
|
|
|
|
- r->y = WM_BAR_H;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
/* Damage rectangle covering one window's close button, for a hover change. */
|
|
/* Damage rectangle covering one window's close button, for a hover change. */
|
|
|
static void close_add_damage(struct wm_present_info *p, int idx)
|
|
static void close_add_damage(struct wm_present_info *p, int idx)
|
|
|
{
|
|
{
|
|
@@ -1682,18 +1565,16 @@ static int shadow_overlay_covers(int x, int y, int w, int h)
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* A focused window is topmost, so the screen shadow contains exactly its
|
|
|
|
|
- * pixels in the old rectangle, unless the dock or the brightness OSD covers
|
|
|
|
|
- * part of it. Copy that block, repaint the old ring the new window does not
|
|
|
|
|
- * cover, and repaint the new shadow ring (its background is stationary and
|
|
|
|
|
- * may differ from the old position, so the ring is never block-copied).
|
|
|
|
|
- * When either window rectangle is partly off-screen, or an overlay hid part
|
|
|
|
|
- * of the source, repaint the whole new shadow rect instead of copying
|
|
|
|
|
- * overlay pixels into the window. */
|
|
|
|
|
|
|
+/* A focused window is topmost, so the shadow contains exactly its pixels in
|
|
|
|
|
+ * the old rectangle, unless the dock or the brightness OSD covers part of
|
|
|
|
|
+ * it. Move that block and repaint only the old part the new rectangle does
|
|
|
|
|
+ * not cover. When either rectangle is partly off-screen, or an overlay hid
|
|
|
|
|
+ * part of the source, the shadow has no valid pixels there, so repaint the
|
|
|
|
|
+ * new rect instead of copying overlay pixels into the window. */
|
|
|
static void move_window_pixels(struct uwin *u, int ox, int oy, int nx, int ny)
|
|
static void move_window_pixels(struct uwin *u, int ox, int oy, int nx, int ny)
|
|
|
{
|
|
{
|
|
|
struct wm_present_info present;
|
|
struct wm_present_info present;
|
|
|
- struct orect old_sh, new_sh, new_win, pieces[4];
|
|
|
|
|
|
|
+ struct orect oldr, newr, pieces[4];
|
|
|
unsigned int np, k;
|
|
unsigned int np, k;
|
|
|
int w = (int)u->info.w, h = (int)u->info.h;
|
|
int w = (int)u->info.w, h = (int)u->info.h;
|
|
|
int old_on = ox >= 0 && oy >= 0 &&
|
|
int old_on = ox >= 0 && oy >= 0 &&
|
|
@@ -1702,47 +1583,34 @@ static void move_window_pixels(struct uwin *u, int ox, int oy, int nx, int ny)
|
|
|
int new_on = nx >= 0 && ny >= 0 &&
|
|
int new_on = nx >= 0 && ny >= 0 &&
|
|
|
nx + w <= (int)fbw && ny + h <= (int)fbh;
|
|
nx + w <= (int)fbw && ny + h <= (int)fbh;
|
|
|
|
|
|
|
|
- window_shadow_rect(&old_sh, ox, oy, u->info.w, u->info.h);
|
|
|
|
|
- window_shadow_rect(&new_sh, nx, ny, u->info.w, u->info.h);
|
|
|
|
|
- new_win.x = nx;
|
|
|
|
|
- new_win.y = ny;
|
|
|
|
|
- new_win.w = u->info.w;
|
|
|
|
|
- new_win.h = u->info.h;
|
|
|
|
|
if (u_wm_begin() != 0)
|
|
if (u_wm_begin() != 0)
|
|
|
return;
|
|
return;
|
|
|
remap_window_contents();
|
|
remap_window_contents();
|
|
|
if (old_on && new_on)
|
|
if (old_on && new_on)
|
|
|
usurf_copy(&screen, nx, ny, ox, oy, u->info.w, u->info.h);
|
|
usurf_copy(&screen, nx, ny, ox, oy, u->info.w, u->info.h);
|
|
|
- /* Everything the old shadow rect covered outside the new window and
|
|
|
|
|
- * its shadow. The new ring is repainted below, so cutting it out here
|
|
|
|
|
- * also keeps its falloff from being darkened twice. */
|
|
|
|
|
- np = rect_sub(pieces, &old_sh, &new_sh);
|
|
|
|
|
|
|
+ else
|
|
|
|
|
+ draw_rect(nx, ny, u->info.w, u->info.h);
|
|
|
|
|
+ oldr.x = ox;
|
|
|
|
|
+ oldr.y = oy;
|
|
|
|
|
+ oldr.w = u->info.w;
|
|
|
|
|
+ oldr.h = u->info.h;
|
|
|
|
|
+ newr.x = nx;
|
|
|
|
|
+ newr.y = ny;
|
|
|
|
|
+ newr.w = u->info.w;
|
|
|
|
|
+ newr.h = u->info.h;
|
|
|
|
|
+ np = rect_sub(pieces, &oldr, &newr);
|
|
|
for (k = 0; k < np; k++)
|
|
for (k = 0; k < np; k++)
|
|
|
draw_rect(pieces[k].x, pieces[k].y, pieces[k].w, pieces[k].h);
|
|
draw_rect(pieces[k].x, pieces[k].y, pieces[k].w, pieces[k].h);
|
|
|
- if (old_on && new_on) {
|
|
|
|
|
- /* Only the ring around the new position; its interior is the
|
|
|
|
|
- * copied window block. */
|
|
|
|
|
- np = rect_sub(pieces, &new_sh, &new_win);
|
|
|
|
|
- for (k = 0; k < np; k++)
|
|
|
|
|
- draw_rect(pieces[k].x, pieces[k].y,
|
|
|
|
|
- pieces[k].w, pieces[k].h);
|
|
|
|
|
- } else {
|
|
|
|
|
- draw_rect(new_sh.x, new_sh.y, new_sh.w, new_sh.h);
|
|
|
|
|
- }
|
|
|
|
|
present.count = 0;
|
|
present.count = 0;
|
|
|
present.immediate = 1;
|
|
present.immediate = 1;
|
|
|
- /* Present the union of the old and new shadow rectangles as one
|
|
|
|
|
- * rect. The screen shadow is correct for all of it, and one rect
|
|
|
|
|
- * cannot be cut off by the kernel's four-entry present list. */
|
|
|
|
|
|
|
+ /* Present the union of the old and new rectangles as one rect.
|
|
|
|
|
+ * The shadow is correct for all of it, and one rect cannot be cut
|
|
|
|
|
+ * off by the kernel's four-entry present list. */
|
|
|
{
|
|
{
|
|
|
- int ux0 = old_sh.x < new_sh.x ? old_sh.x : new_sh.x;
|
|
|
|
|
- int uy0 = old_sh.y < new_sh.y ? old_sh.y : new_sh.y;
|
|
|
|
|
- int ox1 = old_sh.x + (int)old_sh.w;
|
|
|
|
|
- int oy1 = old_sh.y + (int)old_sh.h;
|
|
|
|
|
- int nx1 = new_sh.x + (int)new_sh.w;
|
|
|
|
|
- int ny1 = new_sh.y + (int)new_sh.h;
|
|
|
|
|
- int ux1 = ox1 > nx1 ? ox1 : nx1;
|
|
|
|
|
- int uy1 = oy1 > ny1 ? oy1 : ny1;
|
|
|
|
|
|
|
+ int ux0 = ox < nx ? ox : nx;
|
|
|
|
|
+ int uy0 = oy < ny ? oy : ny;
|
|
|
|
|
+ int ux1 = (ox > nx ? ox : nx) + (int)u->info.w;
|
|
|
|
|
+ int uy1 = (oy > ny ? oy : ny) + (int)u->info.h;
|
|
|
|
|
|
|
|
add_rect(&present, ux0, uy0, (unsigned int)(ux1 - ux0),
|
|
add_rect(&present, ux0, uy0, (unsigned int)(ux1 - ux0),
|
|
|
(unsigned int)(uy1 - uy0));
|
|
(unsigned int)(uy1 - uy0));
|
|
@@ -1756,29 +1624,22 @@ static int iabs(int v)
|
|
|
return v < 0 ? -v : v;
|
|
return v < 0 ? -v : v;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* Repaint the old and new rectangles of a geometry change. The old rect
|
|
|
|
|
- * is cut by the new one and the new rect drawn last, so a pixel in the
|
|
|
|
|
- * overlap gets its window and shadow exactly once. */
|
|
|
|
|
|
|
+/* Repaint the old and new rectangles of a geometry change. */
|
|
|
static void redraw_geom(struct uwin *u, int ox, int oy,
|
|
static void redraw_geom(struct uwin *u, int ox, int oy,
|
|
|
unsigned int ow, unsigned int oh)
|
|
unsigned int ow, unsigned int oh)
|
|
|
{
|
|
{
|
|
|
struct wm_present_info present;
|
|
struct wm_present_info present;
|
|
|
- struct orect oldr, newr, pieces[4];
|
|
|
|
|
- unsigned int i, np;
|
|
|
|
|
|
|
+ unsigned int i;
|
|
|
|
|
|
|
|
- window_shadow_rect(&oldr, ox, oy, ow, oh);
|
|
|
|
|
- window_shadow_rect(&newr, u->info.x, u->info.y, u->info.w, u->info.h);
|
|
|
|
|
present.count = 0;
|
|
present.count = 0;
|
|
|
present.immediate = 1;
|
|
present.immediate = 1;
|
|
|
- add_rect(&present, oldr.x, oldr.y, oldr.w, oldr.h);
|
|
|
|
|
- add_rect(&present, newr.x, newr.y, newr.w, newr.h);
|
|
|
|
|
|
|
+ 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) {
|
|
if (u_wm_begin() == 0) {
|
|
|
remap_window_contents();
|
|
remap_window_contents();
|
|
|
- np = rect_sub(pieces, &oldr, &newr);
|
|
|
|
|
- for (i = 0; i < np; i++)
|
|
|
|
|
- draw_rect(pieces[i].x, pieces[i].y,
|
|
|
|
|
- pieces[i].w, pieces[i].h);
|
|
|
|
|
- draw_rect(newr.x, newr.y, newr.w, newr.h);
|
|
|
|
|
|
|
+ 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);
|
|
|
wm_overlays(&present);
|
|
wm_overlays(&present);
|
|
|
u_wm_present(&present);
|
|
u_wm_present(&present);
|
|
|
}
|
|
}
|
|
@@ -3514,8 +3375,7 @@ static void handle_mouse(struct wm_status *st)
|
|
|
clamp_geom(u, &nx, &ny);
|
|
clamp_geom(u, &nx, &ny);
|
|
|
if (nx != ox || ny != oy) {
|
|
if (nx != ox || ny != oy) {
|
|
|
struct wm_present_info present;
|
|
struct wm_present_info present;
|
|
|
- struct orect oldr, newr, pieces[4];
|
|
|
|
|
- unsigned int i, np;
|
|
|
|
|
|
|
+ unsigned int i;
|
|
|
|
|
|
|
|
u_wm_set_geom((unsigned int)drag_id,
|
|
u_wm_set_geom((unsigned int)drag_id,
|
|
|
nx, ny);
|
|
nx, ny);
|
|
@@ -3525,33 +3385,21 @@ static void handle_mouse(struct wm_status *st)
|
|
|
move_window_pixels(u, ox, oy,
|
|
move_window_pixels(u, ox, oy,
|
|
|
nx, ny);
|
|
nx, ny);
|
|
|
} else {
|
|
} else {
|
|
|
- window_shadow_rect(&oldr, ox, oy,
|
|
|
|
|
- u->info.w,
|
|
|
|
|
- u->info.h);
|
|
|
|
|
- window_shadow_rect(&newr, nx, ny,
|
|
|
|
|
- u->info.w,
|
|
|
|
|
- u->info.h);
|
|
|
|
|
present.count = 0;
|
|
present.count = 0;
|
|
|
present.immediate = 1;
|
|
present.immediate = 1;
|
|
|
- add_rect(&present, oldr.x,
|
|
|
|
|
- oldr.y, oldr.w,
|
|
|
|
|
- oldr.h);
|
|
|
|
|
- add_rect(&present, newr.x,
|
|
|
|
|
- newr.y, newr.w,
|
|
|
|
|
- newr.h);
|
|
|
|
|
|
|
+ add_rect(&present, ox, oy,
|
|
|
|
|
+ u->info.w, u->info.h);
|
|
|
|
|
+ add_rect(&present, nx, ny,
|
|
|
|
|
+ u->info.w, u->info.h);
|
|
|
if (u_wm_begin() == 0) {
|
|
if (u_wm_begin() == 0) {
|
|
|
remap_window_contents();
|
|
remap_window_contents();
|
|
|
- np = rect_sub(pieces,
|
|
|
|
|
- &oldr,
|
|
|
|
|
- &newr);
|
|
|
|
|
- for (i = 0; i < np; i++)
|
|
|
|
|
|
|
+ for (i = 0;
|
|
|
|
|
+ i < present.count; i++)
|
|
|
draw_rect(
|
|
draw_rect(
|
|
|
- pieces[i].x,
|
|
|
|
|
- pieces[i].y,
|
|
|
|
|
- pieces[i].w,
|
|
|
|
|
- pieces[i].h);
|
|
|
|
|
- draw_rect(newr.x, newr.y,
|
|
|
|
|
- newr.w, newr.h);
|
|
|
|
|
|
|
+ present.rect[i].x,
|
|
|
|
|
+ present.rect[i].y,
|
|
|
|
|
+ present.rect[i].w,
|
|
|
|
|
+ present.rect[i].h);
|
|
|
wm_overlays(&present);
|
|
wm_overlays(&present);
|
|
|
u_wm_present(&present);
|
|
u_wm_present(&present);
|
|
|
}
|
|
}
|
|
@@ -3667,15 +3515,13 @@ void _start(const char *arg)
|
|
|
if (u_wm_poll(&st) != 0)
|
|
if (u_wm_poll(&st) != 0)
|
|
|
u_exit(1);
|
|
u_exit(1);
|
|
|
if (!prefs_seen_valid || st.prefs_seq != prefs_seq_seen) {
|
|
if (!prefs_seen_valid || st.prefs_seq != prefs_seq_seen) {
|
|
|
- unsigned int old_shadow = (unsigned int)shadow_px;
|
|
|
|
|
unsigned int old_bg = desktop_rgb;
|
|
unsigned int old_bg = desktop_rgb;
|
|
|
|
|
|
|
|
prefs = st.prefs;
|
|
prefs = st.prefs;
|
|
|
prefs_seq_seen = st.prefs_seq;
|
|
prefs_seq_seen = st.prefs_seq;
|
|
|
prefs_seen_valid = 1;
|
|
prefs_seen_valid = 1;
|
|
|
apply_prefs();
|
|
apply_prefs();
|
|
|
- if (old_shadow != (unsigned int)shadow_px ||
|
|
|
|
|
- old_bg != desktop_rgb)
|
|
|
|
|
|
|
+ if (old_bg != desktop_rgb)
|
|
|
full_redraw = 1;
|
|
full_redraw = 1;
|
|
|
}
|
|
}
|
|
|
if (!settings_req_seen_valid) {
|
|
if (!settings_req_seen_valid) {
|