XSetErrorHandler(x_error_handler);
+ priv->root_window = DefaultRootWindow(priv->display);
+
err_dialog = new ErrorDialog(this);
#ifdef WITH_XRANDR
XRRQueryVersion(priv->display, &major, &minor);
if(major>1 || (major==1 && minor>=2))
{
- WindowHandle root = DefaultRootWindow(priv->display);
- XRRScreenResources *res = XRRGetScreenResources(priv->display, root);
- RROutput primary = XRRGetOutputPrimary(priv->display, root);
+ XRRScreenResources *res = XRRGetScreenResources(priv->display, priv->root_window);
+ RROutput primary = XRRGetOutputPrimary(priv->display, priv->root_window);
map<RRMode, XRRModeInfo *> modes_by_id;
for(int i=0; i<res->nmode; ++i)
if(requested_rotation==ROTATE_ANY)
requested_rotation = mode->monitor->desktop_rotation;
- WindowHandle root = DefaultRootWindow(priv->display);
- XRRScreenResources *res = XRRGetScreenResources(priv->display, root);
+ XRRScreenResources *res = XRRGetScreenResources(priv->display, priv->root_window);
RROutput output = priv->monitors[mode->monitor->index];
XRROutputInfo *output_info = XRRGetOutputInfo(priv->display, res, output);
#ifdef WITH_XRANDR
#include <X11/extensions/Xrandr.h>
#endif
+#include "window_private.h"
namespace Msp {
namespace Graphics {
struct PlatformDisplayPrivate
{
+ WindowHandle root_window;
#ifdef WITH_XRANDR
std::vector<RROutput> monitors;
std::vector<RRMode> modes;
attr.event_mask = ButtonPressMask|ButtonReleaseMask|PointerMotionMask|KeyPressMask|KeyReleaseMask|StructureNotifyMask|EnterWindowMask|ExposureMask;
priv->window = XCreateWindow(dpy,
- DefaultRootWindow(dpy),
+ display.get_private().root_window,
0, 0,
options.width, options.height,
0,