]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/x11/window.cpp
Use nullptr in place of 0 or NULL
[libs/gui.git] / source / graphics / x11 / window.cpp
index 32744deb0178a3dc5684b1786c298d8cb3281ae1..96d098551b561861254e65c2d1a59d6ba8ee0cdf 100644 (file)
@@ -1,10 +1,10 @@
+#include "window.h"
+#include "window_private.h"
 #include <vector>
 #include <X11/Xatom.h>
 #include <X11/Xutil.h>
 #include <msp/core/systemerror.h>
 #include "display_private.h"
-#include "window.h"
-#include "window_private.h"
 
 using namespace std;
 
@@ -25,10 +25,6 @@ void Window::platform_init()
        DisplayHandle dpy = display.get_private().display;
 
        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;
@@ -60,8 +56,8 @@ void Window::platform_init()
        {
                XSizeHints hints;
                hints.flags = PMinSize|PMaxSize;
-               hints.min_width=hints.max_width = options.width;
-               hints.min_height=hints.max_height = options.height;
+               hints.min_width = hints.max_width = options.width;
+               hints.min_height = hints.max_height = options.height;
                XSetWMNormalHints(dpy, priv->window, &hints);
        }
 }
@@ -152,7 +148,7 @@ void Window::show_cursor(bool s)
                        int screen = DefaultScreen(dpy);
 
                        Pixmap pm = XCreatePixmap(dpy, priv->window, 1, 1, 1);
-                       GC gc = XCreateGC(dpy, pm, 0, 0);
+                       GC gc = XCreateGC(dpy, pm, 0, nullptr);
                        XSetFunction(dpy, gc, GXclear);
                        XDrawPoint(dpy, pm, gc, 0, 0);
                        XFreeGC(dpy, gc);
@@ -182,7 +178,7 @@ void Window::platform_show()
 {
        DisplayHandle dpy = display.get_private().display;
        XMapRaised(dpy, priv->window);
-       if(options.user_position)
+       if(options.user_position && !options.fullscreen)
                XMoveWindow(dpy, priv->window, options.x, options.y);
 }