Fix #9340 (touch controls not always getting repositioned correctly)

This commit is contained in:
Henrik Rydgard 2017-02-23 09:25:33 +01:00
parent 607838b90c
commit 900539e200
4 changed files with 26 additions and 17 deletions

View file

@ -182,6 +182,7 @@ void TextureCacheVulkan::DeviceRestore(VulkanContext *vulkan) {
void TextureCacheVulkan::ReleaseTexture(TexCacheEntry *entry) {
DEBUG_LOG(G3D, "Deleting texture %p", entry->vkTex);
delete entry->vkTex;
entry->vkTex = nullptr;
}
VkFormat getClutDestFormatVulkan(GEPaletteFormat format) {

View file

@ -1119,3 +1119,7 @@ void EmuScreen::releaseButtons() {
input.id = 0;
touch(input);
}
void EmuScreen::resized() {
RecreateViews();
}

View file

@ -41,6 +41,7 @@ public:
void deviceRestore() override;
void dialogFinished(const Screen *dialog, DialogResult result) override;
void sendMessage(const char *msg, const char *value) override;
void resized() override;
bool touch(const TouchInput &touch) override;
bool key(const KeyInput &key) override;

View file

@ -774,7 +774,26 @@ void NativeRender(GraphicsContext *graphicsContext) {
if (resized) {
resized = false;
if (uiContext) {
// Modifying the bounds here can be used to "inset" the whole image to gain borders for TV overscan etc.
// The UI now supports any offset but not the EmuScreen yet.
uiContext->SetBounds(Bounds(0, 0, dp_xres, dp_yres));
// uiContext->SetBounds(Bounds(dp_xres/2, 0, dp_xres / 2, dp_yres / 2));
// OSX 10.6 and SDL 1.2 bug.
#if defined(__APPLE__) && !defined(USING_QT_UI)
static int dp_xres_old = dp_xres;
if (dp_xres != dp_xres_old) {
// uiTexture->Load("ui_atlas.zim");
dp_xres_old = dp_xres;
}
#endif
}
graphicsContext->Resize();
screenManager->resized();
// TODO: Move this to new GraphicsContext objects for each backend.
#ifndef _WIN32
@ -991,24 +1010,8 @@ void NativeMessageReceived(const char *message, const char *value) {
}
void NativeResized() {
// NativeResized can come from any thread so we just set a flag, then process it later.
resized = true;
if (uiContext) {
// Modifying the bounds here can be used to "inset" the whole image to gain borders for TV overscan etc.
// The UI now supports any offset but not the EmuScreen yet.
uiContext->SetBounds(Bounds(0, 0, dp_xres, dp_yres));
// uiContext->SetBounds(Bounds(dp_xres/2, 0, dp_xres / 2, dp_yres / 2));
// OSX 10.6 and SDL 1.2 bug.
#if defined(__APPLE__) && !defined(USING_QT_UI)
static int dp_xres_old=dp_xres;
if (dp_xres != dp_xres_old) {
// uiTexture->Load("ui_atlas.zim");
dp_xres_old = dp_xres;
}
#endif
}
}
void NativeShutdown() {