Skip to content

Commit

Permalink
Make sure that BORDER always fits into desktop's WORK area
Browse files Browse the repository at this point in the history
Since the window WORK area is calculated arbitrarily (not from
WC_BORDER), there's no guarantee that its BORDER area doesn't exceed
desktop's WORK area.

Fixes #10.
  • Loading branch information
mikrosk committed Jun 19, 2024
1 parent 2a26ee0 commit 7a0fb9e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,15 @@ static void get_work(WINDOWP w, GRECT *new, short mode)
new->g_w = MIN_WIDTH;
if (new->g_h < MIN_HEIGHT)
new->g_h = MIN_HEIGHT;

if (new->g_x < gl_desk.g_x)
new->g_x = gl_desk.g_x;
if (new->g_y < gl_desk.g_y)
new->g_y = gl_desk.g_y;
if (new->g_w > gl_desk.g_w)
new->g_w = gl_desk.g_w;
if (new->g_h > gl_desk.g_h)
new->g_h = gl_desk.g_h;
}

wind_calc_grect(WC_WORK, w->kind, new, new);
Expand Down

0 comments on commit 7a0fb9e

Please sign in to comment.