void moz_container_map (GtkWidget *widget) { MozContainer *container; GList *tmp_list; GtkWidget *tmp_child; g_return_if_fail (IS_MOZ_CONTAINER(widget)); container = MOZ_CONTAINER (widget); gtk_widget_set_mapped(widget, TRUE); tmp_list = container->children; while (tmp_list) { tmp_child = ((MozContainerChild *)tmp_list->data)->widget; if (gtk_widget_get_visible(tmp_child)) { if (!gtk_widget_get_mapped(tmp_child)) gtk_widget_map(tmp_child); } tmp_list = tmp_list->next; } gdk_window_show (gtk_widget_get_window(widget)); }
void moz_container_unmap (GtkWidget *widget) { g_return_if_fail (IS_MOZ_CONTAINER (widget)); gtk_widget_set_mapped(widget, FALSE); gdk_window_hide (gtk_widget_get_window(widget)); }
static void anjuta_tabber_map (GtkWidget* widget) { AnjutaTabber* tabber = ANJUTA_TABBER (widget); gtk_widget_set_mapped (widget, TRUE); gdk_window_show_unraised (tabber->priv->event_window); GTK_WIDGET_CLASS (anjuta_tabber_parent_class)->map (widget); }
static void anjuta_tabber_unmap (GtkWidget* widget) { AnjutaTabber* tabber = ANJUTA_TABBER (widget); gtk_widget_set_mapped (widget, FALSE); gdk_window_hide (tabber->priv->event_window); GTK_WIDGET_CLASS (anjuta_tabber_parent_class)->unmap (widget); }
static void columns_unmap(GtkWidget *widget) { Columns *cols; ColumnsChild *child; GList *children; g_return_if_fail(widget != NULL); g_return_if_fail(IS_COLUMNS(widget)); cols = COLUMNS(widget); gtk_widget_set_mapped(GTK_WIDGET(cols), FALSE); for (children = cols->children; children && (child = children->data); children = children->next) { if (child->widget && gtk_widget_get_visible(child->widget) && gtk_widget_get_mapped(child->widget)) gtk_widget_unmap(child->widget); } }
static void eel_wrap_table_unmap (GtkWidget *widget) { EelWrapTable *wrap_table; GList *iterator; g_assert (EEL_IS_WRAP_TABLE (widget)); wrap_table = EEL_WRAP_TABLE (widget); gtk_widget_set_mapped (widget, FALSE); for (iterator = wrap_table->details->children; iterator; iterator = iterator->next) { GtkWidget *item; item = iterator->data; if (gtk_widget_get_visible (item) && gtk_widget_get_mapped (item)) { gtk_widget_unmap (item); } } }
/* After reading the documentation at * http://developer.gnome.org/doc/API/2.0/gtk/gtk-changes-2-0.html * I think it should be possible to remove this function when compiling * against gtk-2.0. It doesn't seem to cause problems, though. * * Well, I reckon at least the gdk_window_show(form->bin_window) * is necessary. GtkForm is anything but a usual container widget. */ static void gtk_form_map(GtkWidget *widget) { GList *tmp_list; GtkForm *form; g_return_if_fail(GTK_IS_FORM(widget)); form = GTK_FORM(widget); gtk_widget_set_mapped(widget, TRUE); gdk_window_show(gtk_widget_get_window(widget)); gdk_window_show(form->bin_window); for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next) { GtkFormChild *child = tmp_list->data; if (gtk_widget_get_visible(child->widget) && !gtk_widget_get_mapped(child->widget)) gtk_widget_map(child->widget); } }
static void display_entry (MetaTabPopup *popup, TabEntry *te) { GdkRectangle rect; GdkRegion *region; GdkRegion *inner_region; GdkWindow *window; if (popup->current_selected_entry) { if (popup->outline) unselect_image (popup->current_selected_entry->widget); else unselect_workspace (popup->current_selected_entry->widget); } gtk_label_set_markup (GTK_LABEL (popup->label), te->title); if (popup->outline) select_image (te->widget); else select_workspace (te->widget); if (popup->outline) { /* Do stuff behind gtk's back */ gdk_window_hide (gtk_widget_get_window(popup->outline_window)); meta_core_increment_event_serial (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ())); rect = te->rect; rect.x = 0; rect.y = 0; window = gtk_widget_get_window(GTK_WIDGET(popup->outline_window)); gdk_window_move_resize (window, te->rect.x, te->rect.y, te->rect.width, te->rect.height); #if GTK_CHECK_VERSION(3, 0, 0) GdkRGBA black = { 0.0, 0.0, 0.0, 1.0 }; gdk_window_set_background_rgba (window, &black); #else gdk_window_set_background (window, &popup->outline_window->style->black); #endif region = gdk_region_rectangle (&rect); inner_region = gdk_region_rectangle (&te->inner_rect); gdk_region_subtract (region, inner_region); gdk_region_destroy (inner_region); gdk_window_shape_combine_region (window, region, 0, 0); gdk_region_destroy (region); /* This should piss off gtk a bit, but we don't want to raise * above the tab popup. So, instead of calling gtk_widget_show, * we manually set the window as mapped and then manually map it * with gdk functions. */ #if GTK_CHECK_VERSION(3, 0, 0) gtk_widget_set_mapped (popup->outline_window, TRUE); #else GTK_WIDGET_SET_FLAGS (popup->outline_window, GTK_MAPPED); #endif gdk_window_show_unraised (window); } /* Must be before we handle an expose for the outline window */ popup->current_selected_entry = te; }