Commit d10f7619 authored by Armin K.'s avatar Armin K. Committed by Claudio Saavedra
Browse files

wrap libwnck code so it runs only on X11

This is necessary to use Epiphany on Weston, the
Wayland compositor without having to run XWayland.

https://bugzilla.gnome.org/show_bug.cgi?id=708955
parent 1e232e3d
......@@ -46,6 +46,7 @@
#include "window-commands.h"
#include <glib/gi18n.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#define WNCK_I_KNOW_THIS_IS_UNSTABLE
......@@ -139,7 +140,8 @@ ephy_shell_startup_continue (EphyShell *shell)
* otherwise our first call to ephy_window_is_on_current_workspace
* will be unreliable.
*/
wnck_screen_force_update (wnck_screen_get_default ());
if (GDK_IS_X11_DISPLAY (gdk_display_get_default ()))
wnck_screen_force_update (wnck_screen_get_default ());
}
static void
......
......@@ -4413,6 +4413,11 @@ ephy_window_is_on_current_workspace (EphyWindow *window)
if (!gtk_widget_get_realized (GTK_WIDGET (window)))
return TRUE;
gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
if(!GDK_IS_X11_WINDOW (gdk_window))
return TRUE;
workspace = wnck_screen_get_active_workspace (wnck_screen_get_default ());
/* From WNCK docs:
......@@ -4423,7 +4428,6 @@ ephy_window_is_on_current_workspace (EphyWindow *window)
if (!workspace)
return TRUE;
gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
wnck_window = wnck_window_get (GDK_WINDOW_XID (gdk_window));
return wnck_window_is_on_workspace (wnck_window, workspace);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment