示例#1
0
        public IWindowInfo UpdateWindowInfo()
        {
            WindowInfo?.Dispose();

            WindowInfo = Utilities.CreateMacOSWindowInfo(Window.Handle, Handle);

            WindowInfoUpdated?.Invoke(this, EventArgs.Empty);

            return(WindowInfo);
        }
        public IWindowInfo UpdateWindowInfo(GraphicsMode mode)
        {
            WindowInfo?.Dispose();

            WindowInfo = Utilities.CreateWindowsWindowInfo(Handle);

            WindowInfoUpdated?.Invoke(this, EventArgs.Empty);

            return(WindowInfo);
        }
示例#3
0
        public IWindowInfo UpdateWindowInfo(GraphicsMode mode)
        {
            WindowInfo?.Dispose();

            IntPtr display = X11Interop.gdk_x11_display_get_xdisplay(Display.Handle);
            int    screen  = X11Interop.gdk_x11_screen_get_screen_number(Screen.Handle);

            IntPtr visualInfo;

            if (mode.Index.HasValue)
            {
                var template = new X11Interop.XVisualInfo {
                    VisualID = mode.Index.Value
                };

                visualInfo = X11Interop.XGetVisualInfo(display, (IntPtr)(int)X11Interop.XVisualInfoMask.ID, ref template, out _);
            }
            else
            {
                visualInfo = X11Interop.GetVisualInfo(display, screen);
            }

            WindowInfo = Utilities.CreateX11WindowInfo(
                display,
                screen,
#if GTK3
                X11Interop.gdk_x11_window_get_xid(Window.Handle),
                X11Interop.gdk_x11_window_get_xid(Screen.RootWindow.Handle),
#else
                X11Interop.gdk_x11_drawable_get_xid(GdkWindow.Handle),
                X11Interop.gdk_x11_drawable_get_xid(RootWindow.Handle),
#endif
                visualInfo);

            X11Interop.XFree(visualInfo);

            WindowInfoUpdated?.Invoke(this, EventArgs.Empty);

            return(WindowInfo);
        }