[gnome-terminal] window: Remove code to clear the demands-attention hint on re-realize



commit c1cf3a35e7d1107bbbd68e63cf3d24f2916e8af2
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Feb 1 12:50:32 2013 -0500

    window: Remove code to clear the demands-attention hint on re-realize
    
    We no longer re-realize when under a compositing/uncompositing WM to
    switch to an ARGB32 visual, so we no longer need this.

 src/terminal-util.c   |   37 -------------------------------
 src/terminal-util.h   |    2 -
 src/terminal-window.c |   57 -------------------------------------------------
 src/terminal-window.h |    2 -
 4 files changed, 0 insertions(+), 98 deletions(-)
---
diff --git a/src/terminal-util.c b/src/terminal-util.c
index 8dfa79d..c78d796 100644
--- a/src/terminal-util.c
+++ b/src/terminal-util.c
@@ -887,43 +887,6 @@ terminal_util_x11_set_net_wm_desktop (GdkWindow *window,
   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
- * is unmapped (in the withdrawn state) it would be necessary to change _NET_WM_STATE
- * directly.
- */
-void
-terminal_util_x11_clear_demands_attention (GdkWindow *window)
-{
-  GdkScreen *screen;
-  GdkDisplay *display;
-  XClientMessageEvent xclient;
-
-  screen = gdk_window_get_screen (window);
-  display = gdk_screen_get_display (screen);
-
-  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_STATE");
-  xclient.format = 32;
-
-  xclient.data.l[0] = 0; /* _NET_WM_STATE_REMOVE */
-  xclient.data.l[1] = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_DEMANDS_ATTENTION");
-  xclient.data.l[2] = 0;
-  xclient.data.l[3] = 0;
-  xclient.data.l[4] = 0;
-
-  XSendEvent (GDK_DISPLAY_XDISPLAY (display),
-              GDK_WINDOW_XID (gdk_screen_get_root_window (screen)),
-             False,
-             SubstructureRedirectMask | SubstructureNotifyMask,
-             (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,
diff --git a/src/terminal-util.h b/src/terminal-util.h
index 13ce973..86b777d 100644
--- a/src/terminal-util.h
+++ b/src/terminal-util.h
@@ -85,8 +85,6 @@ gboolean terminal_util_x11_get_net_wm_desktop (GdkWindow *window,
 void     terminal_util_x11_set_net_wm_desktop (GdkWindow *window,
                                               guint32    desktop);
 
-void terminal_util_x11_clear_demands_attention (GdkWindow *window);
-
 gboolean terminal_util_x11_window_is_minimized (GdkWindow *window);
 
 const GdkRGBA *terminal_g_settings_get_rgba (GSettings  *settings,
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 9f54ec6..c5258ad 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -78,11 +78,6 @@ struct _TerminalWindowPrivate
   guint menubar_visible : 1;
   guint use_default_menubar_visibility : 1;
 
-  /* Used to clear stray "demands attention" flashing on our window when we
-   * unmap and map it to switch to an ARGB visual.
-   */
-  guint clear_demands_attention : 1;
-
   guint disposed : 1;
   guint present_on_insert : 1;
 
@@ -1457,42 +1452,6 @@ terminal_window_realize (GtkWidget *widget)
 }
 
 static gboolean
-terminal_window_map_event (GtkWidget    *widget,
-                          GdkEventAny  *event)
-{
-  TerminalWindow *window = TERMINAL_WINDOW (widget);
-  TerminalWindowPrivate *priv = window->priv;
-  gboolean (* map_event) (GtkWidget *, GdkEventAny *) =
-      GTK_WIDGET_CLASS (terminal_window_parent_class)->map_event;
-  GtkAllocation widget_allocation;
-
-  gtk_widget_get_allocation (widget, &widget_allocation);
-  _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY,
-                         "[window %p] map-event, size %d : %d at (%d, %d)\n",
-                         widget,
-                         widget_allocation.width, widget_allocation.height,
-                         widget_allocation.x, widget_allocation.y);
-
-  if (priv->clear_demands_attention)
-    {
-#ifdef GDK_WINDOWING_X11
-      GdkWindow *gdk_window = gtk_widget_get_window (widget);
-
-      if (GDK_IS_X11_WINDOW (gdk_window))
-       terminal_util_x11_clear_demands_attention (gdk_window);
-#endif
-
-      priv->clear_demands_attention = FALSE;
-    }
-
-  if (map_event)
-    return map_event (widget, event);
-
-  return FALSE;
-}
-
-    
-static gboolean
 terminal_window_state_event (GtkWidget            *widget,
                              GdkEventWindowState  *event)
 {
@@ -1987,7 +1946,6 @@ terminal_window_class_init (TerminalWindowClass *klass)
 
   widget_class->show = terminal_window_show;
   widget_class->realize = terminal_window_realize;
-  widget_class->map_event = terminal_window_map_event;
   widget_class->window_state_event = terminal_window_state_event;
   widget_class->screen_changed = terminal_window_screen_changed;
   widget_class->style_updated = terminal_window_style_updated;
@@ -2123,21 +2081,6 @@ terminal_window_new (GApplication *app)
                        NULL);
 }
 
-/**
- * terminal_window_set_is_restored:
- * @window:
- *
- * Marks the window as restored from session.
- */
-void
-terminal_window_set_is_restored (TerminalWindow *window)
-{
-  g_return_if_fail (TERMINAL_IS_WINDOW (window));
-  g_return_if_fail (!gtk_widget_get_mapped (GTK_WIDGET (window)));
-
-  window->priv->clear_demands_attention = TRUE;
-}
-
 static void
 profile_set_callback (TerminalScreen *screen,
                       GSettings *old_profile,
diff --git a/src/terminal-window.h b/src/terminal-window.h
index 880ec19..dd50abb 100644
--- a/src/terminal-window.h
+++ b/src/terminal-window.h
@@ -50,8 +50,6 @@ GType terminal_window_get_type (void) G_GNUC_CONST;
 
 TerminalWindow* terminal_window_new (GApplication *app);
 
-void terminal_window_set_is_restored (TerminalWindow *window);
-
 GtkUIManager *terminal_window_get_ui_manager (TerminalWindow *window);
 
 void terminal_window_add_screen (TerminalWindow *window,


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