Commits

thecoshman committed 13fccc0

Added support for borderless windows on Linux

  • Participants
  • Parent commits be1e3d8

Comments (0)

Files changed (2)

File src/linux/template_visitors.hpp

 #include <boost/variant.hpp>
 
 namespace glskel { namespace detail { namespace linux {
+    struct window_hints {
+        unsigned long   flags, functions, decorations, status;
+        long            inputMode;
+    };
     struct intermediate_template {
         bool fullscreen;
-        /*DWORD*/ unsigned int window_styles, extended_styles;
+//        /*DWORD*/ unsigned int window_styles, extended_styles;
         unsigned x, y, width, height;
-        unsigned bpp, refresh;
+//        unsigned bpp, refresh;
+        window_hints hints;
     };
 
     struct mode_visitor : boost::static_visitor<> {
 
         void operator()(const glskel::borderless& mode) const {
 //            template_.window_styles = WS_POPUP;
+            template_.hints.flags = 2; // Specify that we're changing the window decorations
+            template_.hints.decorations = 0;  // 0 (false) means that window decorations should go bye-bye
             template_.width         = mode.width;
             template_.height        = mode.height;
         }

File src/linux/window_factory_impl.cpp

         );
         GLSKEL_THROW_IF(!window, "Could not create a window.");
 
+        if(int_template.hints.flags != 0){
+            Atom property = XInternAtom(display,"_MOTIF_WM_HINTS",True);
+            GLSKEL_THROW_IF(!property, "Could not removes borders from window.");
+
+            XChangeProperty(display, window, property, property, 32, PropModeReplace, (unsigned char *)&int_template.hints, 5);
+        }
+
         XStoreName(display, window, template_.title.c_str());
         XMapWindow(display, window);