summaryrefslogtreecommitdiff
path: root/platform/x11
diff options
context:
space:
mode:
Diffstat (limited to 'platform/x11')
-rw-r--r--platform/x11/SCsub2
-rw-r--r--platform/x11/context_gl_x11.cpp1
-rw-r--r--platform/x11/context_gl_x11.h1
-rw-r--r--platform/x11/crash_handler_x11.cpp1
-rw-r--r--platform/x11/crash_handler_x11.h1
-rw-r--r--platform/x11/detect.py19
-rw-r--r--platform/x11/export/export.cpp1
-rw-r--r--platform/x11/export/export.h1
-rw-r--r--platform/x11/godot_x11.cpp1
-rw-r--r--platform/x11/key_mapping_x11.cpp1
-rw-r--r--platform/x11/key_mapping_x11.h1
-rw-r--r--platform/x11/os_x11.cpp256
-rw-r--r--platform/x11/os_x11.h14
-rw-r--r--platform/x11/platform_config.h1
14 files changed, 265 insertions, 36 deletions
diff --git a/platform/x11/SCsub b/platform/x11/SCsub
index 38dd2ddd88..b18757337a 100644
--- a/platform/x11/SCsub
+++ b/platform/x11/SCsub
@@ -19,5 +19,5 @@ common_x11 = [
prog = env.add_program('#bin/godot', ['godot_x11.cpp'] + common_x11)
-if env["debug_symbols"] == "full" or env["debug_symbols"] == "yes":
+if (env["debug_symbols"] == "full" or env["debug_symbols"] == "yes") and env["separate_debug_symbols"]:
env.AddPostAction(prog, make_debug)
diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp
index b232f36a46..20f2212861 100644
--- a/platform/x11/context_gl_x11.cpp
+++ b/platform/x11/context_gl_x11.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "context_gl_x11.h"
#ifdef X11_ENABLED
diff --git a/platform/x11/context_gl_x11.h b/platform/x11/context_gl_x11.h
index efebd3f78d..c969f0044d 100644
--- a/platform/x11/context_gl_x11.h
+++ b/platform/x11/context_gl_x11.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef CONTEXT_GL_X11_H
#define CONTEXT_GL_X11_H
diff --git a/platform/x11/crash_handler_x11.cpp b/platform/x11/crash_handler_x11.cpp
index f0eb8a6d5b..43b9051ea7 100644
--- a/platform/x11/crash_handler_x11.cpp
+++ b/platform/x11/crash_handler_x11.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifdef DEBUG_ENABLED
#define CRASH_HANDLER_ENABLED 1
#endif
diff --git a/platform/x11/crash_handler_x11.h b/platform/x11/crash_handler_x11.h
index 36ab29b597..49ca0df9a8 100644
--- a/platform/x11/crash_handler_x11.h
+++ b/platform/x11/crash_handler_x11.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef CRASH_HANDLER_X11_H
#define CRASH_HANDLER_X11_H
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index cb45fed1be..c5ef82150b 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -55,6 +55,7 @@ def get_opts():
BoolVariable('pulseaudio', 'Detect & use pulseaudio', True),
BoolVariable('udev', 'Use udev for gamepad connection callbacks', False),
EnumVariable('debug_symbols', 'Add debug symbols to release version', 'yes', ('yes', 'no', 'full')),
+ BoolVariable('separate_debug_symbols', 'Create a separate file with the debug symbols', False),
BoolVariable('touch', 'Enable touch events', True),
]
@@ -64,7 +65,6 @@ def get_flags():
return [
('builtin_freetype', False),
('builtin_libpng', False),
- ('builtin_openssl', False),
('builtin_zlib', False),
]
@@ -109,7 +109,7 @@ def configure(env):
if ('clang++' not in env['CXX']):
env["CC"] = "clang"
env["CXX"] = "clang++"
- env["LD"] = "clang++"
+ env["LINK"] = "clang++"
env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND'])
env.extra_suffix = ".llvm" + env.extra_suffix
@@ -152,8 +152,9 @@ def configure(env):
# FIXME: Check for existence of the libs before parsing their flags with pkg-config
- if not env['builtin_openssl']:
- env.ParseConfig('pkg-config openssl --cflags --libs')
+ if not env['builtin_mbedtls']:
+ # mbedTLS does not provide a pkgconfig config yet. See https://github.com/ARMmbed/mbedtls/issues/228
+ env.Append(LIBS=['mbedtls', 'mbedcrypto', 'mbedx509'])
if not env['builtin_libwebp']:
env.ParseConfig('pkg-config libwebp --cflags --libs')
@@ -172,6 +173,16 @@ def configure(env):
if not env['builtin_libpng']:
env.ParseConfig('pkg-config libpng --cflags --libs')
+ if not env['builtin_bullet']:
+ # We need at least version 2.88
+ import subprocess
+ bullet_version = subprocess.check_output(['pkg-config', 'bullet', '--modversion']).strip()
+ if bullet_version < "2.88":
+ # Abort as system bullet was requested but too old
+ print("Bullet: System version {0} does not match minimal requirements ({1}). Aborting.".format(bullet_version, "2.88"))
+ sys.exit(255)
+ env.ParseConfig('pkg-config bullet --cflags --libs')
+
if not env['builtin_enet']:
env.ParseConfig('pkg-config libenet --cflags --libs')
diff --git a/platform/x11/export/export.cpp b/platform/x11/export/export.cpp
index 3a8786f296..904aceaca0 100644
--- a/platform/x11/export/export.cpp
+++ b/platform/x11/export/export.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "export.h"
#include "editor/editor_export.h"
diff --git a/platform/x11/export/export.h b/platform/x11/export/export.h
index 152a64df86..ac44cef8f7 100644
--- a/platform/x11/export/export.h
+++ b/platform/x11/export/export.h
@@ -27,4 +27,5 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
void register_x11_exporter();
diff --git a/platform/x11/godot_x11.cpp b/platform/x11/godot_x11.cpp
index c7d7bb643b..3241cbcbf9 100644
--- a/platform/x11/godot_x11.cpp
+++ b/platform/x11/godot_x11.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include <limits.h>
#include <locale.h>
#include <stdlib.h>
diff --git a/platform/x11/key_mapping_x11.cpp b/platform/x11/key_mapping_x11.cpp
index 5e15768d66..423e2737ee 100644
--- a/platform/x11/key_mapping_x11.cpp
+++ b/platform/x11/key_mapping_x11.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "key_mapping_x11.h"
/***** SCAN CODE CONVERSION ******/
diff --git a/platform/x11/key_mapping_x11.h b/platform/x11/key_mapping_x11.h
index 022affcbea..62dfcf3a4d 100644
--- a/platform/x11/key_mapping_x11.h
+++ b/platform/x11/key_mapping_x11.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef KEY_MAPPING_X11_H
#define KEY_MAPPING_X11_H
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 240d6638a9..2d8e32137f 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "os_x11.h"
#include "drivers/gles3/rasterizer_gles3.h"
#include "errno.h"
@@ -100,7 +101,7 @@ void OS_X11::initialize_core() {
OS_Unix::initialize_core();
}
-void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
+Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
long im_event_mask = 0;
last_button_state = 0;
@@ -123,21 +124,24 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
/** XLIB INITIALIZATION **/
x11_display = XOpenDisplay(NULL);
+ if (!x11_display) {
+ ERR_PRINT("X11 Display is not available");
+ return ERR_UNAVAILABLE;
+ }
+
char *modifiers = NULL;
Bool xkb_dar = False;
- if (x11_display) {
- XAutoRepeatOn(x11_display);
- xkb_dar = XkbSetDetectableAutoRepeat(x11_display, True, NULL);
+ XAutoRepeatOn(x11_display);
+ xkb_dar = XkbSetDetectableAutoRepeat(x11_display, True, NULL);
- // Try to support IME if detectable auto-repeat is supported
- if (xkb_dar == True) {
+ // Try to support IME if detectable auto-repeat is supported
+ if (xkb_dar == True) {
#ifdef X_HAVE_UTF8_STRING
- // Xutf8LookupString will be used later instead of XmbLookupString before
- // the multibyte sequences can be converted to unicode string.
- modifiers = XSetLocaleModifiers("");
+ // Xutf8LookupString will be used later instead of XmbLookupString before
+ // the multibyte sequences can be converted to unicode string.
+ modifiers = XSetLocaleModifiers("");
#endif
- }
}
if (modifiers == NULL) {
@@ -213,7 +217,7 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
XIFreeDeviceInfo(info);
- if (!touch.devices.size()) {
+ if (is_stdout_verbose() && !touch.devices.size()) {
fprintf(stderr, "No touch devices found\n");
}
}
@@ -329,10 +333,15 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
XFree(xsh);
}
+ if (current_videomode.always_on_top) {
+ current_videomode.always_on_top = false;
+ set_window_always_on_top(true);
+ }
+
AudioDriverManager::initialize(p_audio_driver);
- ERR_FAIL_COND(!visual_server);
- ERR_FAIL_COND(x11_window == 0);
+ ERR_FAIL_COND_V(!visual_server, ERR_UNAVAILABLE);
+ ERR_FAIL_COND_V(x11_window == 0, ERR_UNAVAILABLE);
XSetWindowAttributes new_attr;
@@ -519,6 +528,8 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
_window_changed(&xevent);
}
}
+
+ return OK;
}
void OS_X11::xim_destroy_callback(::XIM im, ::XPointer client_data,
@@ -543,6 +554,21 @@ void OS_X11::set_ime_position(const Point2 &p_pos) {
XFree(preedit_attr);
}
+String OS_X11::get_unique_id() const {
+
+ static String machine_id;
+ if (machine_id.empty()) {
+ if (FileAccess *f = FileAccess::open("/etc/machine-id", FileAccess::READ)) {
+ while (machine_id.empty() && !f->eof_reached()) {
+ machine_id = f->get_line().strip_edges();
+ }
+ f->close();
+ memdelete(f);
+ }
+ }
+ return machine_id;
+}
+
void OS_X11::finalize() {
if (main_loop)
@@ -704,9 +730,6 @@ void OS_X11::get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen) con
}
void OS_X11::set_wm_fullscreen(bool p_enabled) {
- if (current_videomode.fullscreen == p_enabled)
- return;
-
if (p_enabled && !is_window_resizable()) {
// Set the window as resizable to prevent window managers to ignore the fullscreen state flag.
XSizeHints *xsh;
@@ -767,6 +790,22 @@ void OS_X11::set_wm_fullscreen(bool p_enabled) {
}
}
+void OS_X11::set_wm_above(bool p_enabled) {
+ Atom wm_state = XInternAtom(x11_display, "_NET_WM_STATE", False);
+ Atom wm_above = XInternAtom(x11_display, "_NET_WM_STATE_ABOVE", False);
+
+ XClientMessageEvent xev;
+ memset(&xev, 0, sizeof(xev));
+ xev.type = ClientMessage;
+ xev.window = x11_window;
+ xev.message_type = wm_state;
+ xev.format = 32;
+ xev.data.l[0] = p_enabled ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
+ xev.data.l[1] = wm_above;
+ xev.data.l[3] = 1;
+ XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&xev);
+}
+
int OS_X11::get_screen_count() const {
// Using Xinerama Extension
int event_base, error_base;
@@ -918,6 +957,26 @@ Size2 OS_X11::get_window_size() const {
return Size2i(current_videomode.width, current_videomode.height);
}
+Size2 OS_X11::get_real_window_size() const {
+ XWindowAttributes xwa;
+ XSync(x11_display, False);
+ XGetWindowAttributes(x11_display, x11_window, &xwa);
+ int w = xwa.width;
+ int h = xwa.height;
+ Atom prop = XInternAtom(x11_display, "_NET_FRAME_EXTENTS", True);
+ Atom type;
+ int format;
+ unsigned long len;
+ unsigned long remaining;
+ unsigned char *data = NULL;
+ if (XGetWindowProperty(x11_display, x11_window, prop, 0, 4, False, AnyPropertyType, &type, &format, &len, &remaining, &data) == Success) {
+ long *extents = (long *)data;
+ w += extents[0] + extents[1]; // left, right
+ h += extents[2] + extents[3]; // top, bottom
+ }
+ return Size2(w, h);
+}
+
void OS_X11::set_window_size(const Size2 p_size) {
// If window resizable is disabled we need to update the attributes first
if (is_window_resizable() == false) {
@@ -941,7 +1000,19 @@ void OS_X11::set_window_size(const Size2 p_size) {
}
void OS_X11::set_window_fullscreen(bool p_enabled) {
+ if (current_videomode.fullscreen == p_enabled)
+ return;
+
+ if (p_enabled && current_videomode.always_on_top) {
+ // Fullscreen + Always-on-top requires a maximized window on some window managers (Metacity)
+ set_window_maximized(true);
+ }
set_wm_fullscreen(p_enabled);
+ if (!p_enabled && !current_videomode.always_on_top) {
+ // Restore
+ set_window_maximized(false);
+ }
+
current_videomode.fullscreen = p_enabled;
}
@@ -1050,13 +1121,59 @@ void OS_X11::set_window_maximized(bool p_enabled) {
XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);
- while (p_enabled && !is_window_maximized()) {
- // Wait for effective resizing (so the GLX context is too).
+ if (is_window_maximize_allowed()) {
+ while (p_enabled && !is_window_maximized()) {
+ // Wait for effective resizing (so the GLX context is too).
+ }
}
maximized = p_enabled;
}
+bool OS_X11::is_window_maximize_allowed() {
+ Atom property = XInternAtom(x11_display, "_NET_WM_ALLOWED_ACTIONS", False);
+ Atom type;
+ int format;
+ unsigned long len;
+ unsigned long remaining;
+ unsigned char *data = NULL;
+
+ int result = XGetWindowProperty(
+ x11_display,
+ x11_window,
+ property,
+ 0,
+ 1024,
+ False,
+ XA_ATOM,
+ &type,
+ &format,
+ &len,
+ &remaining,
+ &data);
+
+ if (result == Success) {
+ Atom *atoms = (Atom *)data;
+ Atom wm_act_max_horz = XInternAtom(x11_display, "_NET_WM_ACTION_MAXIMIZE_HORZ", False);
+ Atom wm_act_max_vert = XInternAtom(x11_display, "_NET_WM_ACTION_MAXIMIZE_VERT", False);
+ bool found_wm_act_max_horz = false;
+ bool found_wm_act_max_vert = false;
+
+ for (unsigned int i = 0; i < len; i++) {
+ if (atoms[i] == wm_act_max_horz)
+ found_wm_act_max_horz = true;
+ if (atoms[i] == wm_act_max_vert)
+ found_wm_act_max_vert = true;
+
+ if (found_wm_act_max_horz || found_wm_act_max_vert)
+ return true;
+ }
+ XFree(atoms);
+ }
+
+ return false;
+}
+
bool OS_X11::is_window_maximized() const {
// Using EWMH -- Extended Window Manager Hints
Atom property = XInternAtom(x11_display, "_NET_WM_STATE", False);
@@ -1102,6 +1219,27 @@ bool OS_X11::is_window_maximized() const {
return false;
}
+void OS_X11::set_window_always_on_top(bool p_enabled) {
+ if (is_window_always_on_top() == p_enabled)
+ return;
+
+ if (p_enabled && current_videomode.fullscreen) {
+ // Fullscreen + Always-on-top requires a maximized window on some window managers (Metacity)
+ set_window_maximized(true);
+ }
+ set_wm_above(p_enabled);
+ if (!p_enabled && !current_videomode.fullscreen) {
+ // Restore
+ set_window_maximized(false);
+ }
+
+ current_videomode.always_on_top = p_enabled;
+}
+
+bool OS_X11::is_window_always_on_top() const {
+ return current_videomode.always_on_top;
+}
+
void OS_X11::set_borderless_window(bool p_borderless) {
if (current_videomode.borderless_window == p_borderless)
@@ -1810,8 +1948,12 @@ void OS_X11::process_xevents() {
e = event;
req = &(e.xselectionrequest);
- if (req->target == XA_STRING || req->target == XInternAtom(x11_display, "COMPOUND_TEXT", 0) ||
- req->target == XInternAtom(x11_display, "UTF8_STRING", 0)) {
+ if (req->target == XInternAtom(x11_display, "UTF8_STRING", 0) ||
+ req->target == XInternAtom(x11_display, "COMPOUND_TEXT", 0) ||
+ req->target == XInternAtom(x11_display, "TEXT", 0) ||
+ req->target == XA_STRING ||
+ req->target == XInternAtom(x11_display, "text/plain;charset=utf-8", 0) ||
+ req->target == XInternAtom(x11_display, "text/plain", 0)) {
CharString clip = OS::get_clipboard().utf8();
XChangeProperty(x11_display,
req->requestor,
@@ -1824,26 +1966,40 @@ void OS_X11::process_xevents() {
respond.xselection.property = req->property;
} else if (req->target == XInternAtom(x11_display, "TARGETS", 0)) {
- Atom data[2];
- data[0] = XInternAtom(x11_display, "UTF8_STRING", 0);
- data[1] = XA_STRING;
- XChangeProperty(x11_display, req->requestor, req->property, req->target,
- 8, PropModeReplace, (unsigned char *)&data,
- sizeof(data));
+ Atom data[7];
+ data[0] = XInternAtom(x11_display, "TARGETS", 0);
+ data[1] = XInternAtom(x11_display, "UTF8_STRING", 0);
+ data[2] = XInternAtom(x11_display, "COMPOUND_TEXT", 0);
+ data[3] = XInternAtom(x11_display, "TEXT", 0);
+ data[4] = XA_STRING;
+ data[5] = XInternAtom(x11_display, "text/plain;charset=utf-8", 0);
+ data[6] = XInternAtom(x11_display, "text/plain", 0);
+
+ XChangeProperty(x11_display,
+ req->requestor,
+ req->property,
+ XA_ATOM,
+ 32,
+ PropModeReplace,
+ (unsigned char *)&data,
+ sizeof(data) / sizeof(data[0]));
respond.xselection.property = req->property;
} else {
- printf("No String %x\n",
- (int)req->target);
+ char *targetname = XGetAtomName(x11_display, req->target);
+ printf("No Target '%s'\n", targetname);
+ if (targetname)
+ XFree(targetname);
respond.xselection.property = None;
}
+
respond.xselection.type = SelectionNotify;
respond.xselection.display = req->display;
respond.xselection.requestor = req->requestor;
respond.xselection.selection = req->selection;
respond.xselection.target = req->target;
respond.xselection.time = req->time;
- XSendEvent(x11_display, req->requestor, 0, 0, &respond);
+ XSendEvent(x11_display, req->requestor, True, NoEventMask, &respond);
XFlush(x11_display);
} break;
@@ -2205,6 +2361,48 @@ void OS_X11::set_cursor_shape(CursorShape p_shape) {
current_cursor = p_shape;
}
+void OS_X11::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
+ if (p_cursor.is_valid()) {
+ Ref<Texture> texture = p_cursor;
+ Ref<Image> image = texture->get_data();
+
+ ERR_FAIL_COND(texture->get_width() != 32 || texture->get_height() != 32);
+
+ // Create the cursor structure
+ XcursorImage *cursor_image = XcursorImageCreate(texture->get_width(), texture->get_height());
+ XcursorUInt image_size = 32 * 32;
+ XcursorDim size = sizeof(XcursorPixel) * image_size;
+
+ cursor_image->version = 1;
+ cursor_image->size = size;
+ cursor_image->xhot = p_hotspot.x;
+ cursor_image->yhot = p_hotspot.y;
+
+ // allocate memory to contain the whole file
+ cursor_image->pixels = (XcursorPixel *)malloc(size);
+
+ image->lock();
+
+ for (XcursorPixel index = 0; index < image_size; index++) {
+ int column_index = floor(index / 32);
+ int row_index = index % 32;
+
+ *(cursor_image->pixels + index) = image->get_pixel(row_index, column_index).to_argb32();
+ }
+
+ image->unlock();
+
+ ERR_FAIL_COND(cursor_image->pixels == NULL);
+
+ // Save it for a further usage
+ cursors[p_shape] = XcursorImageLoadCursor(x11_display, cursor_image);
+
+ if (p_shape == CURSOR_ARROW) {
+ XDefineCursor(x11_display, x11_window, cursors[p_shape]);
+ }
+ }
+}
+
void OS_X11::release_rendering_thread() {
context_gl->release_current();
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index 59b9c8caa8..494845bc56 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef OS_X11_H
#define OS_X11_H
@@ -177,6 +178,7 @@ class OS_X11 : public OS_Unix {
bool maximized;
//void set_wm_border(bool p_enabled);
void set_wm_fullscreen(bool p_enabled);
+ void set_wm_above(bool p_enabled);
typedef xrr_monitor_info *(*xrr_get_monitors_t)(Display *dpy, Window window, Bool get_active, int *nmonitors);
typedef void (*xrr_free_monitors_t)(xrr_monitor_info *monitors);
@@ -193,17 +195,20 @@ protected:
virtual const char *get_audio_driver_name(int p_driver) const;
virtual void initialize_core();
- virtual void initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver);
+ virtual Error initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver);
virtual void finalize();
virtual void set_main_loop(MainLoop *p_main_loop);
- void _window_changed(XEvent *xevent);
+ void _window_changed(XEvent *event);
+
+ bool is_window_maximize_allowed();
public:
virtual String get_name();
virtual void set_cursor_shape(CursorShape p_shape);
+ virtual void set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot);
void set_mouse_mode(MouseMode p_mode);
MouseMode get_mouse_mode() const;
@@ -247,6 +252,7 @@ public:
virtual Point2 get_window_position() const;
virtual void set_window_position(const Point2 &p_position);
virtual Size2 get_window_size() const;
+ virtual Size2 get_real_window_size() const;
virtual void set_window_size(const Size2 p_size);
virtual void set_window_fullscreen(bool p_enabled);
virtual bool is_window_fullscreen() const;
@@ -256,12 +262,16 @@ public:
virtual bool is_window_minimized() const;
virtual void set_window_maximized(bool p_enabled);
virtual bool is_window_maximized() const;
+ virtual void set_window_always_on_top(bool p_enabled);
+ virtual bool is_window_always_on_top() const;
virtual void request_attention();
virtual void set_borderless_window(bool p_borderless);
virtual bool get_borderless_window();
virtual void set_ime_position(const Point2 &p_pos);
+ virtual String get_unique_id() const;
+
virtual void move_window_to_foreground();
virtual void alert(const String &p_alert, const String &p_title = "ALERT!");
diff --git a/platform/x11/platform_config.h b/platform/x11/platform_config.h
index 0ad94803c2..58d6b210ee 100644
--- a/platform/x11/platform_config.h
+++ b/platform/x11/platform_config.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifdef __linux__
#include <alloca.h>
#endif