Software Wayland mostly works.

This commit is contained in:
Brandon Wright 2018-10-16 17:26:24 -05:00
parent 02ce1fcb35
commit a47e9773d6
4 changed files with 38 additions and 8 deletions

View File

@ -1577,10 +1577,12 @@ S9xDisplayReconfigure (void)
void
S9xQueryDrivers (void)
{
#if defined(USE_XV) && defined(GDK_WINDOWING_X11)
gui_config->allow_xv = S9xXVDisplayDriver::query_availability ();
#else
GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (top_level->get_window()));
gui_config->allow_xv = 0;
#if defined(USE_XV) && defined(GDK_WINDOWING_X11)
if (GDK_IS_X11_DISPLAY (display))
gui_config->allow_xv = S9xXVDisplayDriver::query_availability ();
#endif
#ifdef USE_OPENGL
@ -1591,7 +1593,6 @@ S9xQueryDrivers (void)
gui_config->allow_xrandr = 0;
#ifdef GDK_WINDOWING_X11
GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (top_level->get_window()));
if (GDK_IS_X11_DISPLAY (display))
{
int error_base_p, event_base_p;
@ -1612,6 +1613,22 @@ S9xQueryDrivers (void)
bool8
S9xDeinitUpdate (int width, int height)
{
GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (top_level->get_window ()));
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_WINDOW (gdk_window))
{
return S9xRealDeinitUpdate (width, height);
}
#endif
gtk_widget_queue_draw (GTK_WIDGET (top_level->drawing_area));
return TRUE;
}
bool8
S9xRealDeinitUpdate (int width, int height)
{
int yoffset = 0;

View File

@ -111,6 +111,7 @@ void S9xDisplayClearBuffers (void);
void S9xReinitDisplay (void);
void S9xDisplayReconfigure (void);
void S9xQueryDrivers (void);
bool8 S9xRealDeinitUpdate (int width, int height);
S9xDisplayDriver *S9xDisplayGetDriver (void);

View File

@ -39,6 +39,9 @@ extern Snes9xConfig *gui_config;
#if GTK_MAJOR_VERSION >= 3
#define GDK_COMPAT_WINDOW_XID(window) (gdk_x11_window_get_xid (window))
#else
#define GDK_WINDOWING_X11
#define GDK_IS_X11_WINDOW(window) TRUE
#define GDK_IS_X11_DISPLAY(display) TRUE
#define GDK_COMPAT_WINDOW_XID(window) (GDK_WINDOW_XWINDOW (window))
#endif

View File

@ -765,6 +765,9 @@ Snes9xWindow::expose (void)
config->window_height = get_height ();
}
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_WINDOW (gtk_widget_get_window (window)))
{
if (is_paused ()
#ifdef NETPLAY_SUPPORT
|| NetPlay.Paused
@ -774,6 +777,12 @@ Snes9xWindow::expose (void)
S9xDeinitUpdate (last_width, last_height);
}
return;
}
#endif
S9xRealDeinitUpdate (last_width, last_height);
return;
}