~ubuntu-branches/ubuntu/wily/mate-indicator-applet/wily

« back to all changes in this revision

Viewing changes to src/applet-main.c

  • Committer: Package Import Robot
  • Author(s): Mike Gabriel, Martin Wimpress, Mike Gabriel
  • Date: 2015-08-24 11:54:46 UTC
  • mfrom: (4.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20150824115446-m0lot0l7z22ueqkb
Tags: 1.10.0-1
[ Martin Wimpress ]
* debian/control:
  + Process with wrap-and-sort.

[ Mike Gabriel ]
* Upload to unstable.
* debian/control:
  + Drop from B-D: libgtk2.0-dev. This plus various other B-D changes applied
    in m-i-a 1.10.0-1~exp1 fix #788216. (Closes: #788216).

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <glib/gi18n.h>
27
27
#include <mate-panel-applet.h>
28
28
#include <gdk/gdkkeysyms.h>
 
29
#include <gtk/gtk.h>
29
30
 
30
31
#include "libindicator/indicator-object.h"
31
32
#include "tomboykeybinder.h"
49
50
 
50
51
static gboolean     applet_fill_cb (MatePanelApplet * applet, const gchar * iid, gpointer data);
51
52
 
 
53
#if !GTK_CHECK_VERSION(3, 0, 0)
52
54
static void cw_panel_background_changed (MatePanelApplet               *applet,
53
55
                                         MatePanelAppletBackgroundType  type,
54
56
                                                                 GdkColor                  *colour,
55
57
                                                                 GdkPixmap                 *pixmap,
56
58
                                         GtkWidget                 *menubar);
 
59
#endif
57
60
static void update_accessible_desc (IndicatorObjectEntry * entry, GtkWidget * menuitem);
58
61
 
59
62
/*************
580
583
}
581
584
 
582
585
static gboolean
 
586
#if GTK_CHECK_VERSION(3, 0, 0)
 
587
menubar_on_draw (GtkWidget * widget,
 
588
                 cairo_t * cr,
 
589
                 GtkWidget * menubar)
 
590
#else
583
591
menubar_on_expose (GtkWidget * widget,
584
592
                    GdkEventExpose *event G_GNUC_UNUSED,
585
593
                    GtkWidget * menubar)
 
594
#endif
586
595
{
587
596
        if (gtk_widget_has_focus(menubar))
588
 
                gtk_paint_focus(gtk_widget_get_style(widget), gtk_widget_get_window(widget), gtk_widget_get_state(menubar),
589
 
                                NULL, widget, "menubar-applet", 0, 0, -1, -1);
 
597
                gtk_paint_focus(gtk_widget_get_style(widget),
 
598
#if GTK_CHECK_VERSION(3, 0, 0)
 
599
                                cr,
 
600
#else
 
601
                                gtk_widget_get_window(widget),
 
602
#endif
 
603
                                gtk_widget_get_state(menubar),
 
604
#if !GTK_CHECK_VERSION(3, 0, 0)
 
605
                                NULL,
 
606
#endif
 
607
                                widget, "menubar-applet", 0, 0, -1, -1);
590
608
 
591
609
        return FALSE;
592
610
}
864
882
        gtk_widget_set_can_focus (menubar, TRUE);
865
883
        gtk_widget_set_name(GTK_WIDGET (menubar), "fast-user-switch-menubar");
866
884
        g_signal_connect(menubar, "button-press-event", G_CALLBACK(menubar_press), NULL);
 
885
#if GTK_CHECK_VERSION(3, 0, 0)
 
886
        g_signal_connect_after(menubar, "draw", G_CALLBACK(menubar_on_draw), menubar);
 
887
#else
867
888
        g_signal_connect_after(menubar, "expose-event", G_CALLBACK(menubar_on_expose), menubar);
 
889
#endif
868
890
        g_signal_connect(applet, "change-orient", 
869
891
                        G_CALLBACK(matepanelapplet_reorient_cb), menubar);
870
892
        gtk_container_set_border_width(GTK_CONTAINER(menubar), 0);
905
927
        if (indicators_loaded == 0) {
906
928
                /* A label to allow for click through */
907
929
                GtkWidget * item = gtk_label_new(_("No Indicators"));
 
930
#if GTK_CHECK_VERSION(3, 0, 0)
 
931
                mate_panel_applet_set_background_widget(applet, item);
 
932
#endif
908
933
                gtk_container_add(GTK_CONTAINER(applet), item);
909
934
                gtk_widget_show(item);
910
935
        } else {
913
938
                gtk_widget_show(menubar);
914
939
        }
915
940
 
 
941
#if !GTK_CHECK_VERSION(3, 0, 0)
916
942
        /* Background of applet */
917
943
        g_signal_connect(applet, "change-background",
918
944
                          G_CALLBACK(cw_panel_background_changed), menubar);
 
945
#endif
919
946
 
920
947
        gtk_widget_show(GTK_WIDGET(applet));
921
948
 
923
950
 
924
951
}
925
952
 
 
953
#if !GTK_CHECK_VERSION(3, 0, 0)
926
954
static void
927
955
cw_panel_background_changed (MatePanelApplet               *applet,
928
956
                             MatePanelAppletBackgroundType  type,
961
989
                        break;
962
990
  }
963
991
}
964
 
 
 
992
#endif