예제 #1
0
        public static Size GetWindowSize(IntPtr window)
        {
#if LINUX
            XSizeHints size_hints = new XSizeHints();
            XGetWMNormalHints(display, window, ref size_hints, out IntPtr supplied_return);
            return(new Size(size_hints.width, size_hints.height));
#else
            throw new NotImplementedException();
#endif
        }
예제 #2
0
        public static Point GetWindowPosition(IntPtr window)
        {
#if LINUX
            XSizeHints size_hints = new XSizeHints();
            XGetWMNormalHints(display, window, ref size_hints, out IntPtr supplied_return);
            return(new Point(size_hints.x, size_hints.y));
#else
            throw new NotImplementedException();
#endif
        }
        public RCode CreateWindowPane(VectorI2d vWindowPos, VectorI2d vWindowSize, bool bFullScreen)
        {
            display    = Xlib.XOpenDisplay(null);
            screen     = Xlib.XDefaultScreen(display);
            root       = Xlib.XRootWindow(display, screen);
            mainWindow = Xlib.XCreateSimpleWindow(
                display, root,
                vWindowPos.x, vWindowPos.y,
                (uint)vWindowSize.x, (uint)vWindowSize.y, 1,
                Xlib.XBlackPixel(display, screen), Xlib.XWhitePixel(display, screen));

            EventMask eventMask =
                // Keyboard
                EventMask.KeyPressMask | EventMask.KeyReleaseMask |
                // Mouse
                EventMask.PointerMotionMask | EventMask.ButtonPressMask | EventMask.ButtonReleaseMask |
                // Window
                EventMask.FocusChangeMask | EventMask.EnterWindowMask | EventMask.LeaveWindowMask;

            Xlib.XSelectInput(display, mainWindow, eventMask);
            Xlib.XMapWindow(display, mainWindow);

            // Disable windows re-sizing
            XSizeHints sizeHints = new XSizeHints()
            {
                flags      = XSizeHintsFlags.PMaxSize | XSizeHintsFlags.PMinSize,
                min_width  = vWindowSize.x,
                max_width  = vWindowSize.x,
                min_height = vWindowSize.y,
                max_height = vWindowSize.y
            };

            XlibExt.XSetWMNormalHints(display, mainWindow, ref sizeHints);

            // Setup delete message when the user closes the window
            deleteWindowMessage = XlibExt.XInternAtom(display, "WM_DELETE_WINDOW", false);
            XlibExt.XSetWMProtocols(display, mainWindow, new Atom[] { deleteWindowMessage }, 1);

            return(RCode.OK);
        }
예제 #4
0
        void UpdateSizeHints(PixelSize?preResize)
        {
            var min = _minMaxSize.minSize;
            var max = _minMaxSize.maxSize;

            if (!_canResize)
            {
                max = min = _realSize;
            }

            if (preResize.HasValue)
            {
                var desired = preResize.Value;
                max = new PixelSize(Math.Max(desired.Width, max.Width), Math.Max(desired.Height, max.Height));
                min = new PixelSize(Math.Min(desired.Width, min.Width), Math.Min(desired.Height, min.Height));
            }

            var hints = new XSizeHints
            {
                min_width  = min.Width,
                min_height = min.Height
            };

            hints.height_inc = hints.width_inc = 1;
            var flags = XSizeHintsFlags.PMinSize | XSizeHintsFlags.PResizeInc;

            // People might be passing double.MaxValue
            if (max.Width < 100000 && max.Height < 100000)
            {
                hints.max_width  = max.Width;
                hints.max_height = max.Height;
                flags           |= XSizeHintsFlags.PMaxSize;
            }

            hints.flags = (IntPtr)flags;

            XSetWMNormalHints(_x11.Display, _handle, ref hints);
        }
예제 #5
0
 public static extern void XSetZoomHints(IntPtr display, IntPtr window, ref XSizeHints hints);
예제 #6
0
 public static extern void XGetWMNormalHints(IntPtr display, IntPtr window, ref XSizeHints hints,
                                             out IntPtr supplied_return);
예제 #7
0
 public extern static void XSetWMNormalHints(IntPtr display, IntPtr window, ref XSizeHints hints);
예제 #8
0
파일: Glx.cs 프로젝트: MagmaiKH/OpenGL.Net
		public extern static void XSetZoomHints(IntPtr display, IntPtr window, ref XSizeHints hints);
예제 #9
0
파일: Glx.cs 프로젝트: MagmaiKH/OpenGL.Net
		public extern static void XGetWMNormalHints(IntPtr display, IntPtr window, ref XSizeHints hints, out IntPtr supplied_return);
예제 #10
0
 internal extern static void XSetZoomHints(IntPtr display, IntPtr window, ref XSizeHints hints);
예제 #11
0
 internal static extern void XSetWMNormalHints(PDISPLAY display, WINDOW window, ref XSizeHints hints);
예제 #12
0
 internal static extern int XGetWMNormalHints(PDISPLAY display, WINDOW window, out XSizeHints hints, out LONG supplied_return);
예제 #13
0
 public static unsafe extern void XSetWMNormalHints(IntPtr display, IntPtr w, XSizeHints* hints);