diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-04-26 15:36:26 +0200 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2011-04-26 11:18:57 -0400 |
commit | 0b5116f74607dd0159d4cb701988172b0cb9a90a (patch) | |
tree | f0bf8ab18bd0aafb4e1e1708122c0cc4d5ebf747 | |
parent | e5b3b2601c67408a093c8ba14d5258c465caf2eb (diff) |
compositor: Recalculate fullscreen surface x,y in surface_attach
-rw-r--r-- | compositor/compositor.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/compositor/compositor.c b/compositor/compositor.c index c3c7de8..df25407 100644 --- a/compositor/compositor.c +++ b/compositor/compositor.c @@ -926,8 +926,16 @@ surface_attach(struct wl_client *client, wlsc_buffer_attach(buffer, surface); es->buffer = buffer; - es->x += x; - es->y += y; + switch (es->map_type) { + case WLSC_SURFACE_MAP_FULLSCREEN: + es->x = (es->fullscreen_output->width - es->width) / 2; + es->y = (es->fullscreen_output->height - es->height) / 2; + break; + default: + es->x += x; + es->y += y; + break; + } es->width = buffer->width; es->height = buffer->height; if (x != 0 || y != 0) |