summaryrefslogtreecommitdiff
path: root/platform/x11
diff options
context:
space:
mode:
Diffstat (limited to 'platform/x11')
-rw-r--r--platform/x11/godot_x11.cpp9
-rw-r--r--platform/x11/os_x11.cpp2
2 files changed, 10 insertions, 1 deletions
diff --git a/platform/x11/godot_x11.cpp b/platform/x11/godot_x11.cpp
index f85ba17020..b727ecbd17 100644
--- a/platform/x11/godot_x11.cpp
+++ b/platform/x11/godot_x11.cpp
@@ -26,6 +26,9 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+#include <unistd.h>
+#include <limits.h>
+
#include "main/main.h"
#include "os_x11.h"
@@ -33,6 +36,9 @@ int main(int argc, char* argv[]) {
OS_X11 os;
+ char *cwd = (char*)malloc(PATH_MAX);
+ getcwd(cwd, PATH_MAX);
+
Error err = Main::setup(argv[0],argc-1,&argv[1]);
if (err!=OK)
return 255;
@@ -41,5 +47,8 @@ int main(int argc, char* argv[]) {
os.run(); // it is actually the OS that decides how to run
Main::cleanup();
+ chdir(cwd);
+ free(cwd);
+
return os.get_exit_code();
}
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 27df280927..a4ed08f330 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -1241,7 +1241,7 @@ static Property read_property(Display* p_display, Window p_window, Atom p_proper
}while(bytes_after != 0);
- Property p = {ret, actual_format, nitems, actual_type};
+ Property p = {ret, actual_format, (int)nitems, actual_type};
return p;
}