Просмотр исходного кода

WIP: Linux port
- No longer report input events when our app doesn't have input focus
- Folder monitor is now properly initialized and properly reports events
- Window creation parameters were refactored to better reflect their actions across both Windows and Linux

Marko Pintera 8 лет назад
Родитель
Сommit
912ca36de2

+ 10 - 0
Source/BansheeCore/Input/BsInput.cpp

@@ -43,6 +43,7 @@ namespace bs
 		mMouseWheelScrolledConn  = Platform::onMouseWheelScrolled.connect(std::bind(&Input::mouseWheelScrolled, this, _1));
 		mMouseWheelScrolledConn  = Platform::onMouseWheelScrolled.connect(std::bind(&Input::mouseWheelScrolled, this, _1));
 
 
 		RenderWindowManager::instance().onFocusGained.connect(std::bind(&Input::inputWindowChanged, this, _1));
 		RenderWindowManager::instance().onFocusGained.connect(std::bind(&Input::inputWindowChanged, this, _1));
+		RenderWindowManager::instance().onFocusLost.connect(std::bind(&Input::inputFocusLost, this));
 
 
 		for (int i = 0; i < 3; i++)
 		for (int i = 0; i < 3; i++)
 			mPointerButtonStates[i] = ButtonState::Off;
 			mPointerButtonStates[i] = ButtonState::Off;
@@ -277,6 +278,15 @@ namespace bs
 			gamepad->changeCaptureContext(hWnd);
 			gamepad->changeCaptureContext(hWnd);
 	}
 	}
 
 
+	void Input::inputFocusLost()
+	{
+		mKeyboard->changeCaptureContext((UINT64)-1);
+		mMouse->changeCaptureContext((UINT64)-1);
+
+		for (auto& gamepad : mGamepads)
+			gamepad->changeCaptureContext((UINT64)-1);
+	}
+
 	void Input::_notifyMouseMoved(INT32 relX, INT32 relY, INT32 relZ)
 	void Input::_notifyMouseMoved(INT32 relX, INT32 relY, INT32 relZ)
 	{
 	{
 		mMouseSampleAccumulator[0] += relX;
 		mMouseSampleAccumulator[0] += relX;

+ 6 - 0
Source/BansheeCore/Input/BsInput.h

@@ -273,6 +273,12 @@ namespace bs
 		/** Called when window in focus changes, as reported by the OS. */
 		/** Called when window in focus changes, as reported by the OS. */
 		void inputWindowChanged(RenderWindow& win);
 		void inputWindowChanged(RenderWindow& win);
 
 
+		/**
+		 * Called when the current window loses input focus. This might be followed by inputWindowChanged() if the focus
+		 * just switched to another of this application's windows.
+		 */
+		void inputFocusLost();
+
 	private:
 	private:
 		Mutex mMutex;
 		Mutex mMutex;
 
 

+ 7 - 24
Source/BansheeCore/Linux/BsLinuxFolderMonitor.cpp

@@ -30,7 +30,7 @@ namespace bs
 
 
 	FolderMonitor::FolderWatchInfo::FolderWatchInfo(const Path& folderToMonitor, int inHandle, bool monitorSubdirectories,
 	FolderMonitor::FolderWatchInfo::FolderWatchInfo(const Path& folderToMonitor, int inHandle, bool monitorSubdirectories,
 													FolderChangeBits filter)
 													FolderChangeBits filter)
-		: folderToMonitor(folderToMonitor), dirHandle(0), monitorSubdirectories(monitorSubdirectories)
+		: folderToMonitor(folderToMonitor), dirHandle(inHandle), monitorSubdirectories(monitorSubdirectories)
 		, filter(filter)
 		, filter(filter)
 	{ }
 	{ }
 
 
@@ -66,6 +66,12 @@ namespace bs
 		String pathString = path.toString();
 		String pathString = path.toString();
 
 
 		INT32 watchHandle = inotify_add_watch(dirHandle, pathString.c_str(), IN_ALL_EVENTS);
 		INT32 watchHandle = inotify_add_watch(dirHandle, pathString.c_str(), IN_ALL_EVENTS);
+		if(watchHandle == -1)
+		{
+			String error = strerror(errno);
+			LOGERR("Unable to start folder monitor for path: \"" + pathString +"\". Error: " + error);
+		}
+
 		pathToHandle[path] = watchHandle;
 		pathToHandle[path] = watchHandle;
 		handleToPath[watchHandle] = path;
 		handleToPath[watchHandle] = path;
 	}
 	}
@@ -472,29 +478,6 @@ namespace bs
 
 
 		for(auto& action : m->activeFileActions)
 		for(auto& action : m->activeFileActions)
 		{
 		{
-			// Reported file actions might still be in progress (i.e. something might still be writing to those files).
-			// Sadly there doesn't seem to be a way to properly determine when those files are done being written, so instead
-			// we check for at least a couple of frames if the file's size hasn't changed before reporting a file action.
-			// This takes care of most of the issues and avoids reporting partially written files in almost all cases.
-			if (FileSystem::exists(action->newName))
-			{
-				UINT64 size = FileSystem::getFileSize(action->newName);
-				if (!action->checkForWriteStarted)
-				{
-					action->checkForWriteStarted = true;
-					action->lastSize = size;
-					continue;
-				}
-				else
-				{
-					if (action->lastSize != size)
-					{
-						action->lastSize = size;
-						continue;
-					}
-				}
-			}
-
 			switch (action->type)
 			switch (action->type)
 			{
 			{
 			case FileActionType::Added:
 			case FileActionType::Added:

+ 6 - 1
Source/BansheeCore/Linux/BsLinuxGamepad.cpp

@@ -14,6 +14,7 @@ namespace bs
 		GamepadInfo info;
 		GamepadInfo info;
 		INT32 fileHandle;
 		INT32 fileHandle;
 		ButtonCode povState;
 		ButtonCode povState;
+		bool hasInputFocus;
 	};
 	};
 
 
 	Gamepad::Gamepad(const String& name, const GamepadInfo& gamepadInfo, Input* owner)
 	Gamepad::Gamepad(const String& name, const GamepadInfo& gamepadInfo, Input* owner)
@@ -22,6 +23,7 @@ namespace bs
 		m = bs_new<Pimpl>();
 		m = bs_new<Pimpl>();
 		m->info = gamepadInfo;
 		m->info = gamepadInfo;
 		m->povState = BC_UNASSIGNED;
 		m->povState = BC_UNASSIGNED;
+		m->hasInputFocus = true;
 
 
 		String eventPath = "/dev/input/event" + toString(gamepadInfo.eventHandlerIdx);
 		String eventPath = "/dev/input/event" + toString(gamepadInfo.eventHandlerIdx);
 		m->fileHandle = open(eventPath.c_str(), O_RDWR | O_NONBLOCK);
 		m->fileHandle = open(eventPath.c_str(), O_RDWR | O_NONBLOCK);
@@ -59,6 +61,9 @@ namespace bs
 			if(numReadBytes < 0)
 			if(numReadBytes < 0)
 				break;
 				break;
 
 
+			if(!m->hasInputFocus)
+				continue;
+
 			UINT32 numEvents = numReadBytes / sizeof(input_event);
 			UINT32 numEvents = numReadBytes / sizeof(input_event);
 			for(UINT32 i = 0; i < numEvents; ++i)
 			for(UINT32 i = 0; i < numEvents; ++i)
 			{
 			{
@@ -150,7 +155,7 @@ namespace bs
 
 
 	void Gamepad::changeCaptureContext(UINT64 windowHandle)
 	void Gamepad::changeCaptureContext(UINT64 windowHandle)
 	{
 	{
-		// Do nothing
+		m->hasInputFocus = windowHandle != (UINT64)-1;
 	}
 	}
 }
 }
 
 

+ 6 - 1
Source/BansheeCore/Linux/BsLinuxKeyboard.cpp

@@ -14,6 +14,7 @@ namespace bs
 	struct Keyboard::Pimpl
 	struct Keyboard::Pimpl
 	{
 	{
 		INT32 fileHandles[MAX_DEVICES];
 		INT32 fileHandles[MAX_DEVICES];
+		bool hasInputFocus;
 	};
 	};
 
 
 	Keyboard::Keyboard(const String& name, Input* owner)
 	Keyboard::Keyboard(const String& name, Input* owner)
@@ -22,6 +23,7 @@ namespace bs
 		InputPrivateData* pvtData = owner->_getPrivateData();
 		InputPrivateData* pvtData = owner->_getPrivateData();
 
 
 		m = bs_new<Pimpl>();
 		m = bs_new<Pimpl>();
+		m->hasInputFocus = true;
 
 
 		for(UINT32 i = 0; i < MAX_DEVICES; i++)
 		for(UINT32 i = 0; i < MAX_DEVICES; i++)
 			m->fileHandles[i] = -1;
 			m->fileHandles[i] = -1;
@@ -61,6 +63,9 @@ namespace bs
 			if(m->fileHandles[i] == -1)
 			if(m->fileHandles[i] == -1)
 				continue;
 				continue;
 
 
+			if(!m->hasInputFocus)
+				continue;
+
 			while(true)
 			while(true)
 			{
 			{
 				ssize_t numReadBytes = read(m->fileHandles[i], &events, sizeof(events));
 				ssize_t numReadBytes = read(m->fileHandles[i], &events, sizeof(events));
@@ -93,7 +98,7 @@ namespace bs
 
 
 	void Keyboard::changeCaptureContext(UINT64 windowHandle)
 	void Keyboard::changeCaptureContext(UINT64 windowHandle)
 	{
 	{
-		// Do nothing
+		m->hasInputFocus = windowHandle != (UINT64)-1;
 	}
 	}
 }
 }
 
 

+ 6 - 1
Source/BansheeCore/Linux/BsLinuxMouse.cpp

@@ -14,6 +14,7 @@ namespace bs
 	struct Mouse::Pimpl
 	struct Mouse::Pimpl
 	{
 	{
 		INT32 fileHandles[MAX_DEVICES];
 		INT32 fileHandles[MAX_DEVICES];
+		bool hasInputFocus;
 	};
 	};
 
 
 	Mouse::Mouse(const String& name, Input* owner)
 	Mouse::Mouse(const String& name, Input* owner)
@@ -22,6 +23,7 @@ namespace bs
 		InputPrivateData* pvtData = owner->_getPrivateData();
 		InputPrivateData* pvtData = owner->_getPrivateData();
 
 
 		m = bs_new<Pimpl>();
 		m = bs_new<Pimpl>();
+		m->hasInputFocus = true;
 
 
 		for(UINT32 i = 0; i < MAX_DEVICES; i++)
 		for(UINT32 i = 0; i < MAX_DEVICES; i++)
 			m->fileHandles[i] = -1;
 			m->fileHandles[i] = -1;
@@ -71,6 +73,9 @@ namespace bs
 				if(numReadBytes < 0)
 				if(numReadBytes < 0)
 					break;
 					break;
 
 
+				if(!m->hasInputFocus)
+					continue;
+
 				UINT32 numEvents = numReadBytes / sizeof(input_event);
 				UINT32 numEvents = numReadBytes / sizeof(input_event);
 				for(UINT32 j = 0; j < numEvents; ++j)
 				for(UINT32 j = 0; j < numEvents; ++j)
 				{
 				{
@@ -156,7 +161,7 @@ namespace bs
 
 
 	void Mouse::changeCaptureContext(UINT64 windowHandle)
 	void Mouse::changeCaptureContext(UINT64 windowHandle)
 	{
 	{
-		// Do nothing
+		m->hasInputFocus = windowHandle != (UINT64)-1;
 	}
 	}
 }
 }
 
 

+ 21 - 4
Source/BansheeCore/Linux/BsLinuxWindow.cpp

@@ -128,6 +128,9 @@ namespace bs
 			XFreePixmap(display, pixmap);
 			XFreePixmap(display, pixmap);
 		}
 		}
 
 
+		if(!desc.showOnTaskBar)
+			showOnTaskbar(false);
+
 		m->hasTitleBar = desc.showDecorations;
 		m->hasTitleBar = desc.showDecorations;
 		m->resizeDisabled = !desc.allowResize;
 		m->resizeDisabled = !desc.allowResize;
 
 
@@ -183,8 +186,6 @@ namespace bs
 
 
 	void LinuxWindow::hide()
 	void LinuxWindow::hide()
 	{
 	{
-		// TODOPORT - Need to track all states so I can restore them on show()
-
 		XUnmapWindow(LinuxPlatform::getXDisplay(), m->xWindow);
 		XUnmapWindow(LinuxPlatform::getXDisplay(), m->xWindow);
 	}
 	}
 
 
@@ -192,8 +193,6 @@ namespace bs
 	{
 	{
 		XMapWindow(LinuxPlatform::getXDisplay(), m->xWindow);
 		XMapWindow(LinuxPlatform::getXDisplay(), m->xWindow);
 		XMoveResizeWindow(LinuxPlatform::getXDisplay(), m->xWindow, m->x, m->y, m->width, m->height);
 		XMoveResizeWindow(LinuxPlatform::getXDisplay(), m->xWindow, m->x, m->y, m->width, m->height);
-
-		// TODOPORT - Restore all states (pos, size and style)
 	}
 	}
 
 
 	void LinuxWindow::maximize()
 	void LinuxWindow::maximize()
@@ -447,6 +446,24 @@ namespace bs
 				SubstructureRedirectMask | SubstructureNotifyMask, &xev);
 				SubstructureRedirectMask | SubstructureNotifyMask, &xev);
 	}
 	}
 
 
+	void LinuxWindow::showOnTaskbar(bool enable)
+	{
+		Atom wmState = XInternAtom(LinuxPlatform::getXDisplay(), "_NET_WM_STATE", False);
+		Atom wmSkipTaskbar = XInternAtom(LinuxPlatform::getXDisplay(), "_NET_WM_STATE_SKIP_TASKBAR", False);
+
+		XEvent xev;
+		memset(&xev, 0, sizeof(xev));
+		xev.type = ClientMessage;
+		xev.xclient.window = m->xWindow;
+		xev.xclient.message_type = wmState;
+		xev.xclient.format = 32;
+		xev.xclient.data.l[0] = enable ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
+		xev.xclient.data.l[1] = wmSkipTaskbar;
+
+		XSendEvent(LinuxPlatform::getXDisplay(), DefaultRootWindow(LinuxPlatform::getXDisplay()), False,
+				SubstructureRedirectMask | SubstructureNotifyMask, &xev);
+	}
+
 	void LinuxWindow::_setFullscreen(bool fullscreen)
 	void LinuxWindow::_setFullscreen(bool fullscreen)
 	{
 	{
 		// Attempt to bypass compositor if switching to fullscreen
 		// Attempt to bypass compositor if switching to fullscreen

+ 4 - 0
Source/BansheeCore/Linux/BsLinuxWindow.h

@@ -27,6 +27,7 @@ namespace bs
 		bool showDecorations;
 		bool showDecorations;
 		bool allowResize;
 		bool allowResize;
 		bool modal;
 		bool modal;
+		bool showOnTaskBar;
 		::Window parent;
 		::Window parent;
 		XVisualInfo visualInfo;
 		XVisualInfo visualInfo;
 		SPtr<PixelData> background;
 		SPtr<PixelData> background;
@@ -153,6 +154,9 @@ namespace bs
 		 */
 		 */
 		void minimize(bool enable);
 		void minimize(bool enable);
 
 
+		/** Shows or hides the window icon from the taskbar. */
+		void showOnTaskbar(bool enable);
+
 		/**
 		/**
 		 * Shows or hides window decorations. Decorations include window title bar, border and similar. Essentially anything
 		 * Shows or hides window decorations. Decorations include window title bar, border and similar. Essentially anything
 		 * not part of the main rendering area.
 		 * not part of the main rendering area.

+ 8 - 8
Source/BansheeCore/RenderAPI/BsRenderWindow.h

@@ -20,12 +20,12 @@ namespace bs
 	{
 	{
 		RENDER_WINDOW_DESC()
 		RENDER_WINDOW_DESC()
 		: fullscreen(false), vsync(false), vsyncInterval(1), hidden(false), depthBuffer(true)
 		: fullscreen(false), vsync(false), vsyncInterval(1), hidden(false), depthBuffer(true)
-			, multisampleCount(0), multisampleHint(""), gamma(false), left(-1), top(-1)
-			, title(""), border(WindowBorder::Normal), outerDimensions(false), enableDoubleClick(true)
-			, toolWindow(false), modal(false), hideUntilSwap(false)
+		, multisampleCount(0), multisampleHint(""), gamma(false), left(-1), top(-1), title("")
+		, showTitleBar(true), showBorder(true), allowResize(true), toolWindow (false), modal(false)
+		, hideUntilSwap(false)
 		{ }
 		{ }
 
 
-		VideoMode videoMode; /**< A set of frame buffer options. */
+		VideoMode videoMode; /**< Output monitor, frame buffer resize and refresh rate. */
 		bool fullscreen; /**< Should the window be opened in fullscreen mode. */
 		bool fullscreen; /**< Should the window be opened in fullscreen mode. */
 		bool vsync; /**< Should the window wait for vertical sync before swapping buffers. */
 		bool vsync; /**< Should the window wait for vertical sync before swapping buffers. */
 		UINT32 vsyncInterval; /**< Determines how many vsync intervals occur per frame. FPS = refreshRate/interval. Usually 1 when vsync active. */
 		UINT32 vsyncInterval; /**< Determines how many vsync intervals occur per frame. FPS = refreshRate/interval. Usually 1 when vsync active. */
@@ -37,10 +37,10 @@ namespace bs
 		INT32 left; /**< Window origin on X axis in pixels. -1 == screen center. Relative to monitor provided in videoMode. */
 		INT32 left; /**< Window origin on X axis in pixels. -1 == screen center. Relative to monitor provided in videoMode. */
 		INT32 top; /**< Window origin on Y axis in pixels. -1 == screen center. Relative to monitor provided in videoMode. */
 		INT32 top; /**< Window origin on Y axis in pixels. -1 == screen center. Relative to monitor provided in videoMode. */
 		String title; /**< Title of the window. */
 		String title; /**< Title of the window. */
-		WindowBorder border; /**< Type of border to create the window with. */
-		bool outerDimensions; /**< Do our dimensions include space for things like title-bar and border. */
-		bool enableDoubleClick; /**< Does window accept double-clicks. */
-		bool toolWindow; /**< Tool windows have a different style than normal windows and can be created with no border or title bar. */
+		bool showTitleBar; /**< Determines if the title-bar should be shown or not. */
+		bool showBorder; /**< Determines if the window border should be shown or not. */
+		bool allowResize; /**< Determines if the user can resize the window by dragging on the window edges. */
+		bool toolWindow; /**< Tool windows have a different look than normal windows and have no task bar entry. */
 		bool modal; /**< When a modal window is open all other windows will be locked until modal window is closed. */
 		bool modal; /**< When a modal window is open all other windows will be locked until modal window is closed. */
 		bool hideUntilSwap; /**< Window will be created as hidden and only be shown when the first framebuffer swap happens. */
 		bool hideUntilSwap; /**< Window will be created as hidden and only be shown when the first framebuffer swap happens. */
 
 

+ 5 - 3
Source/BansheeD3D11RenderAPI/BsD3D11RenderWindow.cpp

@@ -111,15 +111,17 @@ namespace bs
 		mMultisampleType.Quality = 0;
 		mMultisampleType.Quality = 0;
 
 
 		WINDOW_DESC windowDesc;
 		WINDOW_DESC windowDesc;
-		windowDesc.border = mDesc.border;
-		windowDesc.enableDoubleClick = mDesc.enableDoubleClick;
+		windowDesc.showTitleBar = mDesc.showTitleBar;
+		windowDesc.showBorder = mDesc.showBorder;
+		windowDesc.allowResize = mDesc.allowResize;
+		windowDesc.enableDoubleClick = true;
 		windowDesc.fullscreen = mDesc.fullscreen;
 		windowDesc.fullscreen = mDesc.fullscreen;
 		windowDesc.width = mDesc.videoMode.getWidth();
 		windowDesc.width = mDesc.videoMode.getWidth();
 		windowDesc.height = mDesc.videoMode.getHeight();
 		windowDesc.height = mDesc.videoMode.getHeight();
 		windowDesc.hidden = mDesc.hidden || mDesc.hideUntilSwap;
 		windowDesc.hidden = mDesc.hidden || mDesc.hideUntilSwap;
 		windowDesc.left = mDesc.left;
 		windowDesc.left = mDesc.left;
 		windowDesc.top = mDesc.top;
 		windowDesc.top = mDesc.top;
-		windowDesc.outerDimensions = mDesc.outerDimensions;
+		windowDesc.outerDimensions = false;
 		windowDesc.title = mDesc.title;
 		windowDesc.title = mDesc.title;
 		windowDesc.toolWindow = mDesc.toolWindow;
 		windowDesc.toolWindow = mDesc.toolWindow;
 		windowDesc.creationParams = this;
 		windowDesc.creationParams = this;

+ 2 - 1
Source/BansheeEditor/BsEditorApplication.cpp

@@ -49,7 +49,8 @@ namespace bs
 		startUpDesc.primaryWindowDesc.videoMode = VideoMode(1920, 1080);
 		startUpDesc.primaryWindowDesc.videoMode = VideoMode(1920, 1080);
 		startUpDesc.primaryWindowDesc.title = "BansheeEditor";
 		startUpDesc.primaryWindowDesc.title = "BansheeEditor";
 		startUpDesc.primaryWindowDesc.fullscreen = false;
 		startUpDesc.primaryWindowDesc.fullscreen = false;
-		startUpDesc.primaryWindowDesc.border = WindowBorder::None;
+		startUpDesc.primaryWindowDesc.showTitleBar = false;
+		startUpDesc.primaryWindowDesc.showBorder = false;
 		startUpDesc.primaryWindowDesc.hideUntilSwap = true;
 		startUpDesc.primaryWindowDesc.hideUntilSwap = true;
 		startUpDesc.primaryWindowDesc.depthBuffer = false;
 		startUpDesc.primaryWindowDesc.depthBuffer = false;
 
 

+ 3 - 2
Source/BansheeEditor/EditorWindow/BsEditorWindowBase.cpp

@@ -30,12 +30,13 @@ namespace bs
 			top = mainWindow->getTop() + mainWindow->getHeight() / 2 - height / 2;
 			top = mainWindow->getTop() + mainWindow->getHeight() / 2 - height / 2;
 		}
 		}
 
 
-
 		RENDER_WINDOW_DESC renderWindowDesc;
 		RENDER_WINDOW_DESC renderWindowDesc;
 		renderWindowDesc.videoMode = VideoMode(width, height);
 		renderWindowDesc.videoMode = VideoMode(width, height);
 		renderWindowDesc.title = "EditorWindow";
 		renderWindowDesc.title = "EditorWindow";
 		renderWindowDesc.fullscreen = false;
 		renderWindowDesc.fullscreen = false;
-		renderWindowDesc.border = WindowBorder::None;
+		renderWindowDesc.showTitleBar = false;
+		renderWindowDesc.showBorder = false;
+		renderWindowDesc.allowResize = !isModal;
 		renderWindowDesc.toolWindow = true;
 		renderWindowDesc.toolWindow = true;
 		renderWindowDesc.modal = isModal;
 		renderWindowDesc.modal = isModal;
 		renderWindowDesc.hideUntilSwap = true;
 		renderWindowDesc.hideUntilSwap = true;

+ 3 - 2
Source/BansheeGLRenderAPI/Linux/BsLinuxRenderWindow.cpp

@@ -107,8 +107,9 @@ namespace bs
 		windowDesc.width = mDesc.videoMode.getWidth();
 		windowDesc.width = mDesc.videoMode.getWidth();
 		windowDesc.height = mDesc.videoMode.getHeight();
 		windowDesc.height = mDesc.videoMode.getHeight();
 		windowDesc.title = mDesc.title;
 		windowDesc.title = mDesc.title;
-		windowDesc.showDecorations = !mDesc.toolWindow;
-		windowDesc.allowResize = true;
+		windowDesc.showDecorations = mDesc.showTitleBar;
+		windowDesc.allowResize = mDesc.allowResize;
+		windowDesc.showOnTaskBar = !mDesc.toolWindow;
 		windowDesc.modal = mDesc.modal;
 		windowDesc.modal = mDesc.modal;
 		windowDesc.visualInfo = visualConfig.visualInfo;
 		windowDesc.visualInfo = visualConfig.visualInfo;
 		windowDesc.screen = mDesc.videoMode.getOutputIdx();
 		windowDesc.screen = mDesc.videoMode.getOutputIdx();

+ 5 - 3
Source/BansheeGLRenderAPI/Win32/BsWin32RenderWindow.cpp

@@ -115,15 +115,17 @@ namespace bs
 		mDisplayFrequency = Math::roundToInt(mDesc.videoMode.getRefreshRate());
 		mDisplayFrequency = Math::roundToInt(mDesc.videoMode.getRefreshRate());
 
 
 		WINDOW_DESC windowDesc;
 		WINDOW_DESC windowDesc;
-		windowDesc.border = mDesc.border;
-		windowDesc.enableDoubleClick = mDesc.enableDoubleClick;
+		windowDesc.showTitleBar = mDesc.showTitleBar;
+		windowDesc.showBorder = mDesc.showBorder;
+		windowDesc.allowResize = mDesc.allowResize;
+		windowDesc.enableDoubleClick = true;
 		windowDesc.fullscreen = mDesc.fullscreen;
 		windowDesc.fullscreen = mDesc.fullscreen;
 		windowDesc.width = mDesc.videoMode.getWidth();
 		windowDesc.width = mDesc.videoMode.getWidth();
 		windowDesc.height = mDesc.videoMode.getHeight();
 		windowDesc.height = mDesc.videoMode.getHeight();
 		windowDesc.hidden = mDesc.hidden || mDesc.hideUntilSwap;
 		windowDesc.hidden = mDesc.hidden || mDesc.hideUntilSwap;
 		windowDesc.left = mDesc.left;
 		windowDesc.left = mDesc.left;
 		windowDesc.top = mDesc.top;
 		windowDesc.top = mDesc.top;
-		windowDesc.outerDimensions = mDesc.outerDimensions;
+		windowDesc.outerDimensions = false;
 		windowDesc.title = mDesc.title;
 		windowDesc.title = mDesc.title;
 		windowDesc.toolWindow = mDesc.toolWindow;
 		windowDesc.toolWindow = mDesc.toolWindow;
 		windowDesc.creationParams = this;
 		windowDesc.creationParams = this;

+ 13 - 5
Source/BansheeUtility/Win32/BsWin32Window.cpp

@@ -100,12 +100,20 @@ namespace bs
 
 
 				if (!desc.parent || desc.toolWindow)
 				if (!desc.parent || desc.toolWindow)
 				{
 				{
-					if (desc.border == WindowBorder::None)
-						m->style |= WS_POPUP;
-					else if (desc.border == WindowBorder::Fixed)
-						m->style |= WS_OVERLAPPED | WS_BORDER | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
+					if(desc.showTitleBar)
+					{
+						if(desc.showBorder || desc.allowResize)
+							m->style |= WS_OVERLAPPEDWINDOW;
+						else
+							m->style |= WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
+					}
 					else
 					else
-						m->style |= WS_OVERLAPPEDWINDOW;
+					{
+						if(desc.showBorder || desc.allowResize)
+							m->style |= WS_POPUP | WS_BORDER;
+						else
+							m->style |= WS_POPUP;
+					}
 				}
 				}
 
 
 				if (!desc.outerDimensions)
 				if (!desc.outerDimensions)

+ 8 - 6
Source/BansheeUtility/Win32/BsWin32Window.h

@@ -21,9 +21,10 @@ namespace bs
 	{
 	{
 		WINDOW_DESC()
 		WINDOW_DESC()
 			: module(nullptr), monitor(nullptr), parent(nullptr), external(nullptr), creationParams(nullptr), width(0)
 			: module(nullptr), monitor(nullptr), parent(nullptr), external(nullptr), creationParams(nullptr), width(0)
-			, height(0), fullscreen(false), hidden(false), left(-1), top(-1), title(""), border(WindowBorder::Normal)
-			, outerDimensions(false), enableDoubleClick(true), toolWindow(false), backgroundPixels(nullptr)
-			, backgroundWidth(0), backgroundHeight(0), alphaBlending(false), modal(false), wndProc(nullptr)
+			, height(0), fullscreen(false), hidden(false), left(-1), top(-1), title(""), showTitleBar(true)
+			, showBorder(true), allowResize(true), outerDimensions(false), enableDoubleClick(true)
+			, toolWindow(false), backgroundPixels(nullptr), backgroundWidth(0), backgroundHeight(0)
+			, alphaBlending(false), modal(false), wndProc(nullptr)
 		{ }
 		{ }
 
 
 		HINSTANCE module; /**< Instance to the local module. */
 		HINSTANCE module; /**< Instance to the local module. */
@@ -38,11 +39,12 @@ namespace bs
 		INT32 left; /**< Window origin on X axis in pixels. -1 == screen center. Relative to provided monitor. */
 		INT32 left; /**< Window origin on X axis in pixels. -1 == screen center. Relative to provided monitor. */
 		INT32 top; /**< Window origin on Y axis in pixels. -1 == screen center. Relative to provided monitor. */
 		INT32 top; /**< Window origin on Y axis in pixels. -1 == screen center. Relative to provided monitor. */
 		String title; /**< Title of the window. */
 		String title; /**< Title of the window. */
-		WindowBorder border; /**< Type of border to create the window with. */
+		bool showTitleBar; /**< Determines if the title-bar should be shown or not. */
+		bool showBorder; /**< Determines if the window border should be shown or not. */
+		bool allowResize; /**< Determines if the user can resize the window by dragging on the window edges. */
 		bool outerDimensions; /**< Do our dimensions include space for things like title-bar and border. */
 		bool outerDimensions; /**< Do our dimensions include space for things like title-bar and border. */
 		bool enableDoubleClick; /**< Does window accept double-clicks. */
 		bool enableDoubleClick; /**< Does window accept double-clicks. */
-		/** Tool windows have a different style than normal windows and can be created with no border or title bar. */
-		bool toolWindow; 
+		bool toolWindow; /**< Tool windows have a different look than normal windows and have no task bar entry. */
 		/**
 		/**
 		 * Optional background image to apply to the window. This must be a buffer of size 
 		 * Optional background image to apply to the window. This must be a buffer of size 
 		 * backgroundWidth * backgroundHeight. 
 		 * backgroundWidth * backgroundHeight. 

+ 5 - 3
Source/BansheeVulkanRenderAPI/Win32/BsWin32RenderWindow.cpp

@@ -97,15 +97,17 @@ namespace bs
 
 
 		// Create a window
 		// Create a window
 		WINDOW_DESC windowDesc;
 		WINDOW_DESC windowDesc;
-		windowDesc.border = mDesc.border;
-		windowDesc.enableDoubleClick = mDesc.enableDoubleClick;
+		windowDesc.showTitleBar = mDesc.showTitleBar;
+		windowDesc.showBorder = mDesc.showBorder;
+		windowDesc.allowResize = mDesc.allowResize;
+		windowDesc.enableDoubleClick = true;
 		windowDesc.fullscreen = mDesc.fullscreen;
 		windowDesc.fullscreen = mDesc.fullscreen;
 		windowDesc.width = mDesc.videoMode.getWidth();
 		windowDesc.width = mDesc.videoMode.getWidth();
 		windowDesc.height = mDesc.videoMode.getHeight();
 		windowDesc.height = mDesc.videoMode.getHeight();
 		windowDesc.hidden = mDesc.hidden || mDesc.hideUntilSwap;
 		windowDesc.hidden = mDesc.hidden || mDesc.hideUntilSwap;
 		windowDesc.left = mDesc.left;
 		windowDesc.left = mDesc.left;
 		windowDesc.top = mDesc.top;
 		windowDesc.top = mDesc.top;
-		windowDesc.outerDimensions = mDesc.outerDimensions;
+		windowDesc.outerDimensions = false;
 		windowDesc.title = mDesc.title;
 		windowDesc.title = mDesc.title;
 		windowDesc.toolWindow = mDesc.toolWindow;
 		windowDesc.toolWindow = mDesc.toolWindow;
 		windowDesc.creationParams = this;
 		windowDesc.creationParams = this;