summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2014-05-02 10:14:07 -0400
committerKristian Høgsberg <krh@bitplanet.net>2014-05-12 23:34:05 -0700
commit851799e791ceb72a1f9c36f20fe44108c90ce8df (patch)
treed16ee7459e8d4cf7643f30c5e5e1d3ed59cbeae9
parent9aa8ce69853863d69c0363662b90c918a0b9225a (diff)
shell: Make margin double-buffered state that's applied on commit
-rw-r--r--desktop-shell/shell.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 591d8321..dd0b2f98 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -172,7 +172,8 @@ struct shell_surface {
struct {
int left, right, top, bottom;
- } margin;
+ } margin, next_margin;
+ bool has_next_margin;
int focus_count;
};
@@ -2126,10 +2127,11 @@ static void
set_margin(struct shell_surface *shsurf,
int32_t left, int32_t right, int32_t top, int32_t bottom)
{
- shsurf->margin.left = left;
- shsurf->margin.right = right;
- shsurf->margin.top = top;
- shsurf->margin.bottom = bottom;
+ shsurf->next_margin.left = left;
+ shsurf->next_margin.right = right;
+ shsurf->next_margin.top = top;
+ shsurf->next_margin.bottom = bottom;
+ shsurf->has_next_margin = true;
}
static void
@@ -5120,6 +5122,11 @@ shell_surface_configure(struct weston_surface *es, int32_t sx, int32_t sy)
if (es->width == 0)
return;
+ if (shsurf->has_next_margin) {
+ shsurf->margin = shsurf->next_margin;
+ shsurf->has_next_margin = false;
+ }
+
if (shsurf->state_changed) {
set_surface_type(shsurf);
type_changed = 1;