width(640),
height(480),
fullscreen(false),
+ fullscreen_monitor(0),
+ fullscreen_exclusive(true),
resizable(false)
{ }
void Window::set_fullscreen_mode()
{
+ if(!options.fullscreen_monitor)
+ options.fullscreen_monitor = display.get_desktop_mode().monitor;
VideoMode mode(options.width, options.height);
- mode.rotation = display.get_desktop_mode().monitor->desktop_settings.rotation;
+ mode.monitor = options.fullscreen_monitor;
+ mode.rotation = mode.monitor->desktop_settings.rotation;
if(mode.rotation==ROTATE_LEFT || mode.rotation==ROTATE_RIGHT)
swap(mode.width, mode.height);
- display.set_mode(mode, true);
+ display.set_mode(mode, options.fullscreen_exclusive);
}
void Window::set_keyboard_autorepeat(bool r)
XSetWMNormalHints(dpy, priv->window, &hints);
if(options.fullscreen)
- XMoveResizeWindow(dpy, priv->window, 0, 0, options.width, options.height);
+ {
+ if(options.fullscreen_exclusive)
+ XMoveResizeWindow(dpy, priv->window, 0, 0, options.width, options.height);
+ else
+ {
+ const Monitor::Settings &ms = options.fullscreen_monitor->current_settings;
+ XMoveResizeWindow(dpy, priv->window, ms.x, ms.y, options.width, options.height);
+ }
+ }
else if(options.user_position)
XMoveResizeWindow(dpy, priv->window, options.x, options.y, options.width, options.height);
else
XSetInputFocus(display.get_private().display, priv->window, RevertToParent, CurrentTime);
break;
case MapNotify:
- if(options.fullscreen)
+ if(options.fullscreen && options.fullscreen_exclusive)
XGrabPointer(display.get_private().display, priv->window, true, None, GrabModeAsync, GrabModeAsync, priv->window, None, CurrentTime);
break;
case Expose: