Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
BitchX
GitHub Repository: BitchX/BitchX1.3
Path: blob/master/source/X.c
1069 views
1
#include <X11/X.h>
2
#include <X11/Xlib.h>
3
#include <gdk/gdkx.h>
4
#include <gtk/gtk.h>
5
#include <zvt/zvtterm.h>
6
7
void size_allocate (GtkWidget *widget, GtkWindow *window)
8
{
9
ZvtTerm *term;
10
XSizeHints sizehints;
11
12
g_assert (widget != NULL);
13
term = ZVT_TERM (widget);
14
15
/* Not sure why it is x3 and x2.... klass shows as 2x2 and the variation is 6x4 */
16
sizehints.base_width =
17
(GTK_WIDGET (window)->allocation.width) +
18
(GTK_WIDGET (term)->style->klass->xthickness * 3) -
19
(GTK_WIDGET (term)->allocation.width);
20
21
sizehints.base_height =
22
(GTK_WIDGET (window)->allocation.height) +
23
(GTK_WIDGET (term)->style->klass->ythickness * 2) -
24
(GTK_WIDGET (term)->allocation.height);
25
26
sizehints.width_inc = term->charwidth;
27
sizehints.height_inc = term->charheight;
28
sizehints.min_width = sizehints.base_width + (sizehints.width_inc * 20);
29
sizehints.min_height = sizehints.base_height + (sizehints.height_inc * 5);
30
31
sizehints.flags = (PBaseSize|PMinSize|PResizeInc);
32
33
XSetWMNormalHints (GDK_DISPLAY(),
34
GDK_WINDOW_XWINDOW (GTK_WIDGET (window)->window),
35
&sizehints);
36
gdk_flush ();
37
}
38
39