window: Dont take width and height in window constructor
Always set this by scheduling an initial resize.
diff --git a/clients/window.c b/clients/window.c
index 2613b3c..bb17b8a 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -2271,8 +2271,7 @@
}
static struct window *
-window_create_internal(struct display *display, struct window *parent,
- int32_t width, int32_t height)
+window_create_internal(struct display *display, struct window *parent)
{
struct window *window;
@@ -2291,8 +2290,8 @@
}
window->allocation.x = 0;
window->allocation.y = 0;
- window->allocation.width = width;
- window->allocation.height = height;
+ window->allocation.width = 0;
+ window->allocation.height = 0;
window->saved_allocation = window->allocation;
window->transparent = 1;
@@ -2319,11 +2318,11 @@
}
struct window *
-window_create(struct display *display, int32_t width, int32_t height)
+window_create(struct display *display)
{
struct window *window;
- window = window_create_internal(display, NULL, width, height);
+ window = window_create_internal(display, NULL);
if (!window)
return NULL;
@@ -2332,12 +2331,11 @@
struct window *
window_create_transient(struct display *display, struct window *parent,
- int32_t x, int32_t y, int32_t width, int32_t height)
+ int32_t x, int32_t y)
{
struct window *window;
- window = window_create_internal(parent->display,
- parent, width, height);
+ window = window_create_internal(parent->display, parent);
if (!window)
return NULL;
@@ -2468,8 +2466,7 @@
if (!menu)
return;
- window = window_create_internal(parent->display, parent,
- 200, count * 20 + margin * 2);
+ window = window_create_internal(parent->display, parent);
if (!window)
return;
@@ -2497,7 +2494,7 @@
widget_set_button_handler(menu->widget, menu_button_handler);
input_grab(input, menu->widget, 0);
- window_schedule_redraw(window);
+ window_schedule_resize(window, 200, count * 20 + margin * 2);
}
void