summaryrefslogtreecommitdiff
path: root/platform/x11
diff options
context:
space:
mode:
Diffstat (limited to 'platform/x11')
-rw-r--r--platform/x11/context_gl_x11.cpp14
-rw-r--r--platform/x11/joypad_linux.h10
-rw-r--r--platform/x11/os_x11.cpp11
3 files changed, 19 insertions, 16 deletions
diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp
index ddf17481b1..f055d730db 100644
--- a/platform/x11/context_gl_x11.cpp
+++ b/platform/x11/context_gl_x11.cpp
@@ -83,6 +83,19 @@ static int ctxErrorHandler(Display *dpy, XErrorEvent *ev) {
return 0;
}
+static void set_class_hint(Display *p_display, Window p_window) {
+ XClassHint *classHint;
+
+ /* set the name and class hints for the window manager to use */
+ classHint = XAllocClassHint();
+ if (classHint) {
+ classHint->res_name = (char *)"Godot_Engine";
+ classHint->res_class = (char *)"Godot";
+ }
+ XSetClassHint(p_display, p_window, classHint);
+ XFree(classHint);
+}
+
Error ContextGL_X11::initialize() {
GLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = NULL;
@@ -127,6 +140,7 @@ Error ContextGL_X11::initialize() {
*/
x11_window = XCreateWindow(x11_display, RootWindow(x11_display, vi->screen), 0, 0, OS::get_singleton()->get_video_mode().width, OS::get_singleton()->get_video_mode().height, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel | CWColormap | CWEventMask, &swa);
ERR_FAIL_COND_V(!x11_window, ERR_UNCONFIGURED);
+ set_class_hint(x11_display, x11_window);
XMapWindow(x11_display, x11_window);
//};
diff --git a/platform/x11/joypad_linux.h b/platform/x11/joypad_linux.h
index a0ac559b1c..55383885a0 100644
--- a/platform/x11/joypad_linux.h
+++ b/platform/x11/joypad_linux.h
@@ -80,22 +80,22 @@ private:
static void joy_thread_func(void *p_user);
- int get_joy_from_path(String path) const;
+ int get_joy_from_path(String p_path) const;
void setup_joypad_properties(int p_id);
void close_joypad(int p_id = -1);
#ifdef UDEV_ENABLED
- void enumerate_joypads(struct udev *_udev);
- void monitor_joypads(struct udev *_udev);
+ void enumerate_joypads(struct udev *p_udev);
+ void monitor_joypads(struct udev *p_udev);
#endif
void monitor_joypads();
void run_joypad_thread();
- void open_joypad(const char *path);
+ void open_joypad(const char *p_path);
void joypad_vibration_start(int p_id, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp);
void joypad_vibration_stop(int p_id, uint64_t p_timestamp);
- InputDefault::JoyAxis axis_correct(const input_absinfo *abs, int value) const;
+ InputDefault::JoyAxis axis_correct(const input_absinfo *p_abs, int p_value) const;
};
#endif
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index ade3a0a0c5..a23f2f1320 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -351,20 +351,9 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
XChangeWindowAttributes(x11_display, x11_window, CWEventMask, &new_attr);
- XClassHint *classHint;
-
/* set the titlebar name */
XStoreName(x11_display, x11_window, "Godot");
- /* set the name and class hints for the window manager to use */
- classHint = XAllocClassHint();
- if (classHint) {
- classHint->res_name = (char *)"Godot_Engine";
- classHint->res_class = (char *)"Godot";
- }
- XSetClassHint(x11_display, x11_window, classHint);
- XFree(classHint);
-
wm_delete = XInternAtom(x11_display, "WM_DELETE_WINDOW", true);
XSetWMProtocols(x11_display, x11_window, &wm_delete, 1);