Initial import of the ircii-pana-1.1-final source tree.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/tags/ircii-pana-1.1-final@1 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
37
source/X.c
Normal file
37
source/X.c
Normal file
@@ -0,0 +1,37 @@
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <zvt/zvtterm.h>
|
||||
|
||||
void size_allocate (GtkWidget *widget, GtkWindow *window)
|
||||
{
|
||||
ZvtTerm *term;
|
||||
XSizeHints sizehints;
|
||||
|
||||
g_assert (widget != NULL);
|
||||
term = ZVT_TERM (widget);
|
||||
|
||||
/* Not sure why it is x3 and x2.... klass shows as 2x2 and the variation is 6x4 */
|
||||
sizehints.base_width =
|
||||
(GTK_WIDGET (window)->allocation.width) +
|
||||
(GTK_WIDGET (term)->style->klass->xthickness * 3) -
|
||||
(GTK_WIDGET (term)->allocation.width);
|
||||
|
||||
sizehints.base_height =
|
||||
(GTK_WIDGET (window)->allocation.height) +
|
||||
(GTK_WIDGET (term)->style->klass->ythickness * 2) -
|
||||
(GTK_WIDGET (term)->allocation.height);
|
||||
|
||||
sizehints.width_inc = term->charwidth;
|
||||
sizehints.height_inc = term->charheight;
|
||||
sizehints.min_width = sizehints.base_width + (sizehints.width_inc * 20);
|
||||
sizehints.min_height = sizehints.base_height + (sizehints.height_inc * 5);
|
||||
|
||||
sizehints.flags = (PBaseSize|PMinSize|PResizeInc);
|
||||
|
||||
XSetWMNormalHints (GDK_DISPLAY(),
|
||||
GDK_WINDOW_XWINDOW (GTK_WIDGET (window)->window),
|
||||
&sizehints);
|
||||
gdk_flush ();
|
||||
}
|
||||
Reference in New Issue
Block a user