~ubuntu-branches/ubuntu/oneiric/gnome-panel/oneiric

« back to all changes in this revision

Viewing changes to applets/notification_area/na-tray.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher, Sebastien Bacher, Jeremy Bicha
  • Date: 2011-05-30 11:04:49 UTC
  • mfrom: (1.13.10 upstream) (2.2.5 experimental)
  • Revision ID: james.westby@ubuntu.com-20110530110449-hinl17kxkcefjw6x
Tags: 1:3.0.2-0ubuntu1
[ Sebastien Bacher ]
* New upstream version
* debian/control.in:
  - the new libgweather version is in oneiric, use it
  - drop the python and python-gconf depends, 
    they were added for gnome-panel-add which is still using gconf and buggy
* debian/gnome-panel-data.install:
  - don't install the apport hook, it's only getting gconf datas which 
    doesn't work since gnome-panel uses gsettings
* debian/patches/90_build_fixes.patch:
  - restore build fix from git not applied in the new serie
* debian/patches/01_panel_submenus.patch:
  - don't take that Debian diff, the .menus use the upstream naming in Ubuntu
* debian/patches/06_no_resize_grip.patch:
  - dropped, the issue is fixed in the new version
* debian/patches/50_fix-potfiles.patch:
  - dropped, the issue is fixed in the new version
* debian/watch:
  - track unstable series as well

Drop those delta, since gnome-panel is not the default Ubuntu session now we
can go back to an experience closer to the upstream one: 
* debian/control.in:
  - drop the indicators recommends, unity-2d is the ubuntu fallback session
    so we can get back to use an upstream config for gnome-panel and reduce
    the delta we carry
* debian/patches/04_default_panel_config.patch:
  - don't modify the upstream layout
* debian/patches/05_no_session_delay.patch:
  - no need to tweak the upstream session to optimize it
* debian/patches/16_compiz_workspace_switcher.patch:
  - go back to the upstream switcher behaviour    
* debian/patches/25_dynamic_fusa_detection.patch:
  - not needed since we use the upstream layout, could be ported if someone
    is wanting to do the work though
* debian/patches/30_disable-initial-animation.patch, debian/rules:
  - drop the --disable-initial-animation, that was some login optimization
    but since it's not the default desktop you should go back to the 
    upstream behaviour

[ Jeremy Bicha ]   
* New upstream version
* Merge from Debian experimental, remaining Ubuntu changes:
* debian/control:
  - Recommends gnome-settings-daemon which has the timezone polkit service
* debian/rules:
  - Update translations template.
* debian/gnome-panel-data.install:
  - Install apport hook
  - Install the "About Ubuntu" menu item.
* debian/patches/01_layout.patch:
  - Disabled, Help & About Ubuntu don't fit as well in Gnome Panel 3
* debian/patches/01_panel_submenus.patch.
  - Dropped
* debian/patches/03_dnd_places_link.patch:
  - Disabled, when using Drag'n'Drop from Places menu, install a link launcher
    (.desktop file) instead of copying the entire directory.
* debian/patches/17_about-ubuntu-translation.patch:
  - List ubuntu-about.desktop for translation.
* debian/patches/40_unset_menuproxy.patch:
  - Make sure gnome-panel and the applets don't pick up menu proxies.
* debian/patches/50_fix-potfiles.patch
  - Fix i18n
* debian/patches/85_disable_shutdown_on_ltsp.patch:
  - Suppress the shutdown option in the panel if LTSP_CLIENT is set.
* debian/patches/71_change_bookmark_submenu_limit_value.patch
  - Dropped, picked up by Debian
* debian/patches/18_lockdown_lock_editor.patch:
* debian/patches/90_git_wnck_show_realize.patch:
* debian/patches/90_fix_linking_DSO_link.patch:
* debian/patches/91_gir_annotations.patch
* debian/patches/92_git_calendar_day.patch
* debian/patches/92_git_fix_applets_in_multiscreen.patch:
  - Dropped, applied upstream
* debian/watch:
  - watch unstable versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
 
86
86
static void icon_tip_show_next (IconTip *icontip);
87
87
 
88
 
/* NaBox, an instantiable GtkBox */
89
 
 
90
 
typedef GtkBox      NaBox;
91
 
typedef GtkBoxClass NaBoxClass;
92
 
 
93
 
static GType na_box_get_type (void);
94
 
 
95
 
G_DEFINE_TYPE (NaBox, na_box, GTK_TYPE_BOX)
96
 
 
97
 
static void
98
 
na_box_init (NaBox *box)
99
 
{
100
 
}
101
 
 
102
 
static void
103
 
na_box_class_init (NaBoxClass *klass)
104
 
{
105
 
}
106
 
 
107
88
/* NaTray */
108
89
 
109
90
G_DEFINE_TYPE (NaTray, na_tray, GTK_TYPE_BIN)
248
229
              TraysScreen   *trays_screen)
249
230
{
250
231
  NaTray *tray;
 
232
  NaTrayPrivate *priv;
251
233
 
252
234
  tray = g_hash_table_lookup (trays_screen->icon_table, icon);
253
235
  if (tray == NULL)
254
236
    return;
255
237
 
 
238
  priv = tray->priv;
 
239
 
256
240
  g_assert (tray->priv->trays_screen == trays_screen);
257
241
 
 
242
  gtk_container_remove (GTK_CONTAINER (priv->box), icon);
 
243
 
258
244
  g_hash_table_remove (trays_screen->icon_table, icon);
259
245
  /* this will also destroy the tip associated to this icon */
260
246
  g_hash_table_remove (trays_screen->tip_table, icon);
528
514
 * gdk_window_set_composited(). We need to paint these children ourselves.
529
515
 */
530
516
static void
531
 
na_tray_expose_icon (GtkWidget *widget,
532
 
                     gpointer   data)
 
517
na_tray_draw_icon (GtkWidget *widget,
 
518
                   gpointer   data)
533
519
{
534
 
  cairo_t *cr = data;
 
520
  cairo_t *cr = (cairo_t *) data;
535
521
 
536
522
  if (na_tray_child_has_alpha (NA_TRAY_CHILD (widget)))
537
523
    {
539
525
 
540
526
      gtk_widget_get_allocation (widget, &allocation);
541
527
 
542
 
      gdk_cairo_set_source_pixmap (cr,
 
528
      cairo_save (cr);
 
529
      gdk_cairo_set_source_window (cr,
543
530
                                   gtk_widget_get_window (widget),
544
531
                                   allocation.x,
545
532
                                   allocation.y);
 
533
      cairo_rectangle (cr, allocation.x, allocation.y, allocation.width, allocation.height);
 
534
      cairo_clip (cr);
546
535
      cairo_paint (cr);
 
536
      cairo_restore (cr);
547
537
    }
548
538
}
549
539
 
550
540
static void
551
 
na_tray_expose_box (GtkWidget      *box,
552
 
                    GdkEventExpose *event)
 
541
na_tray_draw_box (GtkWidget *box,
 
542
                  cairo_t   *cr)
553
543
{
554
 
  cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (box));
555
 
 
556
 
  gdk_cairo_region (cr, event->region);
557
 
  cairo_clip (cr);
558
 
 
559
 
  gtk_container_foreach (GTK_CONTAINER (box), na_tray_expose_icon, cr);
560
 
 
561
 
  cairo_destroy (cr);
 
544
  gtk_container_foreach (GTK_CONTAINER (box), na_tray_draw_icon, cr);
562
545
}
563
546
 
564
547
static void
575
558
  gtk_container_add (GTK_CONTAINER (tray), priv->frame);
576
559
  gtk_widget_show (priv->frame);
577
560
 
578
 
  priv->box = g_object_new (na_box_get_type (), NULL);
579
 
  g_signal_connect (priv->box, "expose-event",
580
 
                    G_CALLBACK (na_tray_expose_box), tray);
581
 
  gtk_box_set_spacing (GTK_BOX (priv->box), ICON_SPACING);
 
561
  priv->box = gtk_box_new (priv->orientation, ICON_SPACING);
 
562
  g_signal_connect (priv->box, "draw",
 
563
                    G_CALLBACK (na_tray_draw_box), NULL);
582
564
  gtk_container_add (GTK_CONTAINER (priv->frame), priv->box);
583
565
  gtk_widget_show (priv->box);
584
566
}
731
713
}
732
714
 
733
715
static void
734
 
na_tray_size_request (GtkWidget        *widget,
735
 
                      GtkRequisition   *requisition)
736
 
{
737
 
  gtk_widget_size_request (gtk_bin_get_child (GTK_BIN (widget)), requisition);
 
716
na_tray_get_preferred_width (GtkWidget *widget,
 
717
                             gint      *minimal_width,
 
718
                             gint      *natural_width)
 
719
{
 
720
  gtk_widget_get_preferred_width (gtk_bin_get_child (GTK_BIN (widget)),
 
721
                                  minimal_width,
 
722
                                  natural_width);
 
723
}
 
724
 
 
725
static void
 
726
na_tray_get_preferred_height (GtkWidget *widget,
 
727
                              gint      *minimal_height,
 
728
                              gint      *natural_height)
 
729
{
 
730
  gtk_widget_get_preferred_height (gtk_bin_get_child (GTK_BIN (widget)),
 
731
                                   minimal_height,
 
732
                                   natural_height);
738
733
}
739
734
 
740
735
static void
742
737
                       GtkAllocation    *allocation)
743
738
{
744
739
  gtk_widget_size_allocate (gtk_bin_get_child (GTK_BIN (widget)), allocation);
 
740
  gtk_widget_set_allocation (widget, allocation);
745
741
}
746
742
 
747
743
static void
753
749
  gobject_class->constructor = na_tray_constructor;
754
750
  gobject_class->set_property = na_tray_set_property;
755
751
  gobject_class->dispose = na_tray_dispose;
756
 
 
757
 
  widget_class->size_request = na_tray_size_request;
 
752
  widget_class->get_preferred_width = na_tray_get_preferred_width;
 
753
  widget_class->get_preferred_height = na_tray_get_preferred_height;
758
754
  widget_class->size_allocate = na_tray_size_allocate;
759
755
 
760
756
  g_object_class_install_property
826
822
}
827
823
 
828
824
void
 
825
na_tray_set_padding (NaTray *tray,
 
826
                     gint    padding)
 
827
{
 
828
  NaTrayPrivate *priv = tray->priv;
 
829
 
 
830
  if (get_tray (priv->trays_screen) == tray)
 
831
    na_tray_manager_set_padding (priv->trays_screen->tray_manager, padding);
 
832
}
 
833
 
 
834
void
 
835
na_tray_set_icon_size (NaTray *tray,
 
836
                       gint    size)
 
837
{
 
838
  NaTrayPrivate *priv = tray->priv;
 
839
 
 
840
  if (get_tray (priv->trays_screen) == tray)
 
841
    na_tray_manager_set_icon_size (priv->trays_screen->tray_manager, size);
 
842
}
 
843
 
 
844
void
 
845
na_tray_set_colors (NaTray   *tray,
 
846
                    GdkColor *fg,
 
847
                    GdkColor *error,
 
848
                    GdkColor *warning,
 
849
                    GdkColor *success)
 
850
{
 
851
  NaTrayPrivate *priv = tray->priv;
 
852
 
 
853
  if (get_tray (priv->trays_screen) == tray)
 
854
    na_tray_manager_set_colors (priv->trays_screen->tray_manager, fg, error, warning, success);
 
855
}
 
856
 
 
857
void
829
858
na_tray_force_redraw (NaTray *tray)
830
859
{
831
860
  NaTrayPrivate *priv = tray->priv;