Пример #1
0
        internal override void OnStateChanged(GdkWindowState changed_mask, GdkWindowState new_window_state)
        {
            var windowState = new_window_state.HasFlag(GdkWindowState.Iconified) ? WindowState.Minimized
                : (new_window_state.HasFlag(GdkWindowState.Maximized) ? WindowState.Maximized : WindowState.Normal);

            if (windowState != _lastWindowState)
            {
                _lastWindowState = windowState;
                WindowStateChanged?.Invoke(windowState);
            }

            base.OnStateChanged(changed_mask, new_window_state);
        }
Пример #2
0
 internal virtual void OnStateChanged(GdkWindowState changed_mask, GdkWindowState new_window_state)
 {
     if (changed_mask.HasFlag(GdkWindowState.Focused))
     {
         if (new_window_state.HasFlag(GdkWindowState.Focused))
         {
             Activated?.Invoke();
         }
         else
         {
             Deactivated?.Invoke();
         }
     }
 }