Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 135760 Details for
Bug 205584
icon isn't transparent on transparent panel
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh92 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch for eggtray code. I suppose it could be ported to gtk+-2.10.
eggtrayicon.c.patch (text/plain), 7.91 KB, created by
Bill Nottingham
on 2006-09-07 13:53:53 UTC
(
hide
)
Description:
patch for eggtray code. I suppose it could be ported to gtk+-2.10.
Filename:
MIME Type:
Creator:
Bill Nottingham
Created:
2006-09-07 13:53:53 UTC
Size:
7.91 KB
patch
obsolete
>=================================================================== >RCS file: /cvs/gnome/rhythmbox/widgets/eggtrayicon.c,v >retrieving revision 1.15 >retrieving revision 1.17 >diff -u -r1.15 -r1.17 >--- rhythmbox/widgets/eggtrayicon.c 2006/05/19 08:43:54 1.15 >+++ rhythmbox/widgets/eggtrayicon.c 2006/07/24 13:28:41 1.17 >@@ -71,7 +71,7 @@ > #endif > }; > #endif >- >+ > static GtkPlugClass *parent_class = NULL; > > static void egg_tray_icon_init (EggTrayIcon *icon); >@@ -85,6 +85,9 @@ > static void egg_tray_icon_realize (GtkWidget *widget); > static void egg_tray_icon_unrealize (GtkWidget *widget); > >+static void egg_tray_icon_add (GtkContainer *container, >+ GtkWidget *widget); >+ > #ifdef GDK_WINDOWING_X11 > static void egg_tray_icon_update_manager_window (EggTrayIcon *icon, > gboolean dock_if_realized); >@@ -124,7 +127,7 @@ > icon->orientation = GTK_ORIENTATION_HORIZONTAL; > #ifdef HAVE_NOTIFY > icon->notify = g_new0 (Notify, 1); >-#endif >+#endif > gtk_widget_add_events (GTK_WIDGET (icon), GDK_PROPERTY_CHANGE_MASK); > } > >@@ -133,6 +136,7 @@ > { > GObjectClass *gobject_class = (GObjectClass *)klass; > GtkWidgetClass *widget_class = (GtkWidgetClass *)klass; >+ GtkContainerClass *container_class = (GtkContainerClass *)klass; > > parent_class = g_type_class_peek_parent (klass); > >@@ -141,6 +145,8 @@ > widget_class->realize = egg_tray_icon_realize; > widget_class->unrealize = egg_tray_icon_unrealize; > >+ container_class->add = egg_tray_icon_add; >+ > g_object_class_install_property (gobject_class, > PROP_ORIENTATION, > g_param_spec_enum ("orientation", >@@ -195,7 +201,7 @@ > int error, result; > > g_assert (icon->manager_window != None); >- >+ > xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon))); > > gdk_error_trap_push (); >@@ -259,7 +265,7 @@ > return GDK_FILTER_CONTINUE; > } > >-#endif >+#endif > > static void > egg_tray_icon_unrealize (GtkWidget *widget) >@@ -312,7 +318,7 @@ > { > XClientMessageEvent ev; > Display *display; >- >+ > ev.type = ClientMessage; > ev.window = window; > ev.message_type = icon->system_tray_opcode_atom; >@@ -324,7 +330,7 @@ > ev.data.l[4] = data3; > > display = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon))); >- >+ > gdk_error_trap_push (); > XSendEvent (display, > icon->manager_window, False, NoEventMask, (XEvent *)&ev); >@@ -347,14 +353,14 @@ > gboolean dock_if_realized) > { > Display *xdisplay; >- >+ > if (icon->manager_window != None) > return; > > xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon))); >- >+ > XGrabServer (xdisplay); >- >+ > icon->manager_window = XGetSelectionOwner (xdisplay, > icon->selection_atom); > >@@ -364,14 +370,14 @@ > > XUngrabServer (xdisplay); > XFlush (xdisplay); >- >+ > if (icon->manager_window != None) > { > GdkWindow *gdkwin; > > gdkwin = gdk_window_lookup_for_display (gtk_widget_get_display (GTK_WIDGET (icon)), > icon->manager_window); >- >+ > gdk_window_add_filter (gdkwin, egg_tray_icon_manager_filter, icon); > > if (dock_if_realized && GTK_WIDGET_REALIZED (icon)) >@@ -381,16 +387,46 @@ > } > } > >+static gboolean >+transparent_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data) >+{ >+ gdk_window_clear_area (widget->window, event->area.x, event->area.y, >+ event->area.width, event->area.height); >+ return FALSE; >+} >+ >+static void >+make_transparent_again (GtkWidget *widget, GtkStyle *previous_style, >+ gpointer user_data) >+{ >+ gdk_window_set_back_pixmap (widget->window, NULL, TRUE); >+} >+ >+static void >+make_transparent (GtkWidget *widget, gpointer user_data) >+{ >+ if (GTK_WIDGET_NO_WINDOW (widget) || GTK_WIDGET_APP_PAINTABLE (widget)) >+ return; >+ >+ gtk_widget_set_app_paintable (widget, TRUE); >+ gtk_widget_set_double_buffered (widget, FALSE); >+ gdk_window_set_back_pixmap (widget->window, NULL, TRUE); >+ g_signal_connect (widget, "expose_event", >+ G_CALLBACK (transparent_expose_event), NULL); >+ g_signal_connect_after (widget, "style_set", >+ G_CALLBACK (make_transparent_again), NULL); >+} >+ > static void > egg_tray_icon_manager_window_destroyed (EggTrayIcon *icon) > { > GdkWindow *gdkwin; >- >+ > g_return_if_fail (icon->manager_window != None); > > gdkwin = gdk_window_lookup_for_display (gtk_widget_get_display (GTK_WIDGET (icon)), > icon->manager_window); >- >+ > gdk_window_remove_filter (gdkwin, egg_tray_icon_manager_filter, icon); > > icon->manager_window = None; >@@ -425,6 +461,8 @@ > if (GTK_WIDGET_CLASS (parent_class)->realize) > GTK_WIDGET_CLASS (parent_class)->realize (widget); > >+ make_transparent (widget, NULL); >+ > screen = gtk_widget_get_screen (widget); > display = gdk_screen_get_display (screen); > xdisplay = gdk_x11_display_get_xdisplay (display); >@@ -435,9 +473,9 @@ > gdk_screen_get_number (screen)); > > icon->selection_atom = XInternAtom (xdisplay, buffer, False); >- >+ > icon->manager_atom = XInternAtom (xdisplay, "MANAGER", False); >- >+ > icon->system_tray_opcode_atom = XInternAtom (xdisplay, > "_NET_SYSTEM_TRAY_OPCODE", > False); >@@ -450,13 +488,21 @@ > egg_tray_icon_send_dock_request (icon); > > root_window = gdk_screen_get_root_window (screen); >- >+ > /* Add a root window filter so that we get changes on MANAGER */ > gdk_window_add_filter (root_window, > egg_tray_icon_manager_filter, icon); > #endif > } > >+static void >+egg_tray_icon_add (GtkContainer *container, GtkWidget *widget) >+{ >+ g_signal_connect (widget, "realize", >+ G_CALLBACK (make_transparent), NULL); >+ GTK_CONTAINER_CLASS (parent_class)->add (container, widget); >+} >+ > EggTrayIcon * > egg_tray_icon_new_for_screen (GdkScreen *screen, const char *name) > { >@@ -480,7 +526,7 @@ > g_return_val_if_fail (EGG_IS_TRAY_ICON (icon), 0); > g_return_val_if_fail (timeout >= 0, 0); > g_return_val_if_fail (message != NULL, 0); >- >+ > #ifdef HAVE_NOTIFY > egg_tray_icon_notify (icon, timeout, _("Notification"), NULL, message); > #endif >@@ -560,7 +606,7 @@ > > notify_notification_set_timeout (icon->notify->handle, timeout); > >- if (msgicon) >+ if (msgicon) > { > pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (msgicon)); > } >@@ -609,44 +655,44 @@ > char *fn; > char *esc_primary; > char *esc_secondary; >- >+ > if (!notify_is_initted ()) > if (!notify_init ("rhythmbox")) > return; >- >+ > gdk_window_get_origin (GTK_WIDGET (icon)->window, &x, &y); > gtk_widget_size_request (GTK_WIDGET (icon), &size); > x += size.width / 2; > y += size.height; >- >+ > hints = notify_hints_new (); > notify_hints_set_int (hints, "x", x); > notify_hints_set_int (hints, "y", y); > >- if (msgicon) >+ if (msgicon) > { > GdkPixbuf *pix; > pix = gtk_image_get_pixbuf (GTK_IMAGE (msgicon)); >- if (pix) >+ if (pix) > { > char *tmp; > GError *error = NULL; >- tmp = g_strdup_printf ("%s/.gnome2/rb-notify-icon.png", g_get_home_dir ()); >+ tmp = g_strdup_printf ("%s/.gnome2/rb-notify-icon.png", g_get_home_dir ()); > if (gdk_pixbuf_save (pix, tmp, "png", &error, NULL)) > { > icon_notify = notify_icon_new_from_uri (tmp); > } > else > { >- icon_notify = NULL; >+ icon_notify = NULL; > } > g_free (pix); > g_free (tmp); >- } >- } >+ } >+ } > else >- { >- fn = g_strconcat (RB_STOCK_TRAY_ICON, ".png", NULL); >+ { >+ fn = g_strconcat (RB_STOCK_TRAY_ICON, ".png", NULL); > icon_notify = notify_icon_new_from_uri (rb_file (fn)); > g_free (fn); > } >@@ -655,7 +701,7 @@ > { > notify_close (icon->notify->handle); > } >- >+ > esc_primary = g_markup_escape_text (primary, strlen (primary)); > esc_secondary = g_markup_escape_text (secondary, strlen (secondary)); > icon->notify->hints = hints; >@@ -668,7 +714,7 @@ > TRUE, timeout/1000, > hints, > NULL, >- 0); >+ 0); > g_free (esc_primary); > g_free (esc_secondary); > return;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 205584
:
135760
|
135764