sub configure {
my ($self) = @_;
- my $tabheight = $self->int_bwidth + $self->fheight + $self->lineSpace;
-
$self->{cur}->XMoveResizeWindow (
$self->{cur}->parent,
- 0, $tabheight,
- $self->width, $self->height - $tabheight
+ 0, $self->{tabheight},
+ $self->width, $self->height - $self->{tabheight}
);
}
$self->configure;
- for my $atom ($tab->XListProperties) {
- warn "$atom\n";
+ my $wm_normal_hints = $self->XInternAtom ("WM_NORMAL_HINTS");
+
+ for my $atom ($tab->XListProperties ($tab->parent)) {
+ my ($type, $format, $items) = $self->XGetWindowProperty ($tab->parent, $atom);
+
+ if ($atom == $wm_normal_hints) {
+ my (@hints) = unpack "l!*", $items;
+ $hints[ 4] += $self->{tabheight};
+ $hints[16] += $self->{tabheight};
+ $items = pack "l!*", @hints;
+ }
+ $self->XChangeWindowProperty ($self->parent, $atom, $type, $format, $items);
}
$tab->XMapWindow ($tab->parent);
sub on_start {
my ($self) = @_;
+ $self->{tabheight} = $self->int_bwidth + $self->fheight + $self->lineSpace;
+
$self->cmd_parse ("\x1b[?25l\x1b[?7l");
$self->new_tab;
$self->new_tab;
unsigned long nitems;
unsigned long bytes_after;
unsigned char *prop;
+
XGetWindowProperty (THIS->display->display, window, property,
- 0, 1<<30, 0, AnyPropertyType,
+ 0, 1<<24, 0, AnyPropertyType,
&type, &format, &nitems, &bytes_after, &prop);
+
if (type != None)
{
+ int elemsize = format == 16 ? sizeof (short)
+ : format == 32 ? sizeof (long)
+ : 1;
+
EXTEND (SP, 3);
PUSHs (newSVuv ((U32)type));
PUSHs (newSViv (format));
- PUSHs (newSVpvn ((char *)prop, nitems * format / 8));
+ PUSHs (newSVpvn ((char *)prop, nitems * elemsize));
XFree (prop);
}
}
STRLEN len;
char *data_ = SvPVbyte (data, len);
+ int elemsize = format == 16 ? sizeof (short)
+ : format == 32 ? sizeof (long)
+ : 1;
+
XChangeProperty (THIS->display->display, window, property,
type, format, PropModeReplace,
- (unsigned char *)data, len * 8 / format);
+ (unsigned char *)data_, len / elemsize);
+ XSync (THIS->display->display, 0);
}
+Atom
+XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE)
+ C_ARGS: term->display->display, atom_name, only_if_exists
+
+char *
+XGetAtomName (rxvt_term *term, Atom atom)
+ C_ARGS: term->display->display, atom
+ CLEANUP:
+ XFree (RETVAL);
+
void
XDeleteProperty (rxvt_term *term, Window window, Atom property)
C_ARGS: term->display->display, window, property
OUTPUT:
RETVAL
+#if 0
+
Window
XCreateSimpleWindow (rxvt_term *term, Window parent, int x, int y, unsigned int width, unsigned int height)
C_ARGS: term->display->display, (Window)parent,
term->pix_colors_focused[Color_border],
term->pix_colors_focused[Color_border]
+#endif
+
void
XReparentWindow (rxvt_term *term, Window window, Window parent, int x = 0, int y = 0)
C_ARGS: term->display->display, window, parent, x, y