[epiphany] Remove X11 dependency and X11-specific code



commit 5095cd21ed2a2b9781b37abcd35858c7962fe635
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Sep 18 21:41:19 2016 -0500

    Remove X11 dependency and X11-specific code

 configure.ac       |    4 ---
 lib/ephy-gui.c     |   20 --------------
 lib/ephy-gui.h     |    3 --
 src/Makefile.am    |    2 -
 src/ephy-main.c    |   72 ----------------------------------------------------
 src/ephy-session.c |    1 -
 src/ephy-shell.c   |    2 -
 7 files changed, 0 insertions(+), 104 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e365864..ceb3b38 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,8 +107,6 @@ PKG_CHECK_MODULES([CAIRO], [cairo])
 PKG_CHECK_MODULES([GCR], [gcr-3 >= 3.5.5])
 PKG_CHECK_MODULES([GDK], [gdk-3.0 >= $GTK_REQUIRED])
 PKG_CHECK_MODULES([GDK_PIXBUF], [gdk-pixbuf-2.0])
-dnl FIXME: x11 should not be mandatory.
-PKG_CHECK_MODULES([GDK_X11], [gdk-x11-3.0 >= $GTK_REQUIRED])
 PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= $GLIB_REQUIRED])
 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $GLIB_REQUIRED])
 PKG_CHECK_MODULES([GNOME_DESKTOP], [gnome-desktop-3.0 >= 2.91.2])
@@ -124,8 +122,6 @@ PKG_CHECK_MODULES([LIBXSLT], [libxslt >= 1.1.7])
 PKG_CHECK_MODULES([SQLITE3], [sqlite3])
 PKG_CHECK_MODULES([WEBKIT2GTK], [webkit2gtk-4.0 >= $WEBKITGTK_REQUIRED])
 PKG_CHECK_MODULES([WEBKIT2GTK_WEB_EXTENSION], [webkit2gtk-web-extension-4.0 >= $WEBKITGTK_REQUIRED])
-dnl FIXME: x11 should not be mandatory.
-PKG_CHECK_MODULES([X11], [x11])
 
 # ******************
 # Portability checks
diff --git a/lib/ephy-gui.c b/lib/ephy-gui.c
index 169cebe..41fa906 100644
--- a/lib/ephy-gui.c
+++ b/lib/ephy-gui.c
@@ -22,7 +22,6 @@
 #include "ephy-debug.h"
 
 #include <ctype.h>
-#include <gdk/gdkx.h>
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <string.h>
@@ -365,22 +364,3 @@ ephy_gui_is_middle_click (void)
 
   return is_middle_click;
 }
-
-void
-ephy_gui_window_update_user_time (GtkWidget *window,
-                                  guint32    user_time)
-{
-  LOG ("updating user time on window %p to %d", window, user_time);
-
-  if (user_time != 0) {
-    gtk_widget_realize (window);
-
-#ifdef GDK_WINDOWING_X11
-    if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) {
-      gdk_x11_window_set_user_time (gtk_widget_get_window (window),
-                                    user_time);
-    }
-#endif
-  }
-}
-
diff --git a/lib/ephy-gui.h b/lib/ephy-gui.h
index 66bccd6..29f5fa1 100644
--- a/lib/ephy-gui.h
+++ b/lib/ephy-gui.h
@@ -55,7 +55,4 @@ gboolean        ephy_gui_check_location_writable         (GtkWidget *parent,
 void            ephy_gui_help                            (GtkWidget *parent,
                                                           const char *page);
 
-void            ephy_gui_window_update_user_time         (GtkWidget *window,
-                                                          guint32 user_time);
-
 G_END_DECLS
diff --git a/src/Makefile.am b/src/Makefile.am
index 2729916..f465432 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -165,7 +165,6 @@ epiphany_CPPFLAGS = \
        $(GTK_CFLAGS)                   \
        $(LIBNOTIFY_CFLAGS)             \
        $(LIBXML_CFLAGS)                \
-       $(X11_CFLAGS)                   \
        $(WEBKIT2GTK_CFLAGS)
 
 epiphany_LDADD = \
@@ -175,7 +174,6 @@ epiphany_LDADD = \
        $(GTK_LIBS)             \
        $(LIBNOTIFY_LIBS)       \
        $(LIBXML_LIBS)          \
-       $(X11_LIBS)             \
        $(WEBKIT2GTK_LIBS)
 
 epiphany_LDFLAGS = \
diff --git a/src/ephy-main.c b/src/ephy-main.c
index 2f4384e..0aaa7be 100644
--- a/src/ephy-main.c
+++ b/src/ephy-main.c
@@ -38,10 +38,6 @@
 #include <libxml/xmlversion.h>
 #include <string.h>
 
-#ifdef GDK_WINDOWING_X11
-#include <gdk/gdkx.h>
-#endif
-
 static gboolean open_in_new_tab = FALSE;
 static gboolean open_in_new_window = FALSE;
 
@@ -143,63 +139,6 @@ get_startup_id (void)
   return retval;
 }
 
-#ifdef GDK_WINDOWING_X11
-/*
- * FIXME: Need a solution for windowing-systems other than X11.
- */
-
-/* Copied from libnautilus/nautilus-program-choosing.c; Needed in case
- * we have no DESKTOP_STARTUP_ID (with its accompanying timestamp).
- */
-static Time
-slowly_and_stupidly_obtain_timestamp (Display *xdisplay)
-{
-  Window xwindow;
-  XEvent event;
-
-  {
-    XSetWindowAttributes attrs;
-    Atom atom_name;
-    Atom atom_type;
-    const char *name;
-
-    attrs.override_redirect = True;
-    attrs.event_mask = PropertyChangeMask | StructureNotifyMask;
-
-    xwindow =
-      XCreateWindow (xdisplay,
-                     RootWindow (xdisplay, 0),
-                     -100, -100, 1, 1,
-                     0,
-                     CopyFromParent,
-                     CopyFromParent,
-                     CopyFromParent,
-                     CWOverrideRedirect | CWEventMask,
-                     &attrs);
-
-    atom_name = XInternAtom (xdisplay, "WM_NAME", TRUE);
-    g_assert (atom_name != None);
-    atom_type = XInternAtom (xdisplay, "STRING", TRUE);
-    g_assert (atom_type != None);
-
-    name = "Fake Window";
-    XChangeProperty (xdisplay,
-                     xwindow, atom_name,
-                     atom_type,
-                     8, PropModeReplace, (unsigned char *)name, strlen (name));
-  }
-
-  XWindowEvent (xdisplay,
-                xwindow,
-                PropertyChangeMask,
-                &event);
-
-  XDestroyWindow (xdisplay, xwindow);
-
-  return event.xproperty.time;
-}
-#endif
-
 static void
 show_error_message (GError **error)
 {
@@ -430,17 +369,6 @@ main (int   argc,
     arguments = args;
   }
 
-#ifdef GDK_WINDOWING_X11
-  /* Get a timestamp manually if need be */
-  if (user_time == 0) {
-    GdkDisplay *display =
-      gdk_display_manager_get_default_display (gdk_display_manager_get ());
-    if (GDK_IS_X11_DISPLAY (display))
-      user_time =
-        slowly_and_stupidly_obtain_timestamp (GDK_DISPLAY_XDISPLAY (display));
-  }
-#endif
-
   /* Delete the requested web application, if any. Must happen after
    * ephy_file_helpers_init (). */
   if (application_to_delete) {
diff --git a/src/ephy-session.c b/src/ephy-session.c
index dadd0f4..46c7f4a 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -1053,7 +1053,6 @@ session_parse_window (SessionParserContext *context,
   }
 
   restore_geometry (GTK_WINDOW (context->window), &geometry);
-  ephy_gui_window_update_user_time (GTK_WIDGET (context->window), context->user_time);
 }
 
 static void
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 2063339..65fab1b 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -691,8 +691,6 @@ ephy_shell_new_tab_full (EphyShell      *shell,
   gtk_widget_show (GTK_WIDGET (embed));
   ephy_embed_container_add_child (EPHY_EMBED_CONTAINER (window), embed, position, jump_to);
 
-  ephy_gui_window_update_user_time (GTK_WIDGET (window), user_time);
-
   if ((flags & EPHY_NEW_TAB_DONT_SHOW_WINDOW) == 0 &&
       ephy_embed_shell_get_mode (embed_shell) != EPHY_EMBED_SHELL_MODE_TEST) {
     gtk_widget_show (GTK_WIDGET (window));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]