Bug 1861709 replace AudioCallbackDriver::ThreadRunning() assertions that mean to...
[gecko.git] / widget / windows / nsWindowTaskbarConcealer.h
blob84567fc857c3f6224702a898fb8bd4902ad1cf96
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef WIDGET_WINDOWS_NSWINDOWTASKBARCONCEALER_H_
7 #define WIDGET_WINDOWS_NSWINDOWTASKBARCONCEALER_H_
9 #include "nsWindow.h"
10 #include "mozilla/Maybe.h"
12 /**
13 * nsWindow::TaskbarConcealer
15 * Fullscreen-state (and, thus, taskbar-occlusion) manager.
17 class nsWindow::TaskbarConcealer {
18 public:
19 // To be called when a window acquires focus. (Note that no action need be
20 // taken when focus is lost.)
21 static void OnFocusAcquired(nsWindow* aWin);
23 // To be called during or after a window's destruction. The corresponding
24 // nsWindow pointer is not needed, and will not be acquired or accessed.
25 static void OnWindowDestroyed(HWND aWnd);
27 // To be called when the Gecko-fullscreen state of a window changes.
28 static void OnFullscreenChanged(nsWindow* aWin, bool enteredFullscreen);
30 // To be called when the position of a window changes. (Performs its own
31 // batching; irrelevant movements will be cheap.)
32 static void OnWindowPosChanged(nsWindow* aWin);
34 // To be called when the cloaking state of any window changes. (Expects that
35 // all windows' internal cloaking-state mirror variables are up-to-date.)
36 static void OnCloakChanged();
38 // To be called upon receipt of MOZ_WM_FULLSCREEN_STATE_UPDATE.
39 static void OnAsyncStateUpdateRequest(HWND);
41 private:
42 static void UpdateAllState(HWND destroyedHwnd = nullptr);
44 struct WindowState {
45 HMONITOR monitor;
46 bool isGkFullscreen;
48 static mozilla::Maybe<WindowState> GetWindowState(HWND);
50 static nsTHashMap<HWND, HMONITOR> sKnownWindows;
53 #endif // WIDGET_WINDOWS_NSWINDOWTASKBARCONCEALER_H_