Closed Bug 1647161 Opened 4 years ago Closed 2 years ago

Make Win32 nsWindow cloaking-aware on Windows 8+

Categories

(Core :: Widget: Win32, enhancement, P3)

Unspecified
Windows
enhancement

Tracking

()

RESOLVED FIXED
103 Branch
Performance Impact low
Tracking Status
firefox103 --- fixed

People

(Reporter: bugzilla, Assigned: rkraesig)

Details

(Keywords: perf, perf:resource-use, power)

Attachments

(1 file)

Cloaking is a new-ish (since Windows 8) feature of Windows that has DWM in cahoots with the Windows shell to hide and show windows. It works on top of existing, legacy visibility states, eg a window can have WS_VISIBLE and yet be cloaked, and thus invisible to the user. AFAICT, Virtual Desktops are implemented using cloaking.

We should support detection of cloaking so that Gecko is not mistakenly assuming that a given nsWindow is visible when it in fact it is not.

The blog post that I linked above tells you how to query for cloaking. From reading the source code of PowerToys' Fancy Zones, I also learned how to listen for cloaking events:

  • Call SetWinEventHook with your HWND, setting EVENT_OBJECT_CLOAKED as your eventMin and EVENT_OBJECT_UNCLOAKED as your eventMax. Your supplied callback will be invoked whenever the cloaking state changes.

Note that cloaking is not supported until Windows 8, so we should only look for it on appropriate platforms.

Whiteboard: [fxperf] → [qf]
Whiteboard: [qf] → [qf:p3:resource]
Performance Impact: --- → P3
Whiteboard: [qf:p3:resource]
Severity: -- → S3
Priority: -- → P3

Add a global hook and per-nsWindow handlers for cloaking events. Part of
a sequence of commits for bug 1732517.

(Other than caching the cloak-state in-process, these don't actually do
anything yet. User-visible functionality will be added in a following
commit.)

Assignee: nobody → rkraesig
Status: NEW → ASSIGNED
Pushed by nfay@mozilla.com:
https://hg.mozilla.org/mozilla-central/rev/cd2675132e57
[2/5] Add cloaking event listener  r=handyman,cmartin
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: