mirror of https://github.com/PCSX2/pcsx2.git
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"
|
||||
|
||||
#ifndef __APPLE__
|
||||
Display* GSdsp;
|
||||
Display* GSdsp = nullptr;
|
||||
Window GSwin;
|
||||
#endif
|
||||
|
||||
|
@ -263,7 +263,7 @@ void PADupdate(int pad)
|
|||
// Emulate an user activity
|
||||
static int count = 0;
|
||||
count++;
|
||||
if ((count & 0xFFF) == 0)
|
||||
if (GSdsp && (count & 0xFFF) == 0)
|
||||
{
|
||||
// 1 call every 4096 Vsync is enough
|
||||
XResetScreenSaver(GSdsp);
|
||||
|
|
|
@ -194,7 +194,7 @@ void AnalyzeKeyEvent(HostKeyEvent& evt)
|
|||
#ifdef __unix__
|
||||
if (evt.key == XK_Shift_R || evt.key == XK_Shift_L)
|
||||
s_Shift = true;
|
||||
if (evt.key == XK_F12 && s_Shift)
|
||||
if (evt.key == XK_F12 && s_Shift && GSdsp)
|
||||
{
|
||||
if (!s_grab_input)
|
||||
{
|
||||
|
|
|
@ -73,7 +73,7 @@ HWND gsWnd = nullptr;
|
|||
#include "gtk.h"
|
||||
#include <gdk/gdkx.h>
|
||||
#include <X11/X.h>
|
||||
Display* g_GSdsp;
|
||||
Display* g_GSdsp = nullptr;
|
||||
Window g_GSwin;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ namespace usb_hid
|
|||
if (event.code == KEY_LEFTSHIFT || event.code == KEY_RIGHTSHIFT)
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue