Daniele Bartolini 10 anni fa
parent
commit
20723958e9
2 ha cambiato i file con 14 aggiunte e 10 eliminazioni
  1. 1 1
      samples/00-hello-world/lua/game.lua
  2. 13 9
      src/main/main_linux.cpp

+ 1 - 1
samples/00-hello-world/lua/game.lua

@@ -3,7 +3,7 @@ camera = camera or nil
 
 function init()
 	-- Set the title of the main window
-	Window.set_title("Hello world!")
+	Window.set_title("00-hello-world")
 
 	-- Create world and camera
 	world = Device.create_world()

+ 13 - 9
src/main/main_linux.cpp

@@ -605,42 +605,46 @@ public:
 
 	void show()
 	{
-
+		XMapRaised(s_x11_display, _x11_window);
 	}
 
 	void hide()
 	{
-
+		XUnmapWindow(s_x11_display, _x11_window);
 	}
 
 	void resize(uint16_t width, uint16_t height)
 	{
-
+		XResizeWindow(s_x11_display, _x11_window, width, height);
 	}
 
 	void move(uint16_t x, uint16_t y)
 	{
-
+		XMoveWindow(s_x11_display, _x11_window, x, y);
 	}
 
 	void minimize()
 	{
-
 	}
 
 	void restore()
 	{
-
 	}
 
 	const char* title()
 	{
-
+		static char buf[512];
+		memset(buf, 0, sizeof(buf));
+		char* name;
+		XFetchName(s_x11_display, _x11_window, &name);
+		strncpy(buf, name, sizeof(buf));
+		XFree(name);
+		return buf;
 	}
 
-	void set_title (const char* /*title*/)
+	void set_title (const char* title)
 	{
-
+		XStoreName(s_x11_display, _x11_window, title);
 	}
 
 	void* handle()