rpms/gnome-terminal/devel gnome-terminal-2.14.1-real-transparency.patch, 1.2, 1.3 gnome-terminal.spec, 1.42, 1.43

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Apr 18 05:22:55 UTC 2006


Author: krh

Update of /cvs/dist/rpms/gnome-terminal/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv11220

Modified Files:
	gnome-terminal-2.14.1-real-transparency.patch 
	gnome-terminal.spec 
Log Message:
* Tue Apr 18 2006 Kristian Høgsberg <krh at redhat.com> 2.14.1-7
- Only use ARGB visual if a compositing manager is running to avoid
  slow-down caused by automatic compositor.


gnome-terminal-2.14.1-real-transparency.patch:
 terminal-screen.c     |   22 ++++++++++++++++------
 terminal-screen.h     |    2 ++
 terminal-widget-vte.c |    9 +++++++++
 terminal-widget.h     |    3 +++
 terminal-window.c     |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 terminal-window.h     |    2 ++
 terminal.c            |    2 ++
 7 files changed, 82 insertions(+), 6 deletions(-)

Index: gnome-terminal-2.14.1-real-transparency.patch
===================================================================
RCS file: /cvs/dist/rpms/gnome-terminal/devel/gnome-terminal-2.14.1-real-transparency.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- gnome-terminal-2.14.1-real-transparency.patch	17 Apr 2006 21:09:31 -0000	1.2
+++ gnome-terminal-2.14.1-real-transparency.patch	18 Apr 2006 05:22:51 -0000	1.3
@@ -1,5 +1,5 @@
---- ./src/terminal-screen.c.real-transparency	2006-04-17 16:57:41.000000000 -0400
-+++ ./src/terminal-screen.c	2006-04-17 16:57:41.000000000 -0400
+--- ./src/terminal-screen.c.real-transparency	2006-04-18 00:29:10.000000000 -0400
++++ ./src/terminal-screen.c	2006-04-18 00:29:10.000000000 -0400
 @@ -119,8 +119,6 @@
  
  static void terminal_screen_setup_dnd                (TerminalScreen *screen);
@@ -69,7 +69,7 @@
    if (screen->priv->profile)
      g_signal_emit (G_OBJECT (screen), signals[PROFILE_SET], 0);
 --- ./src/terminal-screen.h.real-transparency	2006-01-20 13:05:42.000000000 -0500
-+++ ./src/terminal-screen.h	2006-04-17 16:57:41.000000000 -0400
++++ ./src/terminal-screen.h	2006-04-18 00:29:10.000000000 -0400
 @@ -74,6 +74,8 @@
                                    TerminalProfile *profile);
  TerminalProfile* terminal_screen_get_profile (TerminalScreen *screen);
@@ -80,7 +80,7 @@
                                                     char           **argv);
  const char** terminal_screen_get_override_command (TerminalScreen  *screen);
 --- ./src/terminal-widget-vte.c.real-transparency	2006-01-20 13:05:42.000000000 -0500
-+++ ./src/terminal-widget-vte.c	2006-04-17 16:57:41.000000000 -0400
++++ ./src/terminal-widget-vte.c	2006-04-18 00:29:10.000000000 -0400
 @@ -351,6 +351,7 @@
  terminal_widget_set_background_transparent (GtkWidget *widget,
  					    gboolean   setting)
@@ -105,7 +105,7 @@
  					gboolean   setting)
  {
 --- ./src/terminal-widget.h.real-transparency	2006-01-20 13:05:43.000000000 -0500
-+++ ./src/terminal-widget.h	2006-04-17 16:57:41.000000000 -0400
++++ ./src/terminal-widget.h	2006-04-18 00:29:10.000000000 -0400
 @@ -90,6 +90,9 @@
  /* 0.0 = normal bg, 1.0 = all black bg, 0.5 = half darkened */
  void       terminal_widget_set_background_darkness    (GtkWidget            *widget,
@@ -117,77 +117,21 @@
                                                         gboolean              setting);
  void       terminal_widget_set_normal_gdk_font        (GtkWidget            *widget,
 --- ./src/terminal-window.c.real-transparency	2006-03-04 01:21:01.000000000 -0500
-+++ ./src/terminal-window.c	2006-04-17 17:05:20.000000000 -0400
-@@ -35,6 +35,11 @@
- #include <gdk/gdkkeysyms.h>
- #include <libsn/sn-launchee.h>
- 
-+#define HAVE_XFIXES 1
-+#ifdef HAVE_XFIXES
-+#include <X11/extensions/Xfixes.h>
-+#endif
-+
- struct _TerminalWindowPrivate
- {  
-   GtkWidget *main_vbox;
-@@ -85,6 +90,12 @@
++++ ./src/terminal-window.c	2006-04-18 00:58:59.000000000 -0400
+@@ -85,6 +85,9 @@
     * event-driven while GTK doesn't support _NET_WM_STATE_FULLSCREEN
     */
    guint fullscreen : 1;
 +
 +  /* Compositing manager integration*/
 +  guint have_argb_visual : 1;
-+  guint compositing_manager_present : 1;
-+  int selection_notify_event;
-+  int cm_selection_atom;
  };
  
  enum {
-@@ -749,6 +760,116 @@
-   gtk_clipboard_request_text (window->priv->clipboard, (GtkClipboardTextReceivedFunc) update_edit_menu, window);
+@@ -750,6 +753,47 @@
  }
  
-+#ifdef HAVE_XFIXES
-+
-+static GdkFilterReturn
-+compositing_manager_selection_changed (GdkXEvent *xevent,
-+				       GdkEvent *event,
-+				       gpointer data)
-+{
-+  TerminalWindow *window = (TerminalWindow *) data;
-+  XFixesSelectionNotifyEvent *selection_notify =
-+    (XFixesSelectionNotifyEvent *) xevent;
-+  GList *tmp;
-+
-+  if (window->priv == NULL ||
-+      selection_notify->type != window->priv->selection_notify_event ||
-+      selection_notify->selection != window->priv->cm_selection_atom)
-+    return GDK_FILTER_CONTINUE;
-+
-+  switch (selection_notify->subtype)
-+    {
-+    case XFixesSetSelectionOwnerNotify:
-+      if (selection_notify->owner != None)
-+	window->priv->compositing_manager_present = TRUE;
-+      else
-+	window->priv->compositing_manager_present = FALSE;
-+      break;
-+
-+    case XFixesSelectionWindowDestroyNotify:
-+    case XFixesSelectionClientCloseNotify:
-+      window->priv->compositing_manager_present = FALSE;
-+      break;
-+    }
-+
-+  for (tmp = window->priv->terms; tmp != NULL; tmp = tmp->next)
-+    {
-+      terminal_screen_reread_profile (tmp->data);
-+    }
-+
-+  return GDK_FILTER_REMOVE;
-+}
-+
-+static void
+ static void
 +initialize_alpha_mode (TerminalWindow *window)
 +{
 +  GdkScreen *screen;
@@ -195,72 +139,44 @@
 +  char *atom_name;
 +  Display *display;
 +  GdkDisplay *gdk_display;
-+  int fixes_major, fixes_minor;
-+  int event_base, error_base;
++  int atom;
 +
 +  gdk_display = gtk_widget_get_display (GTK_WIDGET (window));
 +  display = gdk_x11_display_get_xdisplay (gdk_display);
 +
-+  if (!XFixesQueryExtension (display, &event_base, &error_base))
-+    return;
-+
-+  /* XFixes version at least 1.0 will give us the selection events. */
-+  fixes_major = 1;
-+  fixes_minor = 0;
-+  if (!XFixesQueryVersion (display, &fixes_major, &fixes_minor))
-+    return;
-+
-+  /* We have a usable XFixes version, store the event number for later use. */
-+  window->priv->selection_notify_event = event_base + XFixesSelectionNotify;
-+
-+  /* Set RGBA colormap if possible so VTE can use real alpha channels
-+   * for transparency. */
-+  screen = gtk_widget_get_screen (GTK_WIDGET (window));
-+  colormap = gdk_screen_get_rgba_colormap (screen);
-+  if (colormap == NULL)
-+    return;
-+
-+  gtk_widget_set_colormap(GTK_WIDGET (window), colormap);
-+  window->priv->have_argb_visual = TRUE;
-+      
-+  gdk_window_add_filter (GTK_WIDGET (window)->window,
-+			 compositing_manager_selection_changed,
-+			 window);
-+
 +  atom_name = g_strdup_printf ("_NET_WM_CM_S%d",
 +			       gdk_screen_get_number (screen));
-+  window->priv->cm_selection_atom = gdk_x11_get_xatom_by_name (atom_name);
++  atom = gdk_x11_get_xatom_by_name (atom_name);
 +  g_free (atom_name);
++  
++  screen = gtk_widget_get_screen (GTK_WIDGET (window));
++  colormap = gdk_screen_get_rgba_colormap (screen);
 +
-+  if (XGetSelectionOwner (display, window->priv->cm_selection_atom) != None)
-+    window->priv->compositing_manager_present = TRUE;
-+  else
-+    window->priv->compositing_manager_present = FALSE;
-+}
-+
-+#else
++  if (colormap != NULL && XGetSelectionOwner (display, atom) != None)
++    {
++      /* Set RGBA colormap if possible so VTE can use real alpha
++       * channels for transparency. */
 +
-+static void
-+initialize_alpha_mode (TerminalWindow *window)
-+{
-+  window->priv->have_argb_visual = FALSE;
-+  window->priv->compositing_manager_present = FALSE;
++      gtk_widget_set_colormap(GTK_WIDGET (window), colormap);
++      window->priv->have_argb_visual = TRUE;
++    }
++  else
++    {
++      window->priv->have_argb_visual = FALSE;
++    }
 +}
 +
-+#endif
-+
-+
 +gboolean
 +terminal_window_uses_argb_visual (TerminalWindow *window)
 +{
-+    return window->priv->have_argb_visual &&
-+	window->priv->compositing_manager_present;
++  return window->priv->have_argb_visual;
 +}
 +
- static void
++static void
  terminal_window_init (TerminalWindow *window)
  {
-@@ -781,6 +902,8 @@
+   GtkWidget *mi;
+@@ -781,6 +825,8 @@
    window->priv->use_mnemonics = TRUE;
    window->priv->using_mnemonics = FALSE;
  
@@ -269,7 +185,7 @@
    /* force gtk to construct its GtkClipboard; otherwise our UI is very slow the first time we need it */
    window->priv->clipboard = gtk_clipboard_get_for_display (gtk_widget_get_display (GTK_WIDGET (window)), GDK_NONE);
  
-@@ -1233,8 +1356,20 @@
+@@ -1233,6 +1279,8 @@
  void terminal_window_realized_callback (GtkWidget *window,
                                          gpointer   user_data)
  {
@@ -277,21 +193,9 @@
 +
    gdk_window_set_group (window->window, window->window);
    g_signal_handlers_disconnect_by_func (window, terminal_window_realized_callback, NULL);
-+
-+#ifdef HAVE_XFIXES
-+  if (terminal_window->priv->have_argb_visual)
-+      XFixesSelectSelectionInput (GDK_WINDOW_XDISPLAY (window->window),
-+				  GDK_WINDOW_XID (window->window),
-+				  terminal_window->priv->cm_selection_atom,
-+				  XFixesSetSelectionOwnerNotifyMask |
-+				  XFixesSelectionWindowDestroyNotifyMask |
-+				  XFixesSelectionClientCloseNotifyMask);
-+#endif
  }
- 
- TerminalWindow*
 --- ./src/terminal-window.h.real-transparency	2005-11-20 10:06:34.000000000 -0500
-+++ ./src/terminal-window.h	2006-04-17 16:57:41.000000000 -0400
++++ ./src/terminal-window.h	2006-04-18 00:29:10.000000000 -0400
 @@ -98,6 +98,8 @@
  void terminal_window_set_startup_id (TerminalWindow *window,
                                       const char     *startup_id);
@@ -302,7 +206,7 @@
  
  #endif /* TERMINAL_WINDOW_H */
 --- ./src/terminal.c.real-transparency	2006-03-04 01:10:54.000000000 -0500
-+++ ./src/terminal.c	2006-04-17 16:57:41.000000000 -0400
++++ ./src/terminal.c	2006-04-18 00:29:10.000000000 -0400
 @@ -1966,6 +1966,8 @@
      
        terminal_window_add_screen (window, screen);


Index: gnome-terminal.spec
===================================================================
RCS file: /cvs/dist/rpms/gnome-terminal/devel/gnome-terminal.spec,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- gnome-terminal.spec	17 Apr 2006 21:16:59 -0000	1.42
+++ gnome-terminal.spec	18 Apr 2006 05:22:51 -0000	1.43
@@ -13,7 +13,7 @@
 Summary: GNOME Terminal
 Name: gnome-terminal
 Version: 2.14.1
-Release: 6
+Release: 7
 URL: http://www.gnome.org/
 Source0: gnome-terminal-%{version}.tar.bz2
 Source1: ne.po
@@ -103,6 +103,10 @@
 %{_libdir}/bonobo
 
 %changelog
+* Tue Apr 18 2006 Kristian Høgsberg <krh at redhat.com> 2.14.1-7
+- Only use ARGB visual if a compositing manager is running to avoid
+  slow-down caused by automatic compositor.
+
 * Mon Apr 17 2006 Kristian Høgsberg <krh at redhat.com> 2.14.1-6
 - Bumpd for rawhide build.
 




More information about the fedora-cvs-commits mailing list