rpms/gnome-terminal/devel gnome-terminal-2.14.1-real-transparency.patch, NONE, 1.1 gnome-terminal.spec, 1.38, 1.39

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Apr 13 19:13:47 UTC 2006


Author: krh

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

Modified Files:
	gnome-terminal.spec 
Added Files:
	gnome-terminal-2.14.1-real-transparency.patch 
Log Message:
* Thu Apr 13 2006 Kristian Høgsberg <krh at redhat.com> 2.14.1-3
- Add vte-0.12.0-real-transparency.patch for extra bling points.


gnome-terminal-2.14.1-real-transparency.patch:
 profile-editor.c          |    0 
 src/profile-editor.c      |    0 
 src/terminal-screen.c     |   22 +++++--
 src/terminal-screen.h     |    2 
 src/terminal-widget-vte.c |    9 +++
 src/terminal-widget.h     |    3 +
 src/terminal-window.c     |  134 ++++++++++++++++++++++++++++++++++++++++++++++
 src/terminal-window.h     |    2 
 src/terminal.c            |    2 
 9 files changed, 168 insertions(+), 6 deletions(-)

--- NEW FILE gnome-terminal-2.14.1-real-transparency.patch ---
? help/bg/Makefile
? help/bg/Makefile.in
? help/bg/gnome-terminal-bg.omf.out
? help/bg/omf_timestamp
? help/uk/Makefile
? help/uk/Makefile.in
? help/uk/gnome-terminal-uk.omf.out
? help/uk/omf_timestamp
? po/.intltool-merge-cache
? src/.deps
? src/.libs
? src/skey/.deps
? src/skey/.libs
? src/skey/btoe.lo
? src/skey/libskey.la
? src/skey/md4.lo
? src/skey/md5.lo
? src/skey/sha1.lo
? src/skey/skey.lo
? src/skey/skeyutil.lo
Index: src/profile-editor.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/profile-editor.c,v
retrieving revision 1.57
diff -u -p -b -r1.57 profile-editor.c
Index: src/terminal-screen.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-screen.c,v
retrieving revision 1.123
diff -u -p -b -r1.123 terminal-screen.c
--- src/terminal-screen.c	2 Apr 2006 12:29:45 -0000	1.123
+++ src/terminal-screen.c	13 Apr 2006 18:01:03 -0000
@@ -119,8 +119,6 @@ static void terminal_screen_widget_encod
 
 static void terminal_screen_setup_dnd                (TerminalScreen *screen);
 
-static void reread_profile (TerminalScreen *screen);
-
 static gboolean cook_title  (TerminalScreen *screen, const char *raw_title, char **old_cooked_title);
 
 static void terminal_screen_cook_title      (TerminalScreen *screen);
@@ -521,12 +519,13 @@ terminal_screen_get_icon_title_set (Term
   return screen->priv->icon_title_set;
 }
 
-static void
-reread_profile (TerminalScreen *screen)
+void
+terminal_screen_reread_profile (TerminalScreen *screen)
 {
   TerminalProfile *profile;
   GtkWidget *term;
   TerminalBackgroundType bg_type;
+  TerminalWindow *window;
   
   profile = screen->priv->profile;  
   
@@ -600,13 +599,24 @@ reread_profile (TerminalScreen *screen)
 
   if (bg_type == TERMINAL_BACKGROUND_IMAGE ||
       bg_type == TERMINAL_BACKGROUND_TRANSPARENT)
+    {
     terminal_widget_set_background_darkness (term,
                                              terminal_profile_get_background_darkness (profile));
+      terminal_widget_set_background_opacity (term,
+					      terminal_profile_get_background_darkness (profile));
+    }      
   else
+    {
     terminal_widget_set_background_darkness (term, 0.0); /* normal color */
+      terminal_widget_set_background_opacity (term, 1);
+    }
   
+  window = terminal_screen_get_window (screen);
+  if (window == NULL || !terminal_window_uses_argb_visual (window))
   terminal_widget_set_background_transparent (term,
                                               bg_type == TERMINAL_BACKGROUND_TRANSPARENT);
+  else
+    terminal_widget_set_background_transparent (term, FALSE);
 
   terminal_widget_set_backspace_binding (term,
                                          terminal_profile_get_backspace_binding (profile));
@@ -698,7 +708,7 @@ profile_changed_callback (TerminalProfil
                           const TerminalSettingMask *mask,
                           TerminalScreen            *screen)
 {
-  reread_profile (screen);
+  terminal_screen_reread_profile (screen);
 }
 
 static void
@@ -946,7 +956,7 @@ terminal_screen_set_profile (TerminalScr
 
   screen->priv->profile = profile;
 
-  reread_profile (screen);
+  terminal_screen_reread_profile (screen);
 
   if (screen->priv->profile)
     g_signal_emit (G_OBJECT (screen), signals[PROFILE_SET], 0);
Index: src/terminal-screen.h
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-screen.h,v
retrieving revision 1.14
diff -u -p -b -r1.14 terminal-screen.h
--- src/terminal-screen.h	20 Jan 2006 18:05:42 -0000	1.14
+++ src/terminal-screen.h	13 Apr 2006 18:01:03 -0000
@@ -74,6 +74,8 @@ void terminal_screen_set_profile (Termin
                                   TerminalProfile *profile);
 TerminalProfile* terminal_screen_get_profile (TerminalScreen *screen);
 
+void terminal_screen_reread_profile (TerminalScreen *screen);
+
 void         terminal_screen_set_override_command (TerminalScreen  *screen,
                                                    char           **argv);
 const char** terminal_screen_get_override_command (TerminalScreen  *screen);
Index: src/terminal-widget-vte.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-widget-vte.c,v
retrieving revision 1.36
diff -u -p -b -r1.36 terminal-widget-vte.c
--- src/terminal-widget-vte.c	20 Jan 2006 18:05:42 -0000	1.36
+++ src/terminal-widget-vte.c	13 Apr 2006 18:01:03 -0000
@@ -351,6 +351,7 @@ void
 terminal_widget_set_background_transparent (GtkWidget *widget,
 					    gboolean   setting)
 {
+    /* FIXME: Don't enable this if we have a compmgr. */
   vte_terminal_set_background_transparent(VTE_TERMINAL(widget), setting);
 }
 
@@ -361,6 +362,14 @@ terminal_widget_set_background_darkness 
 {
   g_return_if_fail(VTE_IS_TERMINAL(widget));
   vte_terminal_set_background_saturation(VTE_TERMINAL(widget), 1.0 - factor);
+}
+
+void
+terminal_widget_set_background_opacity (GtkWidget *widget,
+					double     factor)
+{
+  g_return_if_fail(VTE_IS_TERMINAL(widget));
+  vte_terminal_set_opacity(VTE_TERMINAL(widget), factor * 0xffff);
 }
 
 void
Index: src/terminal-widget.h
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-widget.h,v
retrieving revision 1.12
diff -u -p -b -r1.12 terminal-widget.h
--- src/terminal-widget.h	20 Jan 2006 18:05:43 -0000	1.12
+++ src/terminal-widget.h	13 Apr 2006 18:01:03 -0000
@@ -90,6 +90,9 @@ void       terminal_widget_set_backgroun
 /* 0.0 = normal bg, 1.0 = all black bg, 0.5 = half darkened */
 void       terminal_widget_set_background_darkness    (GtkWidget            *widget,
                                                        double                factor);
+void	   terminal_widget_set_background_opacity     (GtkWidget            *widget,
+						       double                factor);
+
 void       terminal_widget_set_background_scrolls     (GtkWidget            *widget,
                                                        gboolean              setting);
 void       terminal_widget_set_normal_gdk_font        (GtkWidget            *widget,
Index: src/terminal-window.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-window.c,v
retrieving revision 1.126
diff -u -p -b -r1.126 terminal-window.c
--- src/terminal-window.c	1 Apr 2006 20:03:58 -0000	1.126
+++ src/terminal-window.c	13 Apr 2006 18:01:03 -0000
@@ -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 @@ struct _TerminalWindowPrivate
    * 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,115 @@ edit_menu_activate_callback (GtkMenuItem
   gtk_clipboard_request_text (window->priv->clipboard, (GtkClipboardTextReceivedFunc) update_edit_menu, window);
 }
 
+#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 (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
+initialize_alpha_mode (TerminalWindow *window)
+{
+  GdkScreen *screen;
+  GdkColormap *colormap;
+  char *atom_name;
+  Display *display;
+  GdkDisplay *gdk_display;
+  int fixes_major, fixes_minor;
+  int event_base, error_base;
+
+  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);
+  g_free (atom_name);
+
+  if (XGetSelectionOwner (display, window->priv->cm_selection_atom) != None)
+    window->priv->compositing_manager_present = TRUE;
+  else
+    window->priv->compositing_manager_present = FALSE;
+}
+
+#else
+
+static void
+initialize_alpha_mode (TerminalWindow *window)
+{
+  window->priv->have_argb_visual = FALSE;
+  window->priv->compositing_manager_present = FALSE;
+}
+
+#endif
+
+
+gboolean
+terminal_window_uses_argb_visual (TerminalWindow *window)
+{
+    return window->priv->have_argb_visual &&
+	window->priv->compositing_manager_present;
+}
+
 static void
 terminal_window_init (TerminalWindow *window)
 {
@@ -781,6 +901,8 @@ terminal_window_init (TerminalWindow *wi
   window->priv->use_mnemonics = TRUE;
   window->priv->using_mnemonics = FALSE;
 
+  initialize_alpha_mode (window);
+
   /* 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 +1355,20 @@ terminal_window_show (GtkWidget *widget)
 void terminal_window_realized_callback (GtkWidget *window,
                                         gpointer   user_data)
 {
+  TerminalWindow *terminal_window = (TerminalWindow *) window;
+
   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*
Index: src/terminal-window.h
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-window.h,v
retrieving revision 1.11
diff -u -p -b -r1.11 terminal-window.h
--- src/terminal-window.h	20 Nov 2005 15:06:34 -0000	1.11
+++ src/terminal-window.h	13 Apr 2006 18:01:03 -0000
@@ -98,6 +98,8 @@ void terminal_window_reread_profile_list
 void terminal_window_set_startup_id (TerminalWindow *window,
                                      const char     *startup_id);
 
+gboolean terminal_window_uses_argb_visual (TerminalWindow *window);
+
 G_END_DECLS
 
 #endif /* TERMINAL_WINDOW_H */
Index: src/terminal.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal.c,v
retrieving revision 1.96
diff -u -p -b -r1.96 terminal.c
--- src/terminal.c	2 Apr 2006 12:21:12 -0000	1.96
+++ src/terminal.c	13 Apr 2006 18:01:04 -0000
@@ -1966,6 +1966,8 @@ terminal_app_new_terminal (TerminalApp  
     
       terminal_window_add_screen (window, screen);
 
+      terminal_screen_reread_profile (screen);
+
       g_object_unref (G_OBJECT (screen));
     
       terminal_window_set_active (window, screen);


Index: gnome-terminal.spec
===================================================================
RCS file: /cvs/dist/rpms/gnome-terminal/devel/gnome-terminal.spec,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- gnome-terminal.spec	10 Apr 2006 14:29:08 -0000	1.38
+++ gnome-terminal.spec	13 Apr 2006 19:13:44 -0000	1.39
@@ -13,11 +13,12 @@
 Summary: GNOME Terminal
 Name: gnome-terminal
 Version: 2.14.1
-Release: 2
+Release: 3
 URL: http://www.gnome.org/
 Source0: gnome-terminal-%{version}.tar.bz2
 Source1: ne.po
 Patch0: gnome-terminal-2.12.0-inputmethod.patch
+Patch1: gnome-terminal-2.14.1-real-transparency.patch
 License: GPL 
 Group: User Interface/Desktops
 
@@ -53,6 +54,7 @@
 %setup -q
 cp ${RPM_SOURCE_DIR}/ne.po po
 %patch0 -p1 -b .inputmethod
+%patch1 -p0 -b .real-transparency
 
 %build
 
@@ -101,6 +103,9 @@
 %{_libdir}/bonobo
 
 %changelog
+* Thu Apr 13 2006 Kristian Høgsberg <krh at redhat.com> 2.14.1-3
+- Add vte-0.12.0-real-transparency.patch for extra bling points.
+
 * Mon Apr 10 2006 Matthias Clasen <mclasen at redhat.com> - 2.14.1-2
 - Update to 2.14.1
 




More information about the fedora-cvs-commits mailing list