diff options
| author | Dana Olson | 2014-08-25 02:54:10 -0400 |
|---|---|---|
| committer | Dana Olson | 2014-08-25 02:54:38 -0400 |
| commit | dbae857b293231882307c52217e9569a17da0f23 (patch) | |
| tree | e238900113aa99aa8892752f644ff29348b89829 /platform/x11/os_x11.cpp | |
| parent | 89fa70706f9166765c3ac3f799225a467800f065 (diff) | |
| download | godot-dbae857b293231882307c52217e9569a17da0f23.tar.gz godot-dbae857b293231882307c52217e9569a17da0f23.tar.zst godot-dbae857b293231882307c52217e9569a17da0f23.zip | |
borderless fullscreen window support for x11
move disable resize x11 code from context_gl to os_x11
Diffstat (limited to 'platform/x11/os_x11.cpp')
| -rw-r--r-- | platform/x11/os_x11.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 62af30279..eab9be7f9 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -168,6 +168,39 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD)); } + // borderless fullscreen window mode + if (current_videomode.fullscreen) { + Hints hints; + Atom property; + hints.flags = 2; + hints.decorations = 0; + property = XInternAtom(x11_display, "_MOTIF_WM_HINTS", True); + XChangeProperty(x11_display, x11_window, property, property, 32, PropModeReplace, (unsigned char *)&hints, 5); + XMapRaised(x11_display, x11_window); + // get the window root, then the res for the root + XWindowAttributes xwa; + XGetWindowAttributes(x11_display,x11_window,&xwa); + XGetWindowAttributes(x11_display,xwa.root,&xwa); + XMoveResizeWindow(x11_display, x11_window ,0 ,0 , xwa.width, xwa.height); + } + + // disable resizeable window + if (!current_videomode.resizable) { + XSizeHints *xsh; + xsh = XAllocSizeHints(); + xsh->flags = PMinSize | PMaxSize; + XWindowAttributes xwa; + XGetWindowAttributes(x11_display,x11_window,&xwa); + if (current_videomode.fullscreen) { + XGetWindowAttributes(x11_display,xwa.root,&xwa); + } + xsh->min_width = xwa.width; + xsh->max_width = xwa.width; + xsh->min_height = xwa.height; + xsh->max_height = xwa.height; + XSetWMNormalHints(x11_display, x11_window, xsh); + } + AudioDriverManagerSW::get_driver(p_audio_driver)->set_singleton(); if (AudioDriverManagerSW::get_driver(p_audio_driver)->init()!=OK) { |
