Skip to content

Commit a32371e

Browse files
committed
blah, fixing another problem with fullscreen and dialogs
1 parent 1bb6ae5 commit a32371e

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

FlashpointSecurePlayer/Shared.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ public enum GW : uint {
244244
[DllImport("USER32.DLL", SetLastError = true)]
245245
public static extern IntPtr GetWindow(IntPtr hWnd, GW uCmd);
246246

247+
[DllImport("USER32.DLL")]
248+
[return: MarshalAs(UnmanagedType.Bool)]
249+
public static extern bool IsChild(IntPtr hWndParent, IntPtr hWnd);
250+
247251
[DllImport("USER32.DLL", SetLastError = true)]
248252
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
249253

FlashpointSecurePlayer/WebBrowserMode.cs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -580,13 +580,21 @@ private void WebBrowserMode_Deactivate(object sender, EventArgs e) {
580580
}
581581

582582
// another process opened a window
583-
if (!CanFocus) {
584-
if (foregroundWindow != IntPtr.Zero) {
585-
// if we own the foreground window
586-
if (Handle == GetWindow(foregroundWindow, GW.GW_OWNER)) {
587-
// the new window is a dialog that prevents focus to this window
588-
return;
583+
if (foregroundWindow != IntPtr.Zero) {
584+
// if we own the foreground window
585+
if (Handle == GetWindow(foregroundWindow, GW.GW_OWNER)) {
586+
// the new window is owned by this window
587+
if (CanFocus) {
588+
// the new window is not a dialog that prevents focus to this window
589+
Fullscreen = false;
589590
}
591+
return;
592+
}
593+
594+
if (IsChild(Handle, foregroundWindow)) {
595+
// the new window is a child of this window
596+
Fullscreen = false;
597+
return;
590598
}
591599
}
592600

0 commit comments

Comments
 (0)