summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--demos/misc/window_management/control.gd6
-rw-r--r--demos/misc/window_management/engine.cfg7
-rw-r--r--demos/misc/window_management/window_management.scnbin4030 -> 4268 bytes
-rw-r--r--platform/x11/os_x11.cpp10
4 files changed, 16 insertions, 7 deletions
diff --git a/demos/misc/window_management/control.gd b/demos/misc/window_management/control.gd
index 4929b1376c..6dc9282149 100644
--- a/demos/misc/window_management/control.gd
+++ b/demos/misc/window_management/control.gd
@@ -33,7 +33,6 @@ func _fixed_process(delta):
get_node("Label_Screen0_Position").set_text(str("Screen0 Position:\n",OS.get_screen_position() ) )
-
if(OS.get_screen_count() > 1):
get_node("Button_Screen0").show()
get_node("Button_Screen1").show()
@@ -63,6 +62,7 @@ func _fixed_process(delta):
get_node("Button_FixedSize").set_pressed( !OS.is_resizable() )
get_node("Button_Minimized").set_pressed( OS.is_minimized() )
get_node("Button_Maximized").set_pressed( OS.is_maximized() )
+ get_node("Button_Mouse_Grab").set_pressed( Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED )
func _ready():
@@ -113,4 +113,6 @@ func _on_Button_Maximized_pressed():
OS.set_maximized(true)
-
+func _on_Button_Mouse_Grab_pressed():
+ var observer = get_node("../Observer")
+ observer.state = observer.STATE_GRAB
diff --git a/demos/misc/window_management/engine.cfg b/demos/misc/window_management/engine.cfg
index 6ce3d51aee..c53bd45fb7 100644
--- a/demos/misc/window_management/engine.cfg
+++ b/demos/misc/window_management/engine.cfg
@@ -10,3 +10,10 @@ fullscreen=false
resizable=true
width=800
height=600
+
+[input]
+
+move_forward=[key(W)]
+move_backwards=[key(S)]
+move_left=[key(A)]
+move_right=[key(D)]
diff --git a/demos/misc/window_management/window_management.scn b/demos/misc/window_management/window_management.scn
index baf03bdfd1..40e6e64cef 100644
--- a/demos/misc/window_management/window_management.scn
+++ b/demos/misc/window_management/window_management.scn
Binary files differ
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index d711cea42e..fa3701aeef 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -177,11 +177,7 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
context_gl = memnew( ContextGL_X11( x11_display, x11_window,current_videomode, false ) );
context_gl->initialize();
- if (true) {
- rasterizer = memnew( RasterizerGLES2 );
- } else {
- //rasterizer = memnew( RasterizerGLES1 );
- };
+ rasterizer = memnew( RasterizerGLES2 );
#endif
visual_server = memnew( VisualServerRaster(rasterizer) );
@@ -1164,10 +1160,12 @@ void OS_X11::process_xevents() {
case FocusIn:
minimized = false;
+#ifdef EXPERIMENTAL_WM_API
if(current_videomode.fullscreen) {
set_wm_fullscreen(true);
visual_server->init();
}
+#endif
main_loop->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN);
if (mouse_mode==MOUSE_MODE_CAPTURED) {
XGrabPointer(x11_display, x11_window, True,
@@ -1178,11 +1176,13 @@ void OS_X11::process_xevents() {
break;
case FocusOut:
+#ifdef EXPERIMENTAL_WM_API
if(current_videomode.fullscreen) {
set_wm_fullscreen(false);
set_minimized(true);
visual_server->init();
}
+#endif
main_loop->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT);
if (mouse_mode==MOUSE_MODE_CAPTURED) {
//dear X11, I try, I really try, but you never work, you do whathever you want.