예제 #1
0
 /// <inheritdoc />
 /// <exception cref="ObjectDisposedException"><see cref="IsEnabled" /> was <c>true</c> but the instance has already been disposed.</exception>
 public override void Disable()
 {
     if (IsEnabled)
     {
         var wmHints = new XWMHints {
             flags = InputHint,
             input = False
         };
         _ = XSetWMHints(XlibDispatchProvider.Instance.Display, Handle, &wmHints);
     }
 }
예제 #2
0
 /// <inheritdoc />
 /// <exception cref="ExternalException">The call to <see cref="XGetWMHints(IntPtr, nuint)" /> failed.</exception>
 /// <exception cref="ObjectDisposedException"><see cref="IsEnabled" /> was <c>false</c> but the instance has already been disposed.</exception>
 public override void Enable()
 {
     if (!IsEnabled)
     {
         var wmHints = new XWMHints {
             flags = InputHint,
             input = True
         };
         _ = XSetWMHints(XlibDispatchService.Instance.Display, Handle, &wmHints);
     }
 }
예제 #3
0
        public static void ShowWindow(IntPtr display, nuint window, int initialState = NormalState)
        {
            var wmHints = new XWMHints {
                flags         = StateHint,
                initial_state = initialState,
            };

            _ = XSetWMHints(display, window, &wmHints);

            _ = XMapWindow(display, window);
        }
예제 #4
0
        /// <inheritdoc />
        /// <exception cref="ExternalException">The call to <see cref="XGetWMHints(IntPtr, nuint)" /> failed.</exception>
        /// <exception cref="ObjectDisposedException"><see cref="IsEnabled" /> was <c>false</c> but the instance has already been disposed.</exception>
        public override void Enable()
        {
            if (_isEnabled == false)
            {
                var wmHints = new XWMHints {
                    flags = InputHint,
                    input = True
                };

                _          = XSetWMHints(XlibDispatchProvider.Instance.Display, Handle, &wmHints);
                _isEnabled = true;
            }
        }
예제 #5
0
        /// <summary>Disables the instance.</summary>
        /// <exception cref="ObjectDisposedException"><see cref="IsEnabled" /> was <c>true</c> but the instance has already been disposed.</exception>
        public void Disable()
        {
            if (_isEnabled)
            {
                var wmHints = new XWMHints {
                    flags = (IntPtr)InputHint,
                    input = False
                };

                _          = XSetWMHints(DispatchProvider.Instance.Display, Handle, &wmHints);
                _isEnabled = false;
            }
        }
예제 #6
0
        /// <inheritdoc />
        /// <exception cref="ObjectDisposedException"><see cref="WindowState" /> was not <see cref="WindowState.Normal" /> but the instance has already been disposed.</exception>
        public override void Restore()
        {
            var windowState = _windowState;

            if (windowState != WindowState.Normal)
            {
                var dispatchService = XlibDispatchService.Instance;
                var display         = dispatchService.Display;
                var window          = Handle;

                if (windowState == WindowState.Minimized)
                {
                    _           = XUnmapWindow(display, window);
                    windowState = WindowState.Hidden;
                }

                if (windowState == WindowState.Hidden)
                {
                    var wmHints = new XWMHints {
                        flags         = StateHint,
                        initial_state = NormalState,
                    };
                    _ = XSetWMHints(display, window, &wmHints);

                    _ = XMapWindow(display, window);
                }

                if (dispatchService.GetAtomIsSupported(_NET_WM_STATE_MAXIMIZED_HORZ) && dispatchService.GetAtomIsSupported(_NET_WM_STATE_MAXIMIZED_VERT))
                {
                    SendClientMessage(
                        display,
                        dispatchService.DefaultRootWindow,
                        SubstructureNotifyMask | SubstructureRedirectMask,
                        window,
                        dispatchService.GetAtom(_NET_WM_STATE),
                        _NET_WM_STATE_REMOVE,
                        (nint)dispatchService.GetAtom(_NET_WM_STATE_MAXIMIZED_HORZ),
                        (nint)dispatchService.GetAtom(_NET_WM_STATE_MAXIMIZED_VERT),
                        SourceApplication
                        );
                }
                else
                {
                    throw new NotImplementedException();
                }
            }
        }
예제 #7
0
 public static extern void XSetWMHints(IntPtr display, IntPtr window, ref XWMHints wmhints);
예제 #8
0
 internal extern static void XSetWMHints(IntPtr display, IntPtr window, ref XWMHints wmhints);
예제 #9
0
 public static extern void XSetWMHints(Display display, Window w, ref XWMHints wmhints);
예제 #10
0
파일: Glx.cs 프로젝트: MagmaiKH/OpenGL.Net
		public extern static void XSetWMHints(IntPtr display, IntPtr window, ref XWMHints wmhints);
예제 #11
0
파일: lib.cs 프로젝트: RoseLeBlood/libral
 extern public static int XSetWMHints(IntPtr display, IntPtr w, ref XWMHints wmhints);