From d66135f4b8f25ec6bdbf7f7756ad2f6131ccf2f4 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 6 Aug 2015 14:35:12 +0200 Subject: [PATCH 1/5] Add ability to change window icon after window has already opened on Windows --- panda/src/windisplay/winGraphicsWindow.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/panda/src/windisplay/winGraphicsWindow.cxx b/panda/src/windisplay/winGraphicsWindow.cxx index a226dcde1b..0146f2f89c 100644 --- a/panda/src/windisplay/winGraphicsWindow.cxx +++ b/panda/src/windisplay/winGraphicsWindow.cxx @@ -284,6 +284,17 @@ set_properties_now(WindowProperties &properties) { properties.clear_title(); } + if (properties.has_icon_filename()) { + HICON icon = get_icon(properties.get_icon_filename()); + if (icon != 0) { + ::SendMessage(_hWnd, WM_SETICON, ICON_SMALL, (LPARAM)icon); + ::SendMessage(_hWnd, WM_SETICON, ICON_BIG, (LPARAM)icon); + + _properties.set_icon_filename(properties.get_icon_filename()); + properties.clear_icon_filename(); + } + } + if (properties.has_cursor_hidden()) { bool hide_cursor = properties.get_cursor_hidden(); _properties.set_cursor_hidden(hide_cursor); From 0e6092004dd327ca1488b3c8dd87892a06e4155d Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 6 Aug 2015 15:47:49 +0200 Subject: [PATCH 2/5] Fix perPlatform bug in pdeploy --- direct/src/p3d/DeploymentTools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/direct/src/p3d/DeploymentTools.py b/direct/src/p3d/DeploymentTools.py index 10677cd5d4..5bb3f3a159 100644 --- a/direct/src/p3d/DeploymentTools.py +++ b/direct/src/p3d/DeploymentTools.py @@ -73,7 +73,7 @@ class Standalone: self.tempDir = Filename.temporary("", self.basename, "") + "/" self.tempDir.makeDir() - self.host = HostInfo(PandaSystem.getPackageHostUrl(), appRunner = appRunner, hostDir = self.tempDir, asMirror = False) + self.host = HostInfo(PandaSystem.getPackageHostUrl(), appRunner = appRunner, hostDir = self.tempDir, asMirror = False, perPlatform = True) self.http = HTTPClient.getGlobalPtr() if not self.host.hasContentsFile: @@ -233,7 +233,7 @@ class PackageTree: if hostUrl in self.hosts: return self.hosts[hostUrl] - host = HostInfo(hostUrl, appRunner = appRunner, hostDir = self.hostDir, asMirror = False) + host = HostInfo(hostUrl, appRunner = appRunner, hostDir = self.hostDir, asMirror = False, perPlatform = True) if not host.hasContentsFile: if not host.readContentsFile(): if not host.downloadContentsFile(self.http): From b50fbe8263ab56212f50759cce84cb8b0f7f0e9a Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 6 Aug 2015 15:49:26 +0200 Subject: [PATCH 3/5] Restore old packp3d behavior: main file should be considered relative to -d directory --- direct/src/p3d/packp3d.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/direct/src/p3d/packp3d.py b/direct/src/p3d/packp3d.py index 7dbe3a30b9..3544022fd6 100755 --- a/direct/src/p3d/packp3d.py +++ b/direct/src/p3d/packp3d.py @@ -170,19 +170,20 @@ def makePackedApp(args): appDir = Filename('.') appBase = appFilename.getBasenameWoExtension() - if not main: + if main: + main = Filename.fromOsSpecific(main) + main.makeAbsolute(root) + else: main = Filename(root, 'main.py') - if main.exists(): - main = 'main.py' - else: + if not main.exists(): main = glob.glob(os.path.join(root.toOsSpecific(), '*.py')) if len(main) == 0: raise ArgumentError, 'No Python files in root directory.' elif len(main) > 1: raise ArgumentError, 'Multiple Python files in root directory; specify the main application with -m "main".' - main = os.path.split(main[0])[1] - main = Filename.fromOsSpecific(main) + main = Filename.fromOsSpecific(os.path.split(main[0])[1]) + main.makeAbsolute(root) packager.installDir = appDir packager.allowPythonDev = allowPythonDev From 0c7b65b1fd943ff4314281ab3b35a77376843859 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 6 Aug 2015 15:52:02 +0200 Subject: [PATCH 4/5] Fix issue where packp3d fails if import.xml is refreshed while contents.xml remains old --- direct/src/p3d/AppRunner.py | 2 +- direct/src/p3d/Packager.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/direct/src/p3d/AppRunner.py b/direct/src/p3d/AppRunner.py index b9a1f17572..ff63e5aa8d 100644 --- a/direct/src/p3d/AppRunner.py +++ b/direct/src/p3d/AppRunner.py @@ -471,7 +471,7 @@ class AppRunner(DirectObject): file.unlink() return False - if not fileSpec.fullVerify(pathname = localPathname): + if not fileSpec.fullVerify(pathname = localPathname, notify = self.notify): # No good after download. self.notify.info("%s is still no good after downloading." % (url)) return False diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index d2166ec4f8..84448e23a7 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -3008,10 +3008,10 @@ class Packager: # environment. return None + # Make sure we have a fresh version of the contents file. host = appRunner.getHost(hostUrl) - if not host.readContentsFile(): - if not host.downloadContentsFile(appRunner.http): - return None + if not host.downloadContentsFile(appRunner.http): + return None packageInfos = [] packageInfo = host.getPackage(packageName, version, platform = platform) From b06ff60c10a5bf7a18af5da39321b4ae49d27e9f Mon Sep 17 00:00:00 2001 From: Ed Swartz Date: Thu, 6 Aug 2015 09:54:31 -0500 Subject: [PATCH 5/5] Fix DynamicTextFont.makeCopy() implementation --- panda/src/pnmtext/freetypeFont.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/panda/src/pnmtext/freetypeFont.cxx b/panda/src/pnmtext/freetypeFont.cxx index c2a5d176b1..974787a331 100644 --- a/panda/src/pnmtext/freetypeFont.cxx +++ b/panda/src/pnmtext/freetypeFont.cxx @@ -68,6 +68,7 @@ FreetypeFont(const FreetypeFont ©) : _requested_scale_factor(copy._requested_scale_factor), _scale_factor(copy._scale_factor), _native_antialias(copy._native_antialias), + _font_pixels_per_unit(copy._font_pixels_per_unit), _line_height(copy._line_height), _space_advance(copy._space_advance), _face(copy._face),