mirror of
https://github.com/PCSX2/pcsx2.git
synced 2024-10-07 15:33:29 +00:00
Wayland fixes (#5979)
* Linux/PAD: only attempt to reset X screensaver on X11 This would previously crash PCSX2 after 4096 frames on Wayland. * Linux: only grab pointer on X11 This silently disables the functionality on Wayland, but that's one step better than the previous behaviour: PCSX2 would crash when Shift-F12 was pressed.
This commit is contained in:
parent
d1117aafac
commit
8c9ae90753
@ -37,7 +37,7 @@
|
|||||||
#include "wx_dialog/dialog.h"
|
#include "wx_dialog/dialog.h"
|
||||||
|
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
Display* GSdsp;
|
Display* GSdsp = nullptr;
|
||||||
Window GSwin;
|
Window GSwin;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ void PADupdate(int pad)
|
|||||||
// Emulate an user activity
|
// Emulate an user activity
|
||||||
static int count = 0;
|
static int count = 0;
|
||||||
count++;
|
count++;
|
||||||
if ((count & 0xFFF) == 0)
|
if (GSdsp && (count & 0xFFF) == 0)
|
||||||
{
|
{
|
||||||
// 1 call every 4096 Vsync is enough
|
// 1 call every 4096 Vsync is enough
|
||||||
XResetScreenSaver(GSdsp);
|
XResetScreenSaver(GSdsp);
|
||||||
|
@ -194,7 +194,7 @@ void AnalyzeKeyEvent(HostKeyEvent& evt)
|
|||||||
#ifdef __unix__
|
#ifdef __unix__
|
||||||
if (evt.key == XK_Shift_R || evt.key == XK_Shift_L)
|
if (evt.key == XK_Shift_R || evt.key == XK_Shift_L)
|
||||||
s_Shift = true;
|
s_Shift = true;
|
||||||
if (evt.key == XK_F12 && s_Shift)
|
if (evt.key == XK_F12 && s_Shift && GSdsp)
|
||||||
{
|
{
|
||||||
if (!s_grab_input)
|
if (!s_grab_input)
|
||||||
{
|
{
|
||||||
|
@ -73,7 +73,7 @@ HWND gsWnd = nullptr;
|
|||||||
#include "gtk.h"
|
#include "gtk.h"
|
||||||
#include <gdk/gdkx.h>
|
#include <gdk/gdkx.h>
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
Display* g_GSdsp;
|
Display* g_GSdsp = nullptr;
|
||||||
Window g_GSwin;
|
Window g_GSwin;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -206,7 +206,7 @@ namespace usb_hid
|
|||||||
if (event.code == KEY_LEFTSHIFT || event.code == KEY_RIGHTSHIFT)
|
if (event.code == KEY_LEFTSHIFT || event.code == KEY_RIGHTSHIFT)
|
||||||
shift = (event.value > 0);
|
shift = (event.value > 0);
|
||||||
|
|
||||||
if (event.code == KEY_F12 && (event.value == 1) && shift)
|
if (event.code == KEY_F12 && (event.value == 1) && shift && g_GSdsp)
|
||||||
{
|
{
|
||||||
if (!grabbed)
|
if (!grabbed)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user