Skip to content

Commit

Permalink
don't use some functions in GTK+3 build
Browse files Browse the repository at this point in the history
  • Loading branch information
monsta committed Jul 7, 2016
1 parent 9e16b88 commit 0c50584
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions src/applet-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,32 +712,22 @@ menubar_press (GtkWidget * widget,
return FALSE;
}

#if !GTK_CHECK_VERSION(3, 0, 0)
static gboolean
#if GTK_CHECK_VERSION(3, 0, 0)
menubar_on_draw (GtkWidget * widget,
cairo_t * cr,
GtkWidget * menubar)
#else
menubar_on_expose (GtkWidget * widget,
GdkEventExpose *event G_GNUC_UNUSED,
GtkWidget * menubar)
#endif
{
if (gtk_widget_has_focus(menubar))
gtk_paint_focus(gtk_widget_get_style(widget),
#if GTK_CHECK_VERSION(3, 0, 0)
cr,
#else
gtk_widget_get_window(widget),
#endif
gtk_widget_get_state(menubar),
#if !GTK_CHECK_VERSION(3, 0, 0)
NULL,
#endif
widget, "menubar-applet", 0, 0, -1, -1);

return FALSE;
}
#endif

static void
about_cb (GtkAction *action G_GNUC_UNUSED,
Expand Down Expand Up @@ -982,6 +972,8 @@ applet_fill_cb (MatePanelApplet * applet, const gchar * iid G_GNUC_UNUSED,
gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(),
INDICATOR_ICONS_DIR);
/* g_debug("Icons directory: %s", INDICATOR_ICONS_DIR); */

#if !GTK_CHECK_VERSION (3, 0, 0)
gtk_rc_parse_string (
"style \"indicator-applet-style\"\n"
"{\n"
Expand All @@ -1007,7 +999,8 @@ applet_fill_cb (MatePanelApplet * applet, const gchar * iid G_GNUC_UNUSED,
"widget \"*.fast-user-switch-applet\" style \"indicator-applet-style\""
"widget \"*.fast-user-switch-menuitem\" style \"indicator-applet-menuitem-style\""
"widget \"*.fast-user-switch-menubar\" style \"indicator-applet-menubar-style\"");
//gtk_widget_set_name(GTK_WIDGET (applet), "indicator-applet-menubar");
#endif

gtk_widget_set_name(GTK_WIDGET (applet), "fast-user-switch-applet");

/* Build menubar */
Expand All @@ -1020,9 +1013,7 @@ applet_fill_cb (MatePanelApplet * applet, const gchar * iid G_GNUC_UNUSED,
gtk_widget_set_can_focus (menubar, TRUE);
gtk_widget_set_name(GTK_WIDGET (menubar), "fast-user-switch-menubar");
g_signal_connect(menubar, "button-press-event", G_CALLBACK(menubar_press), NULL);
#if GTK_CHECK_VERSION(3, 0, 0)
g_signal_connect_after(menubar, "draw", G_CALLBACK(menubar_on_draw), menubar);
#else
#if !GTK_CHECK_VERSION(3, 0, 0)
g_signal_connect_after(menubar, "expose-event", G_CALLBACK(menubar_on_expose), menubar);
#endif
g_signal_connect(applet, "change-orient",
Expand Down

0 comments on commit 0c50584

Please sign in to comment.