From a71e9f17841f7510ba4563d55c80962c0200c983 Mon Sep 17 00:00:00 2001 From: Abendlied Date: Thu, 3 Sep 2026 22:30:02 +0200 Subject: [PATCH 1/3] Fix cursor visibility on startup and focus --- common/mainwindow.cpp | 8 +++----- lib/Tempest | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/common/mainwindow.cpp b/common/mainwindow.cpp index 47b1077ff..ed907858d 100644 --- a/common/mainwindow.cpp +++ b/common/mainwindow.cpp @@ -37,6 +37,7 @@ MainWindow::MainWindow(Device& device) mobileUi(player), #endif player(dialogs,inventory) { + setCursorShape(CursorShape::Hidden); Gothic::inst().onSettingsChanged.bind(this,&MainWindow::onSettings); onSettings(); @@ -294,11 +295,7 @@ void MainWindow::resizeEvent(SizeEvent&) { swapchain.reset(); 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); + setCursorPosition(Point(w()/2,h()/2)); dMouse = Point(); } @@ -557,6 +554,7 @@ void MainWindow::keyUpEvent(KeyEvent &event) { } void MainWindow::focusEvent(FocusEvent &event) { + setCursorShape(event.in ? CursorShape::Hidden : CursorShape::Arrow); if(!event.in) return; dMouse = Point(); diff --git a/lib/Tempest b/lib/Tempest index 7b7f85b12..270e8846e 160000 --- a/lib/Tempest +++ b/lib/Tempest @@ -1 +1 @@ -Subproject commit 7b7f85b126cc8419f3a8cc63c3d7b6c4984fa58e +Subproject commit 270e8846e8d82bed2413b2d318db2246bd564bde From 3c70e1dca2b07ec48a402ab1ee0031ed5bcab959 Mon Sep 17 00:00:00 2001 From: Abendlied Date: Fri, 11 Sep 2026 15:54:42 +0200 Subject: [PATCH 2/3] Fix cursor visibility in fullscreen mode --- common/mainwindow.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/common/mainwindow.cpp b/common/mainwindow.cpp index ed907858d..728a15bd4 100644 --- a/common/mainwindow.cpp +++ b/common/mainwindow.cpp @@ -37,7 +37,6 @@ MainWindow::MainWindow(Device& device) mobileUi(player), #endif player(dialogs,inventory) { - setCursorShape(CursorShape::Hidden); Gothic::inst().onSettingsChanged.bind(this,&MainWindow::onSettings); onSettings(); @@ -45,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,7 +296,11 @@ void MainWindow::resizeEvent(SizeEvent&) { swapchain.reset(); if(auto camera = Gothic::inst().camera()) camera->setViewport(swapchain.w(),swapchain.h()); - setCursorPosition(Point(w()/2,h()/2)); + + if(SystemApi::isFullscreen(hwnd())) { + setCursorPosition(Point(w()/2,h()/2)); + } + dMouse = Point(); } @@ -554,12 +559,12 @@ void MainWindow::keyUpEvent(KeyEvent &event) { } void MainWindow::focusEvent(FocusEvent &event) { - setCursorShape(event.in ? CursorShape::Hidden : CursorShape::Arrow); 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) { From 89c8fb4e8425a4c247759e95655b91c0a8ed4eac Mon Sep 17 00:00:00 2001 From: Try Date: Sun, 13 Sep 2026 23:50:37 +0200 Subject: [PATCH 3/3] cancel submodule change (no dependency there) --- lib/Tempest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Tempest b/lib/Tempest index 270e8846e..d2a86425b 160000 --- a/lib/Tempest +++ b/lib/Tempest @@ -1 +1 @@ -Subproject commit 270e8846e8d82bed2413b2d318db2246bd564bde +Subproject commit d2a86425bc952bd80e08e439bf248c1da16ee19c