_stretchable_horz(false), _texture(0), _bg_pixmap(0), _bg_pixel(0),
_bcolor(0), _bwidth(0), _rect(0, 0, 1, 1), _screen(parent->screen()),
_fixed_width(false), _fixed_height(false),
+ _event_mask(ButtonPressMask | ButtonReleaseMask | ButtonMotionMask |
+ ExposureMask | StructureNotifyMask),
_surface(0),
_event_dispatcher(parent->eventDispatcher())
{
_stretchable_vert(false), _stretchable_horz(false), _texture(0),
_bg_pixmap(0), _bg_pixel(0), _bcolor(0), _bwidth(0), _rect(0, 0, 1, 1),
_screen(style->screen()), _fixed_width(false), _fixed_height(false),
+ _event_mask(ButtonPressMask | ButtonReleaseMask | ButtonMotionMask |
+ ExposureMask | StructureNotifyMask),
_surface(0),
_event_dispatcher(event_dispatcher)
{
attrib_create.background_pixmap = None;
attrib_create.colormap = scr_info->colormap();
- attrib_create.event_mask = ButtonPressMask | ButtonReleaseMask |
- ButtonMotionMask | ExposureMask | StructureNotifyMask;
+ attrib_create.event_mask = _event_mask;
if (override_redirect) {
create_mask |= CWOverrideRedirect;
_ignore_config++;
}
+void Widget::setEventMask(long e)
+{
+ XSelectInput(**display, _window, e);
+ _event_mask = e;
+}
+
void Widget::setWidth(int w)
{
assert(w > 0);
void Widget::render(void)
{
- if (!_texture) return;
+ if (!_texture) {
+ XSetWindowBackgroundPixmap(**display, _window, ParentRelative);
+ return;
+ }
Surface *s = _surface; // save the current surface
(*str_it)->setHeight(str_height > _bevel_width ?
str_height - _bevel_width : _bevel_width);
}
+ if (stretchable.size() > 0)
+ height = _rect.height();
Widget *prev_widget = 0;
inline RenderStyle *style(void) const { return _style; }
virtual void setStyle(RenderStyle *style);
+ inline long eventMask(void) const { return _event_mask; }
+ void setEventMask(long e);
+
inline EventDispatcher *eventDispatcher(void)
{ return _event_dispatcher; }
void setEventDispatcher(EventDispatcher *disp);
bool _fixed_width;
bool _fixed_height;
+ long _event_mask;
+
Surface *_surface;
EventDispatcher *_event_dispatcher;