Enclose screen saver and root window in IS_X11_DISPLAY
If building with a Wayland-enabled GTK+3 the GdkDisplay can be something other than GdkX11Display at runtime. Fixes: https://bugs.launchpad.net/midori/+bug/975355
This commit is contained in:
parent
7e39d05a17
commit
01b36c5fc4
3 changed files with 37 additions and 23 deletions
|
@ -116,6 +116,10 @@ G_BEGIN_DECLS
|
|||
#define GDK_KEY_Return GDK_Return
|
||||
#endif
|
||||
|
||||
#ifndef GDK_IS_X11_DISPLAY
|
||||
#define GDK_IS_X11_DISPLAY(display) TRUE
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1599,10 +1599,17 @@ midori_inactivity_timeout (gpointer data)
|
|||
if (has_extension == -1)
|
||||
{
|
||||
GdkDisplay* display = gtk_widget_get_display (GTK_WIDGET (mit->browser));
|
||||
if (GDK_IS_X11_DISPLAY (display))
|
||||
{
|
||||
xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
||||
has_extension = XScreenSaverQueryExtension (xdisplay,
|
||||
&event_base, &error_base);
|
||||
}
|
||||
else
|
||||
{
|
||||
has_extension = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (has_extension)
|
||||
{
|
||||
|
|
|
@ -690,6 +690,8 @@ sokoke_get_desktop (void)
|
|||
{
|
||||
/* Are we running in Xfce <= 4.6? */
|
||||
GdkDisplay* display = gdk_display_get_default ();
|
||||
if (GDK_IS_X11_DISPLAY (display))
|
||||
{
|
||||
Display* xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
||||
Window root_window = RootWindow (xdisplay, 0);
|
||||
Atom save_mode_atom = gdk_x11_get_xatom_by_name_for_display (
|
||||
|
@ -710,6 +712,7 @@ sokoke_get_desktop (void)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return desktop;
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue