From d13fbcb3a16293cc1c43d5252a0c035ecd2556b1 Mon Sep 17 00:00:00 2001 From: Sean Middleditch Date: Sat, 5 Mar 2011 11:35:12 -0800 Subject: [PATCH 4/6] Build panel with GSEAL Builds the main panel with GSEAL_ENABLE and GTK_DISABLE_DEPRECATED and the other *_DISABLE_DEPRECATED macros. --- panel/panel-application.c | 6 ++-- panel/panel-base-window.c | 27 ++++++++++++------- panel/panel-dialogs.c | 2 +- panel/panel-item-dialog.c | 4 +- panel/panel-itembar.c | 46 ++++++++++++++++---------------- panel/panel-plugin-external-46.c | 6 ++-- panel/panel-plugin-external.c | 8 +++--- panel/panel-preferences-dialog.c | 4 ++- panel/panel-tic-tac-toe.c | 5 ++- panel/panel-window.c | 34 ++++++++++++------------ plugins/directorymenu/directorymenu.c | 3 -- 11 files changed, 76 insertions(+), 69 deletions(-) diff --git a/panel/panel-application.c b/panel/panel-application.c index fdf4a27..487018e 100644 --- a/panel/panel-application.c +++ b/panel/panel-application.c @@ -391,7 +391,7 @@ panel_application_plugin_move_drag_data_get (GtkWidget *item, /* set some data, we never use this, but GTK_DEST_DEFAULT_ALL * used in the item dialog requires this */ gtk_selection_data_set (selection_data, - selection_data->target, 8, + gtk_selection_data_get_target (selection_data), 8, (const guchar *) "0", 1); } @@ -864,10 +864,10 @@ panel_application_drag_data_received (PanelWindow *window, switch (info) { case TARGET_PLUGIN_NAME: - if (G_LIKELY (selection_data->length > 0)) + if (G_LIKELY (gtk_selection_data_get_length (selection_data) > 0)) { /* create a new item with a unique id */ - name = (const gchar *) selection_data->data; + name = (const gchar *) gtk_selection_data_get_data (selection_data); succeed = panel_application_plugin_insert (application, window, name, -1, NULL, application->drop_index); } diff --git a/panel/panel-base-window.c b/panel/panel-base-window.c index 7025621..0d01e53 100644 --- a/panel/panel-base-window.c +++ b/panel/panel-base-window.c @@ -248,7 +248,7 @@ panel_base_window_get_property (GObject *object, if (window->background_color != NULL) color = window->background_color; else - color = &(GTK_WIDGET (window)->style->bg[GTK_STATE_NORMAL]); + color = &(gtk_widget_get_style (GTK_WIDGET (window))->bg[GTK_STATE_NORMAL]); g_value_set_boxed (value, color); break; @@ -469,19 +469,24 @@ panel_base_window_expose_event (GtkWidget *widget, PanelBaseWindow *window = PANEL_BASE_WINDOW (widget); PanelBaseWindowPrivate *priv = window->priv; gdouble alpha; - gdouble width = widget->allocation.width; - gdouble height = widget->allocation.height; + gdouble width; + gdouble height; const gdouble dashes[] = { 4.00, 4.00 }; GTimeVal timeval; GdkPixbuf *pixbuf; + GtkAllocation allocation; GError *error = NULL; cairo_matrix_t matrix = { 1, 0, 0, 1, 0, 0 }; /* identity matrix */ - if (!GTK_WIDGET_DRAWABLE (widget)) + if (!gtk_widget_is_drawable (widget)) return FALSE; + gtk_widget_get_allocation (widget, &allocation); + width = allocation.width; + height = allocation.height; + /* create cairo context and set some default properties */ - cr = gdk_cairo_create (widget->window); + cr = gdk_cairo_create (gtk_widget_get_window (widget)); panel_return_val_if_fail (cr != NULL, FALSE); cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE); cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); @@ -541,7 +546,7 @@ panel_base_window_expose_event (GtkWidget *widget, && window->background_color != NULL) color = window->background_color; else - color = &(widget->style->bg[GTK_STATE_NORMAL]); + color = &(gtk_widget_get_style (widget)->bg[GTK_STATE_NORMAL]); /* only do something with the background when compositing is enabled */ if (G_UNLIKELY (alpha < 1.00 @@ -581,7 +586,7 @@ panel_base_window_expose_event (GtkWidget *widget, if (PANEL_HAS_FLAG (priv->borders, PANEL_BORDER_BOTTOM | PANEL_BORDER_RIGHT)) { /* use dark color for buttom and right line */ - color = &(widget->style->dark[GTK_STATE_NORMAL]); + color = &(gtk_widget_get_style (widget)->dark[GTK_STATE_NORMAL]); panel_util_set_source_rgba (cr, color, alpha); if (PANEL_HAS_FLAG (priv->borders, PANEL_BORDER_BOTTOM)) @@ -602,7 +607,7 @@ panel_base_window_expose_event (GtkWidget *widget, if (PANEL_HAS_FLAG (priv->borders, PANEL_BORDER_TOP | PANEL_BORDER_LEFT)) { /* use light color for top and left line */ - color = &(widget->style->light[GTK_STATE_NORMAL]); + color = &(gtk_widget_get_style (widget)->light[GTK_STATE_NORMAL]); panel_util_set_source_rgba (cr, color, alpha); if (PANEL_HAS_FLAG (priv->borders, PANEL_BORDER_LEFT)) @@ -670,6 +675,7 @@ panel_base_window_composited_changed (GtkWidget *widget) PanelBaseWindow *window = PANEL_BASE_WINDOW (widget); gboolean was_composited = window->is_composited; GdkWindow *gdkwindow; + GtkAllocation allocation; /* set new compositing state */ window->is_composited = gtk_widget_is_composited (widget); @@ -699,9 +705,10 @@ panel_base_window_composited_changed (GtkWidget *widget) gdk_window_invalidate_rect (gdkwindow, NULL, TRUE); /* HACK: invalid the geometry, so the wm notices it */ + gtk_widget_get_allocation (widget, &allocation); gtk_window_move (GTK_WINDOW (window), - widget->allocation.x, - widget->allocation.y); + allocation.x, + allocation.y); gtk_widget_queue_resize (widget); } diff --git a/panel/panel-dialogs.c b/panel/panel-dialogs.c index eb9c4ac..1bcf34c 100644 --- a/panel/panel-dialogs.c +++ b/panel/panel-dialogs.c @@ -129,7 +129,7 @@ panel_dialogs_choose_panel (PanelApplication *application) /* create widgets */ vbox = gtk_vbox_new (FALSE, 6); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), vbox, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); gtk_widget_show (vbox); diff --git a/panel/panel-item-dialog.c b/panel/panel-item-dialog.c index 46eeaca..7c329cc 100644 --- a/panel/panel-item-dialog.c +++ b/panel/panel-item-dialog.c @@ -201,7 +201,7 @@ panel_item_dialog_init (PanelItemDialog *dialog) gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE); main_vbox = gtk_vbox_new (FALSE, BORDER * 2); - gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), main_vbox); + gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), main_vbox); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), BORDER); gtk_widget_show (main_vbox); @@ -540,7 +540,7 @@ panel_item_dialog_drag_data_get (GtkWidget *treeview, { /* set the internal module name as selection data */ internal_name = panel_module_get_name (module); - gtk_selection_data_set (selection_data, selection_data->target, 8, + gtk_selection_data_set (selection_data, gtk_selection_data_get_target (selection_data), 8, (guchar *) internal_name, strlen (internal_name)); g_object_unref (G_OBJECT (module)); } diff --git a/panel/panel-itembar.c b/panel/panel-itembar.c index 4fea04b..bff505f 100644 --- a/panel/panel-itembar.c +++ b/panel/panel-itembar.c @@ -202,7 +202,7 @@ panel_itembar_init (PanelItembar *itembar) itembar->size = 30; itembar->highlight_index = -1; - GTK_WIDGET_SET_FLAGS (GTK_WIDGET (itembar), GTK_NO_WINDOW); + gtk_widget_set_has_window (GTK_WIDGET (itembar), FALSE); gtk_widget_set_redraw_on_allocate (GTK_WIDGET (itembar), FALSE); } @@ -293,7 +293,7 @@ panel_itembar_size_request (GtkWidget *widget, child = li->data; if (G_LIKELY (child != NULL)) { - if (!GTK_WIDGET_VISIBLE (child->widget)) + if (!gtk_widget_get_visible (child->widget)) continue; gtk_widget_size_request (child->widget, &child_requisition); @@ -337,7 +337,7 @@ panel_itembar_size_request (GtkWidget *widget, requisition->height = MAX (requisition->height, row_length); /* add border width */ - border_width = GTK_CONTAINER (widget)->border_width * 2; + border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)) * 2; requisition->height += border_width; requisition->width += border_width; } @@ -363,9 +363,9 @@ panel_itembar_size_allocate (GtkWidget *widget, gint x, y; gboolean expand_children_fit; - widget->allocation = *allocation; + gtk_widget_set_allocation (widget, allocation); - border_width = GTK_CONTAINER (widget)->border_width; + border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); if (itembar->horizontal) expand_length = allocation->width - 2 * border_width; @@ -385,7 +385,7 @@ panel_itembar_size_allocate (GtkWidget *widget, child = lp->data; if (G_LIKELY (child != NULL)) { - if (!GTK_WIDGET_VISIBLE (child->widget)) + if (!gtk_widget_get_visible (child->widget)) continue; /* continue allocating until we hit a wrap child */ @@ -447,7 +447,7 @@ panel_itembar_size_allocate (GtkWidget *widget, continue; } - if (!GTK_WIDGET_VISIBLE (child->widget)) + if (!gtk_widget_get_visible (child->widget)) continue; gtk_widget_get_child_requisition (child->widget, &child_req); @@ -540,7 +540,7 @@ panel_itembar_expose_event (GtkWidget *widget, if (itembar->highlight_index != -1) { - gtk_paint_box (widget->style, widget->window, + gtk_paint_box (gtk_widget_get_style (widget), gtk_widget_get_window (widget), GTK_STATE_NORMAL, GTK_SHADOW_OUT, &event->area, widget, "panel-dnd", itembar->highlight_x + 1, @@ -572,7 +572,7 @@ panel_itembar_remove (GtkContainer *container, panel_return_if_fail (PANEL_IS_ITEMBAR (itembar)); panel_return_if_fail (GTK_IS_WIDGET (widget)); - panel_return_if_fail (widget->parent == GTK_WIDGET (container)); + panel_return_if_fail (gtk_widget_get_parent (widget) == GTK_WIDGET (container)); panel_return_if_fail (itembar->children != NULL); child = panel_itembar_get_child (itembar, widget); @@ -704,7 +704,7 @@ panel_itembar_get_child (PanelItembar *itembar, panel_return_val_if_fail (PANEL_IS_ITEMBAR (itembar), NULL); panel_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); - panel_return_val_if_fail (widget->parent == GTK_WIDGET (itembar), NULL); + panel_return_val_if_fail (gtk_widget_get_parent (widget) == GTK_WIDGET (itembar), NULL); for (li = itembar->children; li != NULL; li = g_slist_next (li)) { @@ -736,7 +736,7 @@ panel_itembar_insert (PanelItembar *itembar, panel_return_if_fail (PANEL_IS_ITEMBAR (itembar)); panel_return_if_fail (GTK_IS_WIDGET (widget)); - panel_return_if_fail (widget->parent == NULL); + panel_return_if_fail (gtk_widget_get_parent (widget) == NULL); child = g_slice_new0 (PanelItembarChild); child->widget = widget; @@ -761,7 +761,7 @@ panel_itembar_reorder_child (PanelItembar *itembar, panel_return_if_fail (PANEL_IS_ITEMBAR (itembar)); panel_return_if_fail (GTK_IS_WIDGET (widget)); - panel_return_if_fail (widget->parent == GTK_WIDGET (itembar)); + panel_return_if_fail (gtk_widget_get_parent (widget) == GTK_WIDGET (itembar)); child = panel_itembar_get_child (itembar, widget); if (G_LIKELY (child != NULL)) @@ -787,7 +787,7 @@ panel_itembar_get_child_index (PanelItembar *itembar, panel_return_val_if_fail (PANEL_IS_ITEMBAR (itembar), -1); panel_return_val_if_fail (GTK_IS_WIDGET (widget), -1); - panel_return_val_if_fail (widget->parent == GTK_WIDGET (itembar), -1); + panel_return_val_if_fail (gtk_widget_get_parent (widget) == GTK_WIDGET (itembar), -1); for (idx = 0, li = itembar->children; li != NULL; li = g_slist_next (li), idx++) { @@ -827,17 +827,17 @@ panel_itembar_get_drop_index (PanelItembar *itembar, { PanelItembarChild *child; GSList *li; - GtkAllocation *alloc; + GtkAllocation allocation; guint idx; gint row = 0; panel_return_val_if_fail (PANEL_IS_ITEMBAR (itembar), 0); /* add the itembar position */ - alloc = >K_WIDGET (itembar)->allocation; + gtk_widget_get_allocation (GTK_WIDGET (itembar), &allocation); /* return -1 if point is outside the widget allocation */ - if (x > alloc->width || y > alloc->height) + if (x > allocation.width || y > allocation.height) return g_slist_length (itembar->children); for (li = itembar->children, idx = 0; li != NULL; li = g_slist_next (li)) @@ -856,20 +856,20 @@ panel_itembar_get_drop_index (PanelItembar *itembar, break; } - alloc = &child->widget->allocation; + gtk_widget_get_allocation (child->widget, &allocation); if (itembar->horizontal) { - if (x < (alloc->x + (alloc->width / 2)) - && y >= alloc->y - && y <= alloc->y + alloc->height) + if (x < (allocation.x + (allocation.width / 2)) + && y >= allocation.y + && y <= allocation.y + allocation.height) break; } else { - if (y < (alloc->y + (alloc->height / 2)) - && x >= alloc->x - && x <= alloc->x + alloc->width) + if (y < (allocation.y + (allocation.height / 2)) + && x >= allocation.x + && x <= allocation.x + allocation.width) break; } diff --git a/panel/panel-plugin-external-46.c b/panel/panel-plugin-external-46.c index 6e96b64..0e7fe17 100644 --- a/panel/panel-plugin-external-46.c +++ b/panel/panel-plugin-external-46.c @@ -222,12 +222,12 @@ panel_plugin_external_46_set_properties (PanelPluginExternal *external, panel_return_if_fail (panel_atom != GDK_NONE); panel_return_if_fail (PANEL_IS_MODULE (external->module)); - if (!GTK_WIDGET_REALIZED (external)) + if (!gtk_widget_get_realized (GTK_WIDGET (external))) return; event.type = GDK_CLIENT_EVENT; - panel_return_if_fail (GDK_IS_WINDOW (GTK_WIDGET (external)->window)); - event.window = GTK_WIDGET (external)->window; + panel_return_if_fail (GDK_IS_WINDOW (gtk_widget_get_window (GTK_WIDGET (external)))); + event.window = gtk_widget_get_window (GTK_WIDGET (external)); event.send_event = TRUE; event.message_type = panel_atom; event.data_format = 16; diff --git a/panel/panel-plugin-external.c b/panel/panel-plugin-external.c index e8ce304..2ba6da1 100644 --- a/panel/panel-plugin-external.c +++ b/panel/panel-plugin-external.c @@ -502,7 +502,7 @@ panel_plugin_external_child_spawn (PanelPluginExternal *external) GTimeVal timestamp; panel_return_if_fail (PANEL_IS_PLUGIN_EXTERNAL (external)); - panel_return_if_fail (GTK_WIDGET_REALIZED (external)); + panel_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (external))); /* set plugin specific arguments */ argv = (*PANEL_PLUGIN_EXTERNAL_GET_CLASS (external)->get_argv) (external, external->priv->arguments); @@ -621,7 +621,7 @@ panel_plugin_external_child_respawn (gpointer user_data) panel_return_val_if_fail (PANEL_IS_PLUGIN_EXTERNAL (external), FALSE); /* abort startup if the plugin is not realized */ - if (!GTK_WIDGET_REALIZED (external)) + if (!gtk_widget_get_realized (GTK_WIDGET (external))) return FALSE; /* delay startup if the old child is still embedded */ @@ -742,7 +742,7 @@ panel_plugin_external_child_watch (GPid pid, } } - if (GTK_WIDGET_REALIZED (external) + if (gtk_widget_get_realized (GTK_WIDGET (external)) && (auto_restart || panel_plugin_external_child_ask_restart (external))) { panel_plugin_external_child_respawn_schedule (external); @@ -1044,7 +1044,7 @@ panel_plugin_external_set_sensitive (PanelPluginExternal *external) panel_return_if_fail (PANEL_IS_PLUGIN_EXTERNAL (external)); g_value_init (&value, G_TYPE_BOOLEAN); - g_value_set_boolean (&value, GTK_WIDGET_IS_SENSITIVE (external)); + g_value_set_boolean (&value, gtk_widget_get_sensitive (GTK_WIDGET (external))); panel_plugin_external_queue_add (external, PROVIDER_PROP_TYPE_SET_SENSITIVE, &value); diff --git a/panel/panel-preferences-dialog.c b/panel/panel-preferences-dialog.c index ffb71fd..927aa79 100644 --- a/panel/panel-preferences-dialog.c +++ b/panel/panel-preferences-dialog.c @@ -384,7 +384,7 @@ panel_preferences_dialog_bindings_add (PanelPreferencesDialog *dialog, static void panel_preferences_dialog_bindings_update (PanelPreferencesDialog *dialog) { - GdkScreen *screen; + GdkScreen *screen = NULL; GdkDisplay *display; gint n_screens, n_monitors = 1; GObject *object; @@ -432,6 +432,8 @@ panel_preferences_dialog_bindings_update (PanelPreferencesDialog *dialog) n_monitors = gdk_screen_get_n_monitors (screen); } + g_return_if_fail (screen != NULL); + /* update the output selector */ object = gtk_builder_get_object (GTK_BUILDER (dialog), "output-name"); panel_return_if_fail (GTK_IS_COMBO_BOX (object)); diff --git a/panel/panel-tic-tac-toe.c b/panel/panel-tic-tac-toe.c index f65a6ac..c6015b4 100644 --- a/panel/panel-tic-tac-toe.c +++ b/panel/panel-tic-tac-toe.c @@ -125,7 +125,7 @@ panel_tic_tac_toe_init (PanelTicTacToe *dialog) gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); vbox = gtk_vbox_new (FALSE, 6); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), vbox, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); hbox = gtk_hbox_new (FALSE, 12); @@ -165,7 +165,8 @@ panel_tic_tac_toe_init (PanelTicTacToe *dialog) button = dialog->buttons[i] = gtk_button_new (); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); gtk_widget_set_size_request (button, 70, 70); - GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_DEFAULT | GTK_CAN_FOCUS); + gtk_widget_set_can_default (button, FALSE); + gtk_widget_set_can_focus (button, FALSE); g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (panel_tic_tac_toe_button_clicked), dialog); diff --git a/panel/panel-window.c b/panel/panel-window.c index c3f1347..fc0507c 100644 --- a/panel/panel-window.c +++ b/panel/panel-window.c @@ -695,7 +695,7 @@ panel_window_expose_event (GtkWidget *widget, /* expose the background and borders handled in PanelBaseWindow */ (*GTK_WIDGET_CLASS (panel_window_parent_class)->expose_event) (widget, event); - if (window->position_locked || !GTK_WIDGET_DRAWABLE (widget)) + if (window->position_locked || !gtk_widget_is_drawable (widget)) goto end; if (window->horizontal) @@ -728,7 +728,7 @@ panel_window_expose_event (GtkWidget *widget, } /* create cairo context and set some default properties */ - cr = gdk_cairo_create (widget->window); + cr = gdk_cairo_create (gtk_widget_get_window (widget)); panel_return_val_if_fail (cr != NULL, FALSE); cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE); cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); @@ -745,9 +745,9 @@ panel_window_expose_event (GtkWidget *widget, { /* set the source color */ if (i == HANDLE_PIXELS) - color = &(widget->style->light[GTK_STATE_NORMAL]); + color = &(gtk_widget_get_style (widget)->light[GTK_STATE_NORMAL]); else - color = &(widget->style->dark[GTK_STATE_NORMAL]); + color = &(gtk_widget_get_style (widget)->dark[GTK_STATE_NORMAL]); panel_util_set_source_rgba (cr, color, alpha); /* draw the dots */ @@ -935,7 +935,7 @@ panel_window_button_press_event (GtkWidget *widget, guint modifiers; /* leave if the event is not for this window */ - if (event->window != widget->window) + if (event->window != gtk_widget_get_window (widget)) goto end; modifiers = event->state & gtk_accelerator_get_default_mod_mask (); @@ -1085,8 +1085,8 @@ panel_window_size_request (GtkWidget *widget, PanelBorders borders; /* get the child requisition */ - if (GTK_BIN (widget)->child != NULL) - gtk_widget_size_request (GTK_BIN (widget)->child, &child_requisition); + if (gtk_bin_get_child (GTK_BIN (widget)) != NULL) + gtk_widget_size_request (gtk_bin_get_child (GTK_BIN (widget)), &child_requisition); /* handle size */ if (!window->position_locked) @@ -1142,7 +1142,7 @@ panel_window_size_allocate (GtkWidget *widget, PanelBorders borders; GtkWidget *child; - widget->allocation = *alloc; + gtk_widget_set_allocation (widget, alloc); window->alloc = *alloc; if (G_UNLIKELY (window->autohide_state == AUTOHIDE_HIDDEN @@ -1473,7 +1473,7 @@ panel_window_screen_struts_set (PanelWindow *window) panel_return_if_fail (cardinal_atom != 0 && net_wm_strut_partial_atom != 0); panel_return_if_fail (GDK_IS_SCREEN (window->screen)); - if (!GTK_WIDGET_REALIZED (window)) + if (!gtk_widget_get_realized (GTK_WIDGET (window))) return; /* set the struts */ @@ -1527,8 +1527,8 @@ panel_window_screen_struts_set (PanelWindow *window) gdk_error_trap_push (); /* set the wm strut partial */ - panel_return_if_fail (GDK_IS_WINDOW (GTK_WIDGET (window)->window)); - gdk_property_change (GTK_WIDGET (window)->window, + panel_return_if_fail (GDK_IS_WINDOW (gtk_widget_get_window (GTK_WIDGET (window)))); + gdk_property_change (gtk_widget_get_window (GTK_WIDGET (window)), net_wm_strut_partial_atom, cardinal_atom, 32, GDK_PROP_MODE_REPLACE, (guchar *) &struts, N_STRUTS); @@ -1842,7 +1842,7 @@ panel_window_screen_layout_changed (GdkScreen *screen, window, screen_num); /* out of range, hide the window */ - if (GTK_WIDGET_VISIBLE (window)) + if (gtk_widget_get_visible (GTK_WIDGET (window))) gtk_widget_hide (GTK_WIDGET (window)); return; } @@ -1930,7 +1930,7 @@ panel_window_screen_layout_changed (GdkScreen *screen, window, window->output_name); /* hide the panel if the monitor was not found */ - if (GTK_WIDGET_VISIBLE (window)) + if (gtk_widget_get_visible (GTK_WIDGET (window))) gtk_widget_hide (GTK_WIDGET (window)); return; } @@ -1999,7 +1999,7 @@ panel_window_screen_layout_changed (GdkScreen *screen, if (force_struts_update) panel_window_screen_struts_set (window); - if (!GTK_WIDGET_VISIBLE (window)) + if (!gtk_widget_get_visible (GTK_WIDGET (window))) gtk_widget_show (GTK_WIDGET (window)); } @@ -2596,20 +2596,20 @@ panel_window_focus (PanelWindow *window) XClientMessageEvent event; panel_return_if_fail (PANEL_IS_WINDOW (window)); - panel_return_if_fail (GTK_WIDGET_REALIZED (window)); + panel_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (window))); /* we need a slightly custom version of the call through Gtk+ to * properly focus the panel when a plugin calls * xfce_panel_plugin_focus_widget() */ event.type = ClientMessage; - event.window = GDK_WINDOW_XID (GTK_WIDGET (window)->window); + event.window = GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window))); event.message_type = gdk_x11_get_xatom_by_name ("_NET_ACTIVE_WINDOW"); event.format = 32; event.data.l[0] = 0; gdk_error_trap_push (); - XSendEvent (GDK_DISPLAY (), GDK_ROOT_WINDOW (), False, + XSendEvent (GDK_WINDOW_XDISPLAY (gtk_widget_get_window (GTK_WIDGET (window))), GDK_ROOT_WINDOW (), False, StructureNotifyMask, (XEvent *) &event); gdk_flush (); diff --git a/plugins/directorymenu/directorymenu.c b/plugins/directorymenu/directorymenu.c index 0193e29..b41043e 100644 --- a/plugins/directorymenu/directorymenu.c +++ b/plugins/directorymenu/directorymenu.c @@ -224,7 +224,6 @@ directory_menu_plugin_set_property (GObject *object, gchar *display_name; gchar **array; guint i; - GFile *base_directory; const gchar *path; switch (prop_id) @@ -238,8 +237,6 @@ directory_menu_plugin_set_property (GObject *object, g_object_unref (G_OBJECT (plugin->base_directory)); plugin->base_directory = g_file_new_for_commandline_arg (path); - base_directory = g_file_new_for_commandline_arg (g_value_get_string (value)); - display_name = g_file_get_parse_name (plugin->base_directory); gtk_widget_set_tooltip_text (plugin->button, display_name); -- 1.7.4.1