[PATCH weston client window] Fixed the input region of the popup menu
Kristian Høgsberg
hoegsberg at gmail.com
Wed Jun 18 17:12:40 PDT 2014
On Mon, Jun 02, 2014 at 01:53:38PM +0200, Tomek Obrebski wrote:
> Changed the input region of the menu popup window to exclude the shadow and border regions and set to frame's internal region only.
This is a good patch but there are a few stylistic issues. First, the
commit message is usually written in present tense, ie what the patch
*does* not what you did. Also the body should be wrapped at around 72
columns.
>
> Regards,
> blsd
>
> ---
> clients/window.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/clients/window.c b/clients/window.c
> index b82a93e..9a6e8be 100644
> --- a/clients/window.c
> +++ b/clients/window.c
> @@ -4615,7 +4615,8 @@ window_show_menu(struct display *display,
> {
> struct menu *menu;
> struct window *window;
> - int32_t ix, iy;
> + struct wl_region *input_region;
> + int32_t ix, iy, ih, iw;
We use 8-space tabs for indent, as you can see right here in the patch, the
indention of the lines you added don't match the indention of the lines
already there.
Other than the stylistic issues, the patch is good and fixes the problem.
Kristian
>
> menu = create_menu(display, input, time, func, entries, count, parent);
>
> @@ -4630,7 +4631,11 @@ window_show_menu(struct display *display,
> window->x = x;
> window->y = y;
>
> - frame_interior(menu->frame, &ix, &iy, NULL, NULL);
> + frame_interior(menu->frame, &ix, &iy, &iw, &ih);
> + input_region = wl_compositor_create_region(display->compositor);
> + wl_region_add(input_region, ix, iy, iw, ih);
> + wl_surface_set_input_region(window->main_surface->surface, input_region);
> + wl_region_destroy(input_region);
>
> window->xdg_popup = xdg_shell_get_xdg_popup(display->xdg_shell,
> window->main_surface->surface,
> --
> 1.9.1
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list