[gnome-terminal] util: Remove some dead code



commit 3472913e2c63cdeaad27ac62008d8103fd499b3c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun May 5 14:04:10 2013 -0400

    util: Remove some dead code

 src/terminal-util.c |  175 ---------------------------------------------------
 src/terminal-util.h |    7 --
 2 files changed, 0 insertions(+), 182 deletions(-)
---
diff --git a/src/terminal-util.c b/src/terminal-util.c
index c78d796..4026bd4 100644
--- a/src/terminal-util.c
+++ b/src/terminal-util.c
@@ -34,11 +34,6 @@
 #include <gio/gio.h>
 #include <gtk/gtk.h>
 
-#ifdef GDK_WINDOWING_X11
-#include <gdk/gdkx.h>
-#include <X11/Xatom.h>
-#endif
-
 #include <gdesktop-enums.h>
 
 #include "terminal-accels.h"
@@ -771,176 +766,6 @@ terminal_util_get_screen_by_display_name (const char *display_name,
   return screen;
 }
 
-#ifdef GDK_WINDOWING_X11
-
-/* We don't want to hop desktops when we unrealize/realize.
- * So we need to save and restore the value of NET_WM_DESKTOP. This isn't
- * exposed through GDK.
- */
-gboolean
-terminal_util_x11_get_net_wm_desktop (GdkWindow *window,
-                                     guint32   *desktop)
-{
-  GdkDisplay *display;
-  Atom type;
-  int format;
-  guchar *data;
-  gulong n_items, bytes_after;
-  gboolean result = FALSE;
-
-  display = gdk_window_get_display (window);
-
-  if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
-                          GDK_WINDOW_XID (window),
-                         gdk_x11_get_xatom_by_name_for_display (display,
-                                                                "_NET_WM_DESKTOP"),
-                         0, G_MAXLONG, False, AnyPropertyType,
-                         &type, &format, &n_items, &bytes_after, &data) == Success &&
-      type != None)
-    {
-      if (type == XA_CARDINAL && format == 32 && n_items == 1)
-       {
-         *desktop = *(gulong *)data;
-         result = TRUE;
-       }
-
-      XFree (data);
-    }
-
-  return result;
-}
-
-void
-terminal_util_x11_set_net_wm_desktop (GdkWindow *window,
-                                     guint32    desktop)
-{
-  /* We can't change the current desktop before mapping our window,
-   * because GDK has the annoying habit of clearing _NET_WM_DESKTOP
-   * before mapping a GdkWindow, So we we have to do it after instead.
-   *
-   * However, doing it after is different whether or not we have a
-   * window manager (if we don't have a window manager, we have to
-   * set the _NET_WM_DESKTOP property so that it picks it up when
-   * it starts)
-   *
-   * http://bugzilla.gnome.org/show_bug.cgi?id=586311 asks for GTK+
-   * to just handle everything behind the scenes including the desktop.
-   */
-  GdkScreen *screen;
-  GdkDisplay *display;
-  Display *xdisplay;
-  char *wm_selection_name;
-  Atom wm_selection;
-  gboolean have_wm;
-
-  screen = gdk_window_get_screen (window);
-  display = gdk_screen_get_display (screen);
-  xdisplay = GDK_DISPLAY_XDISPLAY (display);
-
-  wm_selection_name = g_strdup_printf ("WM_S%d", gdk_screen_get_number (screen));
-  wm_selection = gdk_x11_get_xatom_by_name_for_display (display, wm_selection_name);
-  g_free(wm_selection_name);
-
-  XGrabServer (xdisplay);
-
-  have_wm = XGetSelectionOwner (xdisplay, wm_selection) != None;
-
-  if (have_wm)
-    {
-      /* code borrowed from GDK
-       */
-      XClientMessageEvent xclient;
-
-      memset (&xclient, 0, sizeof (xclient));
-      xclient.type = ClientMessage;
-      xclient.serial = 0;
-      xclient.send_event = True;
-      xclient.window = GDK_WINDOW_XID (window);
-      xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP");
-      xclient.format = 32;
-
-      xclient.data.l[0] = desktop;
-      xclient.data.l[1] = 0;
-      xclient.data.l[2] = 0;
-      xclient.data.l[3] = 0;
-      xclient.data.l[4] = 0;
-
-      XSendEvent (xdisplay,
-                  GDK_WINDOW_XID (gdk_screen_get_root_window (screen)),
-                 False,
-                 SubstructureRedirectMask | SubstructureNotifyMask,
-                 (XEvent *)&xclient);
-    }
-  else
-    {
-      gulong long_desktop = desktop;
-
-      XChangeProperty (xdisplay,
-                       GDK_WINDOW_XID (window),
-                      gdk_x11_get_xatom_by_name_for_display (display,
-                                                             "_NET_WM_DESKTOP"),
-                      XA_CARDINAL, 32, PropModeReplace,
-                      (guchar *)&long_desktop, 1);
-    }
-
-  XUngrabServer (xdisplay);
-  XFlush (xdisplay);
-}
-
-/* Check if a GdkWindow is minimized. This is a workaround for a
- * GDK bug/misfeature. gdk_window_get_state (window) has the
- * GDK_WINDOW_STATE_ICONIFIED bit for all unmapped windows,
- * even windows on another desktop.
- *
- * http://bugzilla.gnome.org/show_bug.cgi?id=586664
- *
- * Code to read _NET_WM_STATE adapted from GDK
- */
-gboolean
-terminal_util_x11_window_is_minimized (GdkWindow *window)
-{
-  GdkDisplay *display;
-  Atom type;
-  gint format;
-  gulong nitems;
-  gulong bytes_after;
-  guchar *data;
-  Atom *atoms = NULL;
-  gulong i;
-  gboolean minimized = FALSE;
-
-  display = gdk_window_get_display (window);
-
-  type = None;
-  gdk_error_trap_push ();
-  XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
-                      gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"),
-                      0, G_MAXLONG, False, XA_ATOM, &type, &format, &nitems,
-                      &bytes_after, &data);
-  gdk_error_trap_pop_ignored ();
-
-  if (type != None)
-    {
-      Atom hidden_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_HIDDEN");
-
-      atoms = (Atom *)data;
-
-      for (i = 0; i < nitems; i++)
-        {
-          if (atoms[i] == hidden_atom)
-            minimized = TRUE;
-
-          ++i;
-        }
-
-      XFree (atoms);
-    }
-
-  return minimized;
-}
-
-#endif /* GDK_WINDOWING_X11 */
-
 static gboolean
 s_to_rgba (GVariant *variant,
            gpointer *result,
diff --git a/src/terminal-util.h b/src/terminal-util.h
index 86b777d..71ab903 100644
--- a/src/terminal-util.h
+++ b/src/terminal-util.h
@@ -80,13 +80,6 @@ void terminal_util_add_proxy_env (GHashTable *env_table);
 GdkScreen *terminal_util_get_screen_by_display_name (const char *display_name,
                                                      int screen_number);
 
-gboolean terminal_util_x11_get_net_wm_desktop (GdkWindow *window,
-                                              guint32   *desktop);
-void     terminal_util_x11_set_net_wm_desktop (GdkWindow *window,
-                                              guint32    desktop);
-
-gboolean terminal_util_x11_window_is_minimized (GdkWindow *window);
-
 const GdkRGBA *terminal_g_settings_get_rgba (GSettings  *settings,
                                              const char *key,
                                              GdkRGBA    *rgba);


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