~matttbe/ubuntu/quantal/lxpanel/lp1013171

« back to all changes in this revision

Viewing changes to src/plugins/taskbar.c

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2011-07-24 15:41:01 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20110724154101-pdss358hu486lp7h
Tags: 0.5.7-0ubuntu1
* New upstream release.
* debian/patches:
 - 80_translations.patch: Remove, merged upstream.
 - batt_status.patch: Remove, merged upstream.
 - configure_X11.patch: Remove, merged upstream.
 - missing_glades.patch: Remove, not needed now.
 - redefine-alarm-variable.patch: Remove, merged upstream.
 - indicator-support.patch: Fix Makefile.am.
 - fix_requisition.patch: New patch, fix crash when clicking on the panel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
615
615
        }
616
616
 
617
617
        /* Be sure we aren't going to fail due to visual mismatch. */
 
618
#if GLIB_CHECK_VERSION(2,22,0)
 
619
        if ((colormap != NULL) && (gdk_visual_get_depth(gdk_colormap_get_visual(colormap)) != depth))
 
620
#else
618
621
        if ((colormap != NULL) && (gdk_colormap_get_visual(colormap)->depth != depth))
 
622
#endif
619
623
        {
620
624
            g_object_unref(G_OBJECT(colormap));
621
625
            colormap = NULL;
1213
1217
    {
1214
1218
        /* Get the coordinates of the button. */
1215
1219
        int x, y;
1216
 
        gdk_window_get_origin(GTK_BUTTON(btn)->event_window, &x, &y);
 
1220
#if GTK_CHECK_VERSION(2,22,0)
 
1221
        gdk_window_get_origin(gtk_button_get_event_window(GTK_BUTTON(btn)), &x, &y);
 
1222
#else
 
1223
        gdk_window_get_origin((GTK_BUTTON(btn)->event_window, &x, &y);
 
1224
#endif
 
1225
 
1217
1226
 
1218
1227
        /* Send a NET_WM_ICON_GEOMETRY property change on the window. */
1219
1228
        guint32 data[4];
1308
1317
    gtk_container_set_border_width(GTK_CONTAINER(tk->button), 0);
1309
1318
 
1310
1319
    /* Add the button to the taskbar. */
1311
 
    icon_grid_add(tb->icon_grid, tk->button, TRUE); 
 
1320
    icon_grid_add(tb->icon_grid, tk->button, TRUE);
 
1321
#if GTK_CHECK_VERSION(2,18,0)
 
1322
    gtk_widget_set_can_focus(GTK_WIDGET(tk->button),FALSE);
 
1323
    gtk_widget_set_can_default(GTK_WIDGET(tk->button),FALSE);
 
1324
#else
1312
1325
    GTK_WIDGET_UNSET_FLAGS(tk->button, GTK_CAN_FOCUS);
1313
1326
    GTK_WIDGET_UNSET_FLAGS(tk->button, GTK_CAN_DEFAULT);
 
1327
#endif
1314
1328
 
1315
1329
    /* Update styles on the button. */
1316
1330
    task_update_style(tk, tb);
1797
1811
    /* Allocate top level widget and set into Plugin widget pointer. */
1798
1812
    p->pwid = gtk_event_box_new();
1799
1813
    gtk_container_set_border_width(GTK_CONTAINER(p->pwid), 0);
 
1814
#if GTK_CHECK_VERSION(2,18,0)
 
1815
    gtk_widget_set_has_window(GTK_WIDGET(p->pwid),FALSE);
 
1816
#else
1800
1817
    GTK_WIDGET_SET_FLAGS(p->pwid, GTK_NO_WINDOW);
 
1818
#endif
1801
1819
    gtk_widget_set_name(p->pwid, "taskbar");
1802
1820
 
1803
1821
    /* Make container for task buttons as a child of top level widget. */