diff --git a/common/mainwindow.cpp b/common/mainwindow.cpp index 47b1077ff..728a15bd4 100644 --- a/common/mainwindow.cpp +++ b/common/mainwindow.cpp @@ -44,8 +44,10 @@ MainWindow::MainWindow(Device& device) setWindowTitle("Gothic II"); else setWindowTitle("Gothic"); - if(!CommandLine::inst().isWindowMode()) + if(!CommandLine::inst().isWindowMode()) { setFullscreen(true); + setCursorShape(CursorShape::Hidden); + } //renderer.resetSwapchain(); setupUi(); @@ -295,10 +297,10 @@ void MainWindow::resizeEvent(SizeEvent&) { if(auto camera = Gothic::inst().camera()) camera->setViewport(swapchain.w(),swapchain.h()); - const bool fs = SystemApi::isFullscreen(hwnd()); - auto rect = SystemApi::windowClientRect(hwnd()); - setCursorPosition(rect.w/2,rect.h/2); - setCursorShape(fs ? CursorShape::Hidden : CursorShape::Arrow); + if(SystemApi::isFullscreen(hwnd())) { + setCursorPosition(Point(w()/2,h()/2)); + } + dMouse = Point(); } @@ -560,8 +562,9 @@ void MainWindow::focusEvent(FocusEvent &event) { if(!event.in) return; dMouse = Point(); - auto center = Point(w()/2,h()/2); - setCursorPosition(center); + + if(SystemApi::isFullscreen(hwnd())) + setCursorPosition(Point(w()/2,h()/2)); } void MainWindow::paintFocus(Painter& p, const Focus& focus, const Matrix4x4& vp) {