summaryrefslogtreecommitdiffstats
path: root/window.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-12-08 12:59:37 -0500
committerKristian Høgsberg <krh@redhat.com>2008-12-08 12:59:37 -0500
commit1584c57edcbeb34a628afe12fd6e527fda8ec486 (patch)
tree3edc58e6d9512e2ca23d66b3c63fd89fdad253f6 /window.c
parent17809b1e4373ea9e3635d224c5ef1efda6889cfb (diff)
downloadwayland-1584c57edcbeb34a628afe12fd6e527fda8ec486.tar.gz
wayland-1584c57edcbeb34a628afe12fd6e527fda8ec486.tar.xz
wayland-1584c57edcbeb34a628afe12fd6e527fda8ec486.zip
Snap terminal size to an integer number of character cells.
Diffstat (limited to 'window.c')
-rw-r--r--window.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/window.c b/window.c
index 4f94c50..61f93f2 100644
--- a/window.c
+++ b/window.c
@@ -190,6 +190,7 @@ event_handler(struct wl_display *display,
uint32_t size, uint32_t *p, void *data)
{
struct window *window = data;
+ struct rectangle rectangle;
int location;
int grip_size = 16;
@@ -251,11 +252,15 @@ event_handler(struct wl_display *display,
if (window->height < window->minimum_height)
window->height = window->minimum_height;
+ window_get_child_rectangle(window, &rectangle);
if (window->resize_handler)
(*window->resize_handler)(window,
- window->width,
- window->height,
+ &rectangle,
window->user_data);
+
+ window->width = rectangle.width + 20;
+ window->height = rectangle.height + 60;
+
break;
}
} else if (opcode == 1) {