Add functions for determining if GDK3 backend is X11 or Wayland

This commit is contained in:
Paul Cornett
2022-02-10 10:15:08 -08:00
parent eaa769a73a
commit 94868c6f41
12 changed files with 73 additions and 34 deletions

View File

@@ -27,6 +27,7 @@
#ifdef __WXGTK__
#ifdef __WXGTK20__
#include "wx/gtk/private/wrapgtk.h"
#include "wx/gtk/private/backend.h"
#else // GTK+ 1.x
#include <gtk/gtk.h>
#define GDK_WINDOWING_X11
@@ -2640,9 +2641,7 @@ static bool wxGetKeyStateGTK(wxKeyCode key)
bool wxGetKeyState(wxKeyCode key)
{
#ifdef wxHAS_GETKEYSTATE_GTK
GdkDisplay* display = gdk_window_get_display(wxGetTopLevelGDK());
const char* name = g_type_name(G_TYPE_FROM_INSTANCE(display));
if (strcmp(name, "GdkX11Display") != 0)
if (!wxGTKImpl::IsX11(NULL))
{
return wxGetKeyStateGTK(key);
}