浏览代码

Merge pull request #315 from adolson/patch-2

add display/resizable support to Linux
reduz 11 年之前
父节点
当前提交
71cfed8a76
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      platform/x11/context_gl_x11.cpp

+ 12 - 0
platform/x11/context_gl_x11.cpp

@@ -129,6 +129,18 @@ Error ContextGL_X11::initialize() {
 		}
 		//};
 
+	if (!OS::get_singleton()->get_video_mode().resizable) {
+		XSizeHints *xsh;
+		xsh = XAllocSizeHints();
+		xsh->flags = PMinSize | PMaxSize;
+		xsh->min_width = OS::get_singleton()->get_video_mode().width;
+		xsh->max_width = OS::get_singleton()->get_video_mode().width;
+		xsh->min_height = OS::get_singleton()->get_video_mode().height;
+		xsh->max_height = OS::get_singleton()->get_video_mode().height;
+		XSetWMNormalHints(x11_display, x11_window, xsh);
+	}
+
+
 	if (!opengl_3_context) {
 		//oldstyle context:
 		p->glx_context = glXCreateContext(x11_display, vi, 0, GL_TRUE);