diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-02-04 13:41:03 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-02-04 13:41:03 +0100 |
commit | 86350be559f87027ece62c3b57bc2797e3391742 (patch) | |
tree | 95f0b4cb387562a41ae10bf7a1a4e52f14ebcd2c | |
parent | 7d18db8f4e97acf6d567c1d48a3537b28e1d13f1 (diff) |
wayland-window: use get_attached_size provided by wayland-egl
-rw-r--r-- | egl-wayland-window.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/egl-wayland-window.c b/egl-wayland-window.c index 67d6e9a..a726bc1 100644 --- a/egl-wayland-window.c +++ b/egl-wayland-window.c @@ -32,7 +32,6 @@ struct window { struct wl_egl_window *egl_window; int width, height; - int attached_width, attached_height; struct { EGLSurface surf; @@ -49,7 +48,7 @@ init_egl(struct display *display) EGL_RED_SIZE, 1, EGL_GREEN_SIZE, 1, EGL_BLUE_SIZE, 1, - //EGL_DEPTH_SIZE, 1, + EGL_DEPTH_SIZE, 1, EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, EGL_NONE }; @@ -80,7 +79,6 @@ create_egl_window(struct display *display, struct window *window) window->height, visual); - printf("surface: %p\n", window->surface); window->egl.surf = eglCreateWindowSurface(display->egl.dpy, display->egl.conf, (EGLNativeWindowType) window->egl_window, @@ -147,8 +145,6 @@ redraw(void *data, uint32_t time) glPopMatrix(); eglSwapBuffers(window->display->egl.dpy, window->egl.surf); - window->attached_width = window->width; - window->attached_height = window->height; wl_display_frame_callback(window->display->display, redraw, window); } @@ -174,16 +170,19 @@ handle_configure(void *data, struct wl_shell *shell, struct wl_surface *surface, int32_t width, int32_t height) { - struct display *d = data; struct window *window = wl_surface_get_user_data(surface); int dx = 0; int dy = 0; + int a_width, a_height; + + wl_egl_native_window_get_attached_size(window->egl_window, + &a_width, &a_height); if (edges & WINDOW_RESIZING_LEFT) - dx = window->attached_width - width; + dx = a_width - width; if (edges & WINDOW_RESIZING_TOP) - dy = window->attached_height - height; + dy = a_height - height; wl_egl_native_window_resize(window->egl_window, width, height, dx, dy); |