sigc::signal<void, const Event &> signal_input_event;
sigc::signal<void, unsigned, unsigned> signal_resize;
+ sigc::signal<void, unsigned, unsigned, unsigned, unsigned, const Event &> signal_expose;
sigc::signal<void> signal_close;
protected:
case WM_CLOSE:
signal_close.emit();
break;
+ case WM_PAINT:
+ {
+ RECT update_rect;
+ GetUpdateRect(priv->window, &update_rect, false);
+ unsigned width = update_rect.right-update_rect.left;
+ unsigned height = update_rect.bottom-update_rect.top;
+ signal_expose.emit(update_rect.left, update_rect.top, width, height, evnt);
+ }
+ break;
default:
return false;
}
XSetWindowAttributes attr;
attr.override_redirect = options.fullscreen;
- attr.event_mask = ButtonPressMask|ButtonReleaseMask|PointerMotionMask|KeyPressMask|KeyReleaseMask|StructureNotifyMask|EnterWindowMask;
+ attr.event_mask = ButtonPressMask|ButtonReleaseMask|PointerMotionMask|KeyPressMask|KeyReleaseMask|StructureNotifyMask|EnterWindowMask|ExposureMask;
priv->window = XCreateWindow(dpy,
DefaultRootWindow(dpy),
if(options.fullscreen)
XGrabPointer(display.get_private().display, priv->window, true, None, GrabModeAsync, GrabModeAsync, priv->window, None, CurrentTime);
break;
+ case Expose:
+ signal_expose.emit(ev.xexpose.x, ev.xexpose.y, ev.xexpose.width, ev.xexpose.height, evnt);
+ break;
default:
return false;
}