aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/bootmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu/bootmanager.cpp')
-rw-r--r--src/yuzu/bootmanager.cpp28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 7524e3c407..25b658b2a9 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -64,12 +64,13 @@ void EmuThread::run() {
emit LoadProgress(VideoCore::LoadCallbackStage::Prepare, 0, 0);
- system.Renderer().ReadRasterizer()->LoadDiskResources(
- system.CurrentProcess()->GetTitleID(), stop_token,
- [this](VideoCore::LoadCallbackStage stage, std::size_t value, std::size_t total) {
- emit LoadProgress(stage, value, total);
- });
-
+ if (Settings::values.use_disk_shader_cache.GetValue()) {
+ system.Renderer().ReadRasterizer()->LoadDiskResources(
+ system.CurrentProcess()->GetTitleID(), stop_token,
+ [this](VideoCore::LoadCallbackStage stage, std::size_t value, std::size_t total) {
+ emit LoadProgress(stage, value, total);
+ });
+ }
emit LoadProgress(VideoCore::LoadCallbackStage::Complete, 0, 0);
gpu.ReleaseContext();
@@ -411,8 +412,9 @@ void GRenderWindow::mousePressEvent(QMouseEvent* event) {
if (event->source() == Qt::MouseEventSynthesizedBySystem) {
return;
}
-
- auto pos = event->pos();
+ // Qt sometimes returns the parent coordinates. To avoid this we read the global mouse
+ // coordinates and map them to the current render area
+ const auto pos = mapFromGlobal(QCursor::pos());
const auto [x, y] = ScaleTouch(pos);
const auto button = QtButtonToMouseButton(event->button());
input_subsystem->GetMouse()->PressButton(x, y, button);
@@ -429,7 +431,9 @@ void GRenderWindow::mouseMoveEvent(QMouseEvent* event) {
if (event->source() == Qt::MouseEventSynthesizedBySystem) {
return;
}
- auto pos = event->pos();
+ // Qt sometimes returns the parent coordinates. To avoid this we read the global mouse
+ // coordinates and map them to the current render area
+ const auto pos = mapFromGlobal(QCursor::pos());
const auto [x, y] = ScaleTouch(pos);
const int center_x = width() / 2;
const int center_y = height() / 2;
@@ -564,6 +568,12 @@ std::unique_ptr<Core::Frontend::GraphicsContext> GRenderWindow::CreateSharedCont
bool GRenderWindow::InitRenderTarget() {
ReleaseRenderTarget();
+ {
+ // Create a dummy render widget so that Qt
+ // places the render window at the correct position.
+ const RenderWidget dummy_widget{this};
+ }
+
first_frame = false;
switch (Settings::values.renderer_backend.GetValue()) {