"mspgui",
"Window",
style,
- CW_USEDEFAULT, CW_USEDEFAULT,
+ (options.user_position ? options.x : CW_USEDEFAULT),
+ (options.user_position ? options.y : CW_USEDEFAULT),
rect.right-rect.left, rect.bottom-rect.top,
0,
0,
if(options.fullscreen)
SetWindowPos(priv->window, 0, 0, 0, rect.right-rect.left, rect.bottom-rect.top, SWP_NOZORDER);
+ else if(options.user_position)
+ SetWindowPos(priv->window, 0, options.x, options.y, rect.right-rect.left, rect.bottom-rect.top, SWP_NOZORDER);
else
SetWindowPos(priv->window, 0, 0, 0, rect.right-rect.left, rect.bottom-rect.top, SWP_NOMOVE|SWP_NOZORDER);
}
case WM_MOVE:
options.x = static_cast<short>(LOWORD(evnt.lparam));
options.y = static_cast<short>(HIWORD(evnt.lparam));
+ moving = false;
signal_move.emit(options.x, options.y);
break;
case WM_CLOSE:
priv->window = XCreateWindow(dpy,
display.get_private().root_window,
- 0, 0,
+ 0, 0, // User position is set when the window is mapped
options.width, options.height,
0,
CopyFromParent,
if(options.fullscreen)
XMoveResizeWindow(dpy, priv->window, 0, 0, options.width, options.height);
+ else if(options.user_position)
+ XMoveResizeWindow(dpy, priv->window, options.x, options.y, options.width, options.height);
else
XResizeWindow(dpy, priv->window, options.width, options.height);
void Window::platform_show()
{
- XMapRaised(display.get_private().display, priv->window);
+ DisplayHandle dpy = display.get_private().display;
+ XMapRaised(dpy, priv->window);
+ if(options.user_position)
+ XMoveWindow(dpy, priv->window, options.x, options.y);
}
void Window::platform_hide()
y -= priv->rel_y;
}
- if(x!=options.x || y!=options.y)
+ if((x==options.x && y==options.y) == moving)
{
options.x = x;
options.y = y;
+ moving = false;
signal_move.emit(options.x, options.y);
}
}