Prechádzať zdrojové kódy

allow set_foreground to be requested

David Rose 20 rokov pred
rodič
commit
77204cbe3e
1 zmenil súbory, kde vykonal 11 pridanie a 0 odobranie
  1. 11 0
      panda/src/windisplay/winGraphicsWindow.cxx

+ 11 - 0
panda/src/windisplay/winGraphicsWindow.cxx

@@ -297,6 +297,17 @@ set_properties_now(WindowProperties &properties) {
     
     properties.clear_z_order();
   }
+
+  if (properties.has_foreground() && properties.get_foreground()) {
+    if (!SetForegroundWindow(_hWnd)) {
+      windisplay_cat.warning()
+        << "SetForegroundWindow() failed!\n";
+    } else {
+      _properties.set_foreground(true);
+    }
+
+    properties.clear_foreground();
+  }
 }