Jelajahi Sumber

Fix get_render_window_metrics

Daniele Bartolini 12 tahun lalu
induk
melakukan
fc7d3c61b5
1 mengubah file dengan 8 tambahan dan 0 penghapusan
  1. 8 0
      src/os/linux/GLXRenderWindow.cpp

+ 8 - 0
src/os/linux/GLXRenderWindow.cpp

@@ -183,6 +183,14 @@ void swap_buffers()
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 void get_render_window_metrics(uint32_t& width, uint32_t& height)
 void get_render_window_metrics(uint32_t& width, uint32_t& height)
 {
 {
+	XWindowAttributes attribs;
+	XGetWindowAttributes(display, window, &attribs);
+
+	XFlush(display);
+
+	window_width = attribs.width;
+	window_height = attribs.height;
+
 	width = window_width;
 	width = window_width;
 	height = window_height;
 	height = window_height;
 }
 }