mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
Use dynamic_cast to convert QWindow m_target to gs_frame
Used to access get_mouse_lock_state rather than going through the QWindow property tables. Modify mouse hide and lock to default OFF when entering Windowed mode, and to default ON when entering Fullscreen unless 'show cursor in fullscreen' is configured
This commit is contained in:
parent
ca3ee019cc
commit
ae0e454fc2
5 changed files with 22 additions and 25 deletions
|
@ -2,6 +2,7 @@
|
|||
#include "pad_thread.h"
|
||||
#include "Emu/Io/pad_config.h"
|
||||
#include "Input/product_info.h"
|
||||
#include "rpcs3qt/gs_frame.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
|
@ -315,13 +316,8 @@ void keyboard_pad_handler::mouseReleaseEvent(QMouseEvent* event)
|
|||
|
||||
bool keyboard_pad_handler::get_mouse_lock_state()
|
||||
{
|
||||
if (m_target)
|
||||
{
|
||||
auto mouse_locked = m_target->property("mouse_locked");
|
||||
if (mouse_locked.isValid())
|
||||
return mouse_locked.toBool();
|
||||
return false;
|
||||
}
|
||||
if (auto game_frame = dynamic_cast<gs_frame*>(m_target))
|
||||
return game_frame->get_mouse_lock_state();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue