summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-11-09 12:38:53 -0500
committerKristian Høgsberg <krh@bitplanet.net>2011-11-09 12:40:08 -0500
commit46770139bceabb48ae0c2842f7f66d64fef26b6f (patch)
treebbacce3adf12451f465d26005bb7257c2824782c
parent32e24cc628eb8705099e392425c500ac36204379 (diff)
shell: Set initial toplevel position in map callback
-rw-r--r--compositor/shell.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/compositor/shell.c b/compositor/shell.c
index e012482..c44ebca 100644
--- a/compositor/shell.c
+++ b/compositor/shell.c
@@ -263,17 +263,10 @@ shell_set_toplevel(struct wl_client *client,
{
struct wlsc_surface *es = surface_resource->data;
- struct wlsc_compositor *ec = es->compositor;
if (es->map_type == WLSC_SURFACE_MAP_FULLSCREEN) {
es->x = es->saved_x;
es->y = es->saved_y;
- } else if (es->map_type == WLSC_SURFACE_MAP_UNMAPPED) {
- es->x = 10 + random() % 400;
- es->y = 10 + random() % 400;
- /* assign to first output */
- es->output = container_of(ec->output_list.next,
- struct wlsc_output, link);
}
wlsc_surface_damage(es);
@@ -934,6 +927,11 @@ map(struct wlsc_shell *base,
else
wl_list_insert(&shell->panel->link, &surface->link);
+ if (surface->map_type == WLSC_SURFACE_MAP_TOPLEVEL) {
+ surface->x = 10 + random() % 400;
+ surface->y = 10 + random() % 400;
+ }
+
wlsc_surface_configure(surface, surface->x, surface->y, width, height);
}