summaryrefslogtreecommitdiff
path: root/src/terminal-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/terminal-util.c')
-rw-r--r--src/terminal-util.c160
1 files changed, 0 insertions, 160 deletions
diff --git a/src/terminal-util.c b/src/terminal-util.c
index f8c5254..6797c8b 100644
--- a/src/terminal-util.c
+++ b/src/terminal-util.c
@@ -1003,114 +1003,6 @@ terminal_util_bind_object_property_to_widget (GObject *object,
#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 = gdk_window_get_display (window);
- Atom type;
- int format;
- guchar *data;
- gulong n_items, bytes_after;
- gboolean result = FALSE;
-
- 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.mate.org/show_bug.cgi?id=586311 asks for GTK+
- * to just handle everything behind the scenes including the desktop.
- */
- GdkScreen *screen = gdk_window_get_screen (window);
- GdkDisplay *display = gdk_screen_get_display (screen);
- Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
- char *wm_selection_name;
- Atom wm_selection;
- gboolean have_wm;
-
- 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);
-}
-
/* Asks the window manager to turn off the "demands attention" state on the window.
*
* This only works for windows that are currently window managed; if the window
@@ -1146,56 +1038,4 @@ terminal_util_x11_clear_demands_attention (GdkWindow *window)
(XEvent *)&xclient);
}
-/* 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.mate.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 = gdk_window_get_display (window);
-
- Atom type;
- gint format;
- gulong nitems;
- gulong bytes_after;
- guchar *data;
- Atom *atoms = NULL;
- gulong i;
-
- gboolean minimized = FALSE;
-
- 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 */