diff options
| author | Vito Caputo <vcaputo@pengaru.com> | 2022-04-14 13:56:24 -0700 | 
|---|---|---|
| committer | Vito Caputo <vcaputo@pengaru.com> | 2022-04-14 15:12:34 -0700 | 
| commit | 3301f0286b3dfa184c7abad534f6fcd888efb6a8 (patch) | |
| tree | ad76cb7c05ffd72f34ca02739815ba49efd1844a | |
| parent | f29bc4f4a3f2d316113263731962b783fff8690d (diff) | |
gtk_fb: set default vs. requested fb window size
Instead of requesting the size= dimensions on the fb area/image,
set the containing window's default size.  This plays better with
the window manager and allows the user to go smaller if desired.
| -rw-r--r-- | src/gtk_fb.c | 3 | 
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gtk_fb.c b/src/gtk_fb.c index 3faad8f..a9db8e6 100644 --- a/src/gtk_fb.c +++ b/src/gtk_fb.c @@ -105,6 +105,8 @@ static int gtk_fb_init(const til_settings_t *settings, void **res_context)  		sscanf(size, "%u%*[xX]%u", &c->width, &c->height);  	c->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); +	if (c->width && c->height) +		gtk_window_set_default_size(GTK_WINDOW(c->window), c->width, c->height);  	gtk_widget_realize(c->window);  	g_signal_connect(c->window, "delete-event", G_CALLBACK(deleted), c); @@ -167,7 +169,6 @@ static int gtk_fb_acquire(til_fb_t *fb, void *context, void *page)  	c->area = gtk_drawing_area_new();  	/* XXX: copy from p->surface to c->area */ -	gtk_widget_set_size_request(c->area, c->width, c->height);  	g_signal_connect_after(c->area, "size-allocate", G_CALLBACK(resized), c);  	g_signal_connect(c->area, "draw", G_CALLBACK(draw_cb), fb);  	gtk_widget_add_tick_callback(c->area, queue_draw_cb, c, NULL);  | 
