Skip to content

Commit 1bb6ae5

Browse files
committed
fix minor bug with fullscreen and dialog windows
1 parent ded4058 commit 1bb6ae5

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

FlashpointSecurePlayer/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
// You can specify all the values or you can default the Build and Revision Numbers
3434
// by using the '*' as shown below:
3535
// [assembly: AssemblyVersion("1.0.*")]
36-
[assembly: AssemblyVersion("2.1.1.0")]
37-
[assembly: AssemblyFileVersion("2.1.1.0")]
36+
[assembly: AssemblyVersion("2.1.2.0")]
37+
[assembly: AssemblyFileVersion("2.1.2.0")]
3838
[assembly: NeutralResourcesLanguage("en")]
3939

FlashpointSecurePlayer/WebBrowserMode.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,11 @@ private void WebBrowserMode_Deactivate(object sender, EventArgs e) {
555555
Application.RemoveMessageFilter(messageFilter);
556556

557557
if (Fullscreen) {
558+
IntPtr foregroundWindow = GetForegroundWindow();
559+
558560
// we are the active window, because we are only now deactivating
559561
// if this process has the foreground window, it'll be the active window
560-
if (Handle == GetForegroundWindow()) {
562+
if (Handle == foregroundWindow) {
561563
// this process opened a new window
562564
if (!CanFocus) {
563565
// if there is a window above us in the z-order
@@ -578,6 +580,16 @@ private void WebBrowserMode_Deactivate(object sender, EventArgs e) {
578580
}
579581

580582
// 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;
589+
}
590+
}
591+
}
592+
581593
WindowState = FormWindowState.Minimized;
582594
}
583595
}

0 commit comments

Comments
 (0)