Re: [PATCH weston] xwm: place transient windows at the right position

2013-09-11 Thread Kristian Høgsberg
On Wed, Sep 11, 2013 at 03:41:58PM +0200, Giulio Camuffo wrote:
> ---
>  src/xwayland/window-manager.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

That makes sense, thanks.

Kristian

> diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
> index a8b949b..4c7256e 100644
> --- a/src/xwayland/window-manager.c
> +++ b/src/xwayland/window-manager.c
> @@ -967,7 +967,7 @@ weston_wm_handle_property_notify(struct weston_wm *wm, 
> xcb_generic_event_t *even
>  
>  static void
>  weston_wm_window_create(struct weston_wm *wm,
> - xcb_window_t id, int width, int height, int override)
> + xcb_window_t id, int width, int height, int x, int y, 
> int override)
>  {
>   struct weston_wm_window *window;
>   uint32_t values[1];
> @@ -991,6 +991,8 @@ weston_wm_window_create(struct weston_wm *wm,
>   window->override_redirect = override;
>   window->width = width;
>   window->height = height;
> + window->x = x;
> + window->y = y;
>  
>   geometry_reply = xcb_get_geometry_reply(wm->conn, geometry_cookie, 
> NULL);
>   /* technically we should use XRender and check the visual format's
> @@ -1026,6 +1028,7 @@ weston_wm_handle_create_notify(struct weston_wm *wm, 
> xcb_generic_event_t *event)
>  
>   weston_wm_window_create(wm, create_notify->window,
>   create_notify->width, create_notify->height,
> + create_notify->x, create_notify->y,
>   create_notify->override_redirect);
>  }
>  
> @@ -1062,6 +1065,7 @@ weston_wm_handle_reparent_notify(struct weston_wm *wm, 
> xcb_generic_event_t *even
>  
>   if (reparent_notify->parent == wm->screen->root) {
>   weston_wm_window_create(wm, reparent_notify->window, 10, 10,
> + reparent_notify->x, reparent_notify->y,
>   reparent_notify->override_redirect);
>   } else if (!our_resource(wm, reparent_notify->parent)) {
>   window = hash_table_lookup(wm->window_hash,
> @@ -1916,7 +1920,7 @@ xserver_map_shell_surface(struct weston_wm *wm,
>   
> WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
>   0, NULL);
>   return;
> - } else if (!window->override_redirect) {
> + } else if (!window->override_redirect && !window->transient_for) {
>   shell_interface->set_toplevel(window->shsurf);
>   return;
>   } else {
> -- 
> 1.8.4
> 
> ___
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston] xwm: place transient windows at the right position

2013-09-11 Thread Giulio Camuffo
---
 src/xwayland/window-manager.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index a8b949b..4c7256e 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -967,7 +967,7 @@ weston_wm_handle_property_notify(struct weston_wm *wm, 
xcb_generic_event_t *even
 
 static void
 weston_wm_window_create(struct weston_wm *wm,
-   xcb_window_t id, int width, int height, int override)
+   xcb_window_t id, int width, int height, int x, int y, 
int override)
 {
struct weston_wm_window *window;
uint32_t values[1];
@@ -991,6 +991,8 @@ weston_wm_window_create(struct weston_wm *wm,
window->override_redirect = override;
window->width = width;
window->height = height;
+   window->x = x;
+   window->y = y;
 
geometry_reply = xcb_get_geometry_reply(wm->conn, geometry_cookie, 
NULL);
/* technically we should use XRender and check the visual format's
@@ -1026,6 +1028,7 @@ weston_wm_handle_create_notify(struct weston_wm *wm, 
xcb_generic_event_t *event)
 
weston_wm_window_create(wm, create_notify->window,
create_notify->width, create_notify->height,
+   create_notify->x, create_notify->y,
create_notify->override_redirect);
 }
 
@@ -1062,6 +1065,7 @@ weston_wm_handle_reparent_notify(struct weston_wm *wm, 
xcb_generic_event_t *even
 
if (reparent_notify->parent == wm->screen->root) {
weston_wm_window_create(wm, reparent_notify->window, 10, 10,
+   reparent_notify->x, reparent_notify->y,
reparent_notify->override_redirect);
} else if (!our_resource(wm, reparent_notify->parent)) {
window = hash_table_lookup(wm->window_hash,
@@ -1916,7 +1920,7 @@ xserver_map_shell_surface(struct weston_wm *wm,

WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
0, NULL);
return;
-   } else if (!window->override_redirect) {
+   } else if (!window->override_redirect && !window->transient_for) {
shell_interface->set_toplevel(window->shsurf);
return;
} else {
-- 
1.8.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel