mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-12-25 01:11:48 +01:00
frontend: Fix clicking primary screen window touching screen. (#6707)
This commit is contained in:
parent
71582a72a4
commit
a9e390b1b1
@ -55,15 +55,17 @@ EmuWindow::EmuWindow(bool is_secondary_) : is_secondary{is_secondary_} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EmuWindow::~EmuWindow() = default;
|
EmuWindow::~EmuWindow() = default;
|
||||||
/**
|
|
||||||
* Check if the given x/y coordinates are within the touchpad specified by the framebuffer layout
|
bool EmuWindow::IsWithinTouchscreen(const Layout::FramebufferLayout& layout, unsigned framebuffer_x,
|
||||||
* @param layout FramebufferLayout object describing the framebuffer size and screen positions
|
|
||||||
* @param framebuffer_x Framebuffer x-coordinate to check
|
|
||||||
* @param framebuffer_y Framebuffer y-coordinate to check
|
|
||||||
* @return True if the coordinates are within the touchpad, otherwise false
|
|
||||||
*/
|
|
||||||
static bool IsWithinTouchscreen(const Layout::FramebufferLayout& layout, unsigned framebuffer_x,
|
|
||||||
unsigned framebuffer_y) {
|
unsigned framebuffer_y) {
|
||||||
|
#ifndef ANDROID
|
||||||
|
// If separate windows and the touch is in the primary (top) screen, ignore it.
|
||||||
|
if (Settings::values.layout_option.GetValue() == Settings::LayoutOption::SeparateWindows &&
|
||||||
|
!is_secondary && !Settings::values.swap_screen.GetValue()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (Settings::values.render_3d.GetValue() == Settings::StereoRenderOption::SideBySide) {
|
if (Settings::values.render_3d.GetValue() == Settings::StereoRenderOption::SideBySide) {
|
||||||
return (framebuffer_y >= layout.bottom_screen.top &&
|
return (framebuffer_y >= layout.bottom_screen.top &&
|
||||||
framebuffer_y < layout.bottom_screen.bottom &&
|
framebuffer_y < layout.bottom_screen.bottom &&
|
||||||
|
@ -288,6 +288,17 @@ private:
|
|||||||
|
|
||||||
void CreateTouchState();
|
void CreateTouchState();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the given x/y coordinates are within the touchpad specified by the framebuffer
|
||||||
|
* layout
|
||||||
|
* @param layout FramebufferLayout object describing the framebuffer size and screen positions
|
||||||
|
* @param framebuffer_x Framebuffer x-coordinate to check
|
||||||
|
* @param framebuffer_y Framebuffer y-coordinate to check
|
||||||
|
* @return True if the coordinates are within the touchpad, otherwise false
|
||||||
|
*/
|
||||||
|
bool IsWithinTouchscreen(const Layout::FramebufferLayout& layout, unsigned framebuffer_x,
|
||||||
|
unsigned framebuffer_y);
|
||||||
|
|
||||||
Layout::FramebufferLayout framebuffer_layout; ///< Current framebuffer layout
|
Layout::FramebufferLayout framebuffer_layout; ///< Current framebuffer layout
|
||||||
|
|
||||||
WindowConfig config{}; ///< Internal configuration (changes pending for being applied in
|
WindowConfig config{}; ///< Internal configuration (changes pending for being applied in
|
||||||
|
Loading…
Reference in New Issue
Block a user