Browse Source

x11: Fix black screen when switching fullscreen without WM

Reconfiguring the window to origin 0, 0 is unnecessary and if the win origin is already 0, 0 this results in Panda waiting for a ConfigureNotify that never comes.
rdb 4 years ago
parent
commit
388ddda9d7
1 changed files with 9 additions and 6 deletions
  1. 9 6
      panda/src/x11display/x11GraphicsWindow.cxx

+ 9 - 6
panda/src/x11display/x11GraphicsWindow.cxx

@@ -768,12 +768,15 @@ set_properties_now(WindowProperties &properties) {
   int value_mask = 0;
   int value_mask = 0;
 
 
   if (_properties.get_fullscreen()) {
   if (_properties.get_fullscreen()) {
-    changes.x = 0;
-    changes.y = 0;
-    value_mask |= CWX | CWY;
-    properties.clear_origin();
-
-  } else if (properties.has_origin()) {
+    if (_properties.get_x_origin() != 0 ||
+        _properties.get_y_origin() != 0) {
+      changes.x = 0;
+      changes.y = 0;
+      value_mask |= CWX | CWY;
+      properties.clear_origin();
+    }
+  }
+  else if (properties.has_origin()) {
     changes.x = properties.get_x_origin();
     changes.x = properties.get_x_origin();
     changes.y = properties.get_y_origin();
     changes.y = properties.get_y_origin();
     if (changes.x != -1) value_mask |= CWX;
     if (changes.x != -1) value_mask |= CWX;