diff options
Diffstat (limited to 'platform/x11')
-rw-r--r-- | platform/x11/SCsub | 9 | ||||
-rw-r--r-- | platform/x11/crash_handler_x11.cpp | 3 | ||||
-rw-r--r-- | platform/x11/detect.py | 13 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 12 | ||||
-rw-r--r-- | platform/x11/os_x11.h | 2 |
5 files changed, 30 insertions, 9 deletions
diff --git a/platform/x11/SCsub b/platform/x11/SCsub index 62717f3221..aabc49149f 100644 --- a/platform/x11/SCsub +++ b/platform/x11/SCsub @@ -1,7 +1,12 @@ #!/usr/bin/env python +import os Import('env') +def make_debug(target, source, env): + os.system('objcopy --only-keep-debug %s %s.debug' % (target[0], target[0])) + os.system('strip --strip-debug --strip-unneeded %s' % (target[0])) + os.system('objcopy --add-gnu-debuglink=%s.debug %s' % (target[0], target[0])) common_x11 = [ "context_gl_x11.cpp", @@ -12,4 +17,6 @@ common_x11 = [ "power_x11.cpp", ] -env.Program('#bin/godot', ['godot_x11.cpp'] + common_x11) +binary = env.Program('#bin/godot', ['godot_x11.cpp'] + common_x11) +if env["debug_symbols"] == "full" or env["debug_symbols"] == "yes": + env.AddPostAction(binary, make_debug) diff --git a/platform/x11/crash_handler_x11.cpp b/platform/x11/crash_handler_x11.cpp index c926b7799d..3c54d5cbc2 100644 --- a/platform/x11/crash_handler_x11.cpp +++ b/platform/x11/crash_handler_x11.cpp @@ -39,6 +39,7 @@ #include <dlfcn.h> #include <execinfo.h> #include <signal.h> +#include <stdlib.h> static void handle_crash(int sig) { if (OS::get_singleton() == NULL) @@ -47,7 +48,7 @@ static void handle_crash(int sig) { void *bt_buffer[256]; size_t size = backtrace(bt_buffer, 256); String _execpath = OS::get_singleton()->get_executable_path(); - String msg = GLOBAL_GET("debug/settings/backtrace/message"); + String msg = GLOBAL_GET("debug/settings/crash_handler/message"); // Dump the backtrace to stderr with a message to the user fprintf(stderr, "%s: Program crashed with signal %d\n", __FUNCTION__, sig); diff --git a/platform/x11/detect.py b/platform/x11/detect.py index d61175da60..efd388e44f 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -44,7 +44,6 @@ def can_build(): return True - def get_opts(): return [ @@ -55,7 +54,7 @@ def get_opts(): ('use_lto', 'Use link time optimization', 'no'), ('pulseaudio', 'Detect & use pulseaudio', 'yes'), ('udev', 'Use udev for gamepad connection callbacks', 'no'), - ('debug_release', 'Add debug symbols to release version', 'no'), + ('debug_symbols', 'Add debug symbols to release version (yes/no/full)', 'yes') ] @@ -77,16 +76,20 @@ def configure(env): # -O3 -ffast-math is identical to -Ofast. We need to split it out so we can selectively disable # -ffast-math in code for which it generates wrong results. env.Prepend(CCFLAGS=['-O3', '-ffast-math']) - if (env["debug_release"] == "yes"): + if (env["debug_symbols"] == "yes"): + env.Prepend(CCFLAGS=['-g1']) + if (env["debug_symbols"] == "full"): env.Prepend(CCFLAGS=['-g2']) elif (env["target"] == "release_debug"): env.Prepend(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED']) - if (env["debug_release"] == "yes"): + if (env["debug_symbols"] == "yes"): + env.Prepend(CCFLAGS=['-g1']) + if (env["debug_symbols"] == "full"): env.Prepend(CCFLAGS=['-g2']) elif (env["target"] == "debug"): - env.Prepend(CCFLAGS=['-g2', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) + env.Prepend(CCFLAGS=['-g3', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) env.Append(LINKFLAGS=['-rdynamic']) ## Architecture diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 3e8709a11e..599c0d2278 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -613,7 +613,7 @@ void OS_X11::set_mouse_mode(MouseMode p_mode) { XFlush(x11_display); } -void OS_X11::warp_mouse_pos(const Point2 &p_to) { +void OS_X11::warp_mouse_position(const Point2 &p_to) { if (mouse_mode == MOUSE_MODE_CAPTURED) { @@ -708,6 +708,16 @@ void OS_X11::set_wm_fullscreen(bool p_enabled) { XSetWMNormalHints(x11_display, x11_window, xsh); XFree(xsh); } + + if (!p_enabled && !get_borderless_window()) { + // put decorations back if the window wasn't suppoesed to be borderless + Hints hints; + Atom property; + hints.flags = 2; + hints.decorations = 1; + property = XInternAtom(x11_display, "_MOTIF_WM_HINTS", True); + XChangeProperty(x11_display, x11_window, property, property, 32, PropModeReplace, (unsigned char *)&hints, 5); + } } int OS_X11::get_screen_count() const { diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index 0e2430c650..a0338dacf1 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -201,7 +201,7 @@ public: void set_mouse_mode(MouseMode p_mode); MouseMode get_mouse_mode() const; - virtual void warp_mouse_pos(const Point2 &p_to); + virtual void warp_mouse_position(const Point2 &p_to); virtual Point2 get_mouse_position() const; virtual int get_mouse_button_state() const; virtual void set_window_title(const String &p_title); |