x11: Add back support for the damage extension

commit 14bf58ec5d dropped support
for using the DAMAGE extension since there was no code that
needed it.

We're going to need it again, however, to address an NVidia
vendor driver issue.

This commit does the plumbing to add it back.
This commit is contained in:
Ray Strode 2020-05-27 14:53:10 -04:00
parent ea1cc4b991
commit 10f2b11fda
5 changed files with 23 additions and 0 deletions

View File

@ -123,6 +123,9 @@
/* Have the Xcursor library */ /* Have the Xcursor library */
#mesondefine HAVE_XCURSOR #mesondefine HAVE_XCURSOR
/* Have the XDAMAGE X extension */
#mesondefine HAVE_XDAMAGE
/* Have the XFIXES X extension */ /* Have the XFIXES X extension */
#mesondefine HAVE_XFIXES #mesondefine HAVE_XFIXES

View File

@ -1603,6 +1603,14 @@ gdk_x11_display_open (const gchar *display_name)
} }
#endif #endif
#ifdef HAVE_XDAMAGE
display_x11->have_damage = FALSE;
if (XDamageQueryExtension (display_x11->xdisplay,
&display_x11->damage_event_base,
&display_x11->damage_error_base))
display_x11->have_damage = TRUE;
#endif
display->clipboard = gdk_x11_clipboard_new (display, "CLIPBOARD"); display->clipboard = gdk_x11_clipboard_new (display, "CLIPBOARD");
display->primary_clipboard = gdk_x11_clipboard_new (display, "PRIMARY"); display->primary_clipboard = gdk_x11_clipboard_new (display, "PRIMARY");

View File

@ -149,6 +149,12 @@ struct _GdkX11Display
guint has_glx_multisample : 1; guint has_glx_multisample : 1;
guint has_glx_visual_rating : 1; guint has_glx_visual_rating : 1;
guint has_glx_create_es2_context : 1; guint has_glx_create_es2_context : 1;
#ifdef HAVE_XDAMAGE
gint damage_event_base;
gint damage_error_base;
guint have_damage;
#endif
}; };
struct _GdkX11DisplayClass struct _GdkX11DisplayClass

View File

@ -65,6 +65,7 @@ gdk_x11_deps = [
xext_dep, xext_dep,
x11_dep, x11_dep,
xcursor_dep, xcursor_dep,
xdamage_dep,
xfixes_dep, xfixes_dep,
xcomposite_dep, xcomposite_dep,
xrandr_dep, xrandr_dep,

View File

@ -501,6 +501,7 @@ if x11_enabled
xi_dep = dependency('xi') xi_dep = dependency('xi')
xext_dep = dependency('xext') xext_dep = dependency('xext')
xcursor_dep = dependency('xcursor', required: false) xcursor_dep = dependency('xcursor', required: false)
xdamage_dep = dependency('xdamage', required: false)
xfixes_dep = dependency('xfixes', required: false) xfixes_dep = dependency('xfixes', required: false)
xcomposite_dep = dependency('xcomposite', required: false) xcomposite_dep = dependency('xcomposite', required: false)
fontconfig_dep = dependency('fontconfig') fontconfig_dep = dependency('fontconfig')
@ -513,6 +514,9 @@ if x11_enabled
if xcursor_dep.found() if xcursor_dep.found()
x11_pkgs += ['xcursor'] x11_pkgs += ['xcursor']
endif endif
if xdamage_dep.found()
x11_pkgs += ['xdamage']
endif
if xfixes_dep.found() if xfixes_dep.found()
x11_pkgs += ['xfixes'] x11_pkgs += ['xfixes']
endif endif
@ -523,6 +527,7 @@ if x11_enabled
atk_pkgs += ['atk-bridge-2.0'] atk_pkgs += ['atk-bridge-2.0']
cdata.set('HAVE_XCURSOR', xcursor_dep.found()) cdata.set('HAVE_XCURSOR', xcursor_dep.found())
cdata.set('HAVE_XDAMAGE', xdamage_dep.found())
cdata.set('HAVE_XCOMPOSITE', xcomposite_dep.found()) cdata.set('HAVE_XCOMPOSITE', xcomposite_dep.found())
cdata.set('HAVE_XFIXES', xfixes_dep.found()) cdata.set('HAVE_XFIXES', xfixes_dep.found())