diff options
Diffstat (limited to 'platform/x11/os_x11.cpp')
-rw-r--r-- | platform/x11/os_x11.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index a23f2f1320..dbc3914410 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -191,8 +191,7 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au ::XIMStyles *xim_styles = NULL; xim_style = 0L; - char *imvalret = NULL; - imvalret = XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL); + char *imvalret = XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL); if (imvalret != NULL || xim_styles == NULL) { fprintf(stderr, "Input method doesn't support any styles\n"); } @@ -762,6 +761,10 @@ void OS_X11::set_current_screen(int p_screen) { } Point2 OS_X11::get_screen_position(int p_screen) const { + if (p_screen == -1) { + p_screen = get_current_screen(); + } + // Using Xinerama Extension int event_base, error_base; const Bool ext_okay = XineramaQueryExtension(x11_display, &event_base, &error_base); @@ -783,6 +786,10 @@ Point2 OS_X11::get_screen_position(int p_screen) const { } Size2 OS_X11::get_screen_size(int p_screen) const { + if (p_screen == -1) { + p_screen = get_current_screen(); + } + // Using Xinerama Extension int event_base, error_base; const Bool ext_okay = XineramaQueryExtension(x11_display, &event_base, &error_base); @@ -798,6 +805,9 @@ Size2 OS_X11::get_screen_size(int p_screen) const { } int OS_X11::get_screen_dpi(int p_screen) const { + if (p_screen == -1) { + p_screen = get_current_screen(); + } //invalid screen? ERR_FAIL_INDEX_V(p_screen, get_screen_count(), 0); @@ -2140,8 +2150,7 @@ bool OS_X11::is_vsync_enabled() const { void OS_X11::set_context(int p_context) { - XClassHint *classHint = NULL; - classHint = XAllocClassHint(); + XClassHint *classHint = XAllocClassHint(); if (classHint) { if (p_context == CONTEXT_EDITOR) |