Browse Source

Merge branch 'release/1.10.x'

rdb 6 years ago
parent
commit
9565d99fab

+ 11 - 0
direct/src/dist/FreezeTool.py

@@ -2372,6 +2372,17 @@ class PandaModuleFinder(modulefinder.ModuleFinder):
 
             path = self.path
 
+            if fullname == 'distutils' and hasattr(sys, 'real_prefix'):
+                # The PyPI version of virtualenv inserts a special version of
+                # distutils that does some bizarre stuff that won't work in our
+                # deployed application.  Force it to find the regular one.
+                try:
+                    fp, fn, stuff = self.find_module('opcode')
+                    if fn:
+                        path = [os.path.dirname(fn)] + path
+                except ImportError:
+                    pass
+
         # Look for the module on the search path.
         for dir_path in path:
             basename = os.path.join(dir_path, name.split('.')[-1])

+ 4 - 0
direct/src/showbase/ShowBase.py

@@ -3049,6 +3049,10 @@ class ShowBase(DirectObject.DirectObject):
 
         init_app_for_gui()
 
+        # Disable the Windows message loop, since Tcl wants to handle this all
+        # on its own.
+        ConfigVariableBool('disable-message-loop', False).value = True
+
         if ConfigVariableBool('tk-main-loop', True):
             # Put Tkinter in charge of the main loop.  It really
             # seems to like this better; the GUI otherwise becomes

+ 9 - 7
dtool/src/parser-inc/stdtypedefs.h

@@ -27,16 +27,18 @@ typedef unsigned long ulong;
 typedef unsigned short ushort;
 typedef unsigned char uchar;
 
-inline namespace std {
 #ifdef _WIN64
-  typedef unsigned long long size_t;
-  typedef long long ssize_t;
-  typedef long long ptrdiff_t;
+#define __SIZE_TYPE__ unsigned long long
+#define __PTRDIFF_TYPE__ long long
 #else
-  typedef unsigned long size_t;
-  typedef long ssize_t;
-  typedef long ptrdiff_t;
+#define __SIZE_TYPE__ unsigned long
+#define __PTRDIFF_TYPE__ long
 #endif
+
+inline namespace std {
+  typedef __SIZE_TYPE__ size_t;
+  typedef __PTRDIFF_TYPE__ ssize_t;
+  typedef __PTRDIFF_TYPE__ ptrdiff_t;
 }
 
 struct timeval;

+ 4 - 1
makepanda/makepanda.py

@@ -614,8 +614,11 @@ if (COMPILER == "MSVC"):
             suffix = "-2_2"
         elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_3.lib"):
             suffix = "-2_3"
+        elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_4.lib"):
+            suffix = "-2_4"
+            LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath" + suffix + ".lib")
         if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + "_s.lib"):
-            suffix += "_s"
+            suffix += "_s"  # _s suffix observed for OpenEXR 2.3 only so far
         LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
         LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
         LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")

+ 2 - 0
makepanda/makepandacore.py

@@ -2479,6 +2479,8 @@ def SdkLocateAndroid():
         return
 
     # Allow ANDROID_API/ANDROID_ABI to be used in makepanda.py.
+    if ANDROID_API is None:
+        SetTarget('android')
     api = ANDROID_API
     SDK["ANDROID_API"] = api
 

+ 5 - 0
panda/src/cocoadisplay/cocoaGraphicsWindow.mm

@@ -551,6 +551,11 @@ open_window() {
     _parent_window_handle->attach_child(_window_handle);
   }
 
+  // Always disable application HiDPI support, Cocoa will do the eventual upscaling for us.
+  // Note: setWantsBestResolutionOpenGLSurface method is supported from MacOS 10.7 onwards
+  if ([_view respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) {
+    [_view setWantsBestResolutionOpenGLSurface:NO];
+  }
   if (_properties.has_icon_filename()) {
     NSImage *image = load_image(_properties.get_icon_filename());
     if (image != nil) {

+ 7 - 5
panda/src/device/ioKitInputDevice.cxx

@@ -116,12 +116,14 @@ IOKitInputDevice(IOHIDDeviceRef device) :
   }
 
   CFArrayRef elements = IOHIDDeviceCopyMatchingElements(device, nullptr, 0);
-  CFIndex count = CFArrayGetCount(elements);
-  for (CFIndex i = 0; i < count; ++i) {
-    IOHIDElementRef element = (IOHIDElementRef)CFArrayGetValueAtIndex(elements, i);
-    parse_element(element);
+  if (elements) {
+    CFIndex count = CFArrayGetCount(elements);
+    for (CFIndex i = 0; i < count; ++i) {
+      IOHIDElementRef element = (IOHIDElementRef)CFArrayGetValueAtIndex(elements, i);
+      parse_element(element);
+    }
+    CFRelease(elements);
   }
-  CFRelease(elements);
 
   if (_hat_element != nullptr) {
     _hat_left_button = (int)_buttons.size();

+ 7 - 0
panda/src/windisplay/config_windisplay.cxx

@@ -91,6 +91,13 @@ ConfigVariableBool paste_emit_keystrokes
  PRC_DESC("Handle paste events (Ctrl-V) as separate keystroke events for each "
           "pasted character."));
 
+ConfigVariableBool disable_message_loop
+("disable-message-loop", false,
+ PRC_DESC("If this is false, Panda will process messages from the Windows "
+          "message loop, which is required for normal operation.  You may set "
+          "this to true if some other UI framework (such as Tcl/Tk) needs "
+          "exclusive ownership of the message loop."));
+
 /**
  * Initializes the library.  This must be called at least once before any of
  * the functions or classes in this library can be used.  Normally it will be

+ 1 - 0
panda/src/windisplay/config_windisplay.h

@@ -32,6 +32,7 @@ extern ConfigVariableBool request_dxdisplay_information;
 extern ConfigVariableBool dpi_aware;
 extern ConfigVariableBool dpi_window_resize;
 extern ConfigVariableBool paste_emit_keystrokes;
+extern ConfigVariableBool disable_message_loop;
 
 extern EXPCL_PANDAWIN ConfigVariableBool swapbuffer_framelock;
 

+ 6 - 4
panda/src/windisplay/winGraphicsWindow.cxx

@@ -258,10 +258,12 @@ process_events() {
 
   MSG msg;
 
-  // Handle all the messages on the queue in a row.  Some of these might be
-  // for another window, but they will get dispatched appropriately.
-  while (PeekMessage(&msg, nullptr, 0, 0, PM_NOREMOVE)) {
-    process_1_event();
+  if (!disable_message_loop) {
+    // Handle all the messages on the queue in a row.  Some of these might be
+    // for another window, but they will get dispatched appropriately.
+    while (PeekMessage(&msg, nullptr, 0, 0, PM_NOREMOVE)) {
+      process_1_event();
+    }
   }
 }