struct WindowOptions
{
+ int x;
+ int y;
unsigned width;
unsigned height;
bool fullscreen;
objects instead. */
sigc::signal<void, const Event &> signal_input_event;
+ sigc::signal<void, int, int> signal_move;
sigc::signal<void, unsigned, unsigned> signal_resize;
sigc::signal<void, unsigned, unsigned, unsigned, unsigned, const Event &> signal_expose;
sigc::signal<void> signal_close;
resizing = false;
signal_resize.emit(options.width, options.height);
break;
+ case WM_MOVE:
+ options.x = static_cast<short>(LOWORD(evnt.lparam));
+ options.y = static_cast<short>(HIWORD(evnt.lparam));
+ signal_move.emit(options.x, options.y);
+ break;
case WM_CLOSE:
signal_close.emit();
break;
priv->wm_delete_window = XInternAtom(dpy, "WM_DELETE_WINDOW", true);
priv->invisible_cursor = 0;
+ priv->reparented = false;
+ priv->rel_x = 0;
+ priv->rel_y = 0;
XSetWindowAttributes attr;
attr.override_redirect = options.fullscreen;
resizing = false;
signal_resize.emit(options.width, options.height);
}
+
+ {
+ int x = ev.xconfigure.x;
+ int y = ev.xconfigure.y;
+
+ if(priv->reparented)
+ {
+ if(!ev.xconfigure.send_event)
+ {
+ /* If the window manager reparented us, the coordinates of a
+ real event are in the parent window's space. */
+ priv->rel_x = ev.xconfigure.x;
+ priv->rel_y = ev.xconfigure.y;
+
+ const Display::Private &dpy_priv = display.get_private();
+ WindowHandle dummy;
+ XTranslateCoordinates(dpy_priv.display, priv->window, dpy_priv.root_window, 0, 0, &x, &y, &dummy);
+ }
+
+ // Use the coordinates of the window manager frame
+ x -= priv->rel_x;
+ y -= priv->rel_y;
+ }
+
+ if(x!=options.x || y!=options.y)
+ {
+ options.x = x;
+ options.y = y;
+ signal_move.emit(options.x, options.y);
+ }
+ }
+
+ break;
+ case ReparentNotify:
+ priv->reparented = (ev.xreparent.parent!=display.get_private().root_window);
+ if(!priv->reparented)
+ {
+ priv->rel_x = 0;
+ priv->rel_y = 0;
+ }
break;
case ClientMessage:
if(ev.xclient.data.l[0]==static_cast<long>(priv->wm_delete_window))