diff options
author | Jan Arne Petersen <jpetersen@openismus.com> | 2013-04-18 16:47:29 +0200 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-05-02 16:41:47 -0400 |
commit | 7cd29e199ac3fca57c84be021c36f9019cfa7b92 (patch) | |
tree | b163ebe4da5d819cd44be6903ba0b8acf127d28a /src | |
parent | 14da96bf81b5fdf720698b633de2a742c4f644dd (diff) |
text: Add output argument to set_toplevel
Allow to specify an output for a toplevel input panel surface.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/shell.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/shell.c b/src/shell.c index 281e2f5..fd9e9a8 100644 --- a/src/shell.c +++ b/src/shell.c @@ -79,6 +79,7 @@ struct input_panel_surface { struct weston_surface *surface; struct wl_listener surface_destroy_listener; + struct weston_output *output; uint32_t panel; }; @@ -3056,9 +3057,8 @@ show_input_panels(struct wl_listener *listener, void *data) wl_list_for_each_safe(surface, next, &shell->input_panel.surfaces, link) { ws = surface->surface; - if (!weston_surface_is_mapped(ws)) { + if (!ws->buffer_ref.buffer) continue; - } wl_list_insert(&shell->input_panel_layer.surface_list, &ws->layer_link); weston_surface_geometry_dirty(ws); @@ -3526,31 +3526,29 @@ input_panel_configure(struct weston_surface *surface, int32_t sx, int32_t sy, in if (!shell->showing_input_panels) return; - wl_list_insert(&shell->input_panel_layer.surface_list, - &surface->layer_link); - weston_surface_geometry_dirty(surface); - weston_surface_update_transform(surface); show_surface = 1; } - mode = surface->output->current; + fprintf(stderr, "%s panel: %d, output: %p\n", __FUNCTION__, ip_surface->panel, ip_surface->output); if (ip_surface->panel) { x = shell->text_input.surface->geometry.x + shell->text_input.cursor_rectangle.x2; y = shell->text_input.surface->geometry.y + shell->text_input.cursor_rectangle.y2; } else { - x = surface->output->x + (mode->width - width) / 2; - y = surface->output->y + mode->height - height; - } + mode = ip_surface->output->current; - /* Don't map the input panel here, wait for - * show_input_panels signal. */ + x = ip_surface->output->x + (mode->width - width) / 2; + y = ip_surface->output->y + mode->height - height; + } weston_surface_configure(surface, x, y, width, height); if (show_surface) { + wl_list_insert(&shell->input_panel_layer.surface_list, + &surface->layer_link); + weston_surface_update_transform(surface); weston_surface_damage(surface); weston_slide_run(surface, surface->geometry.height, 0, NULL, NULL); } @@ -3622,6 +3620,7 @@ create_input_panel_surface(struct desktop_shell *shell, static void input_panel_surface_set_toplevel(struct wl_client *client, struct wl_resource *resource, + struct wl_resource *output_resource, uint32_t position) { struct input_panel_surface *input_panel_surface = resource->data; @@ -3630,7 +3629,12 @@ input_panel_surface_set_toplevel(struct wl_client *client, wl_list_insert(&shell->input_panel.surfaces, &input_panel_surface->link); + input_panel_surface->output = output_resource->data; input_panel_surface->panel = 0; + + fprintf(stderr, "%s panel: %d, output: %p\n", __FUNCTION__, + input_panel_surface->panel, + input_panel_surface->output); } static void |