From 2916533a7ccae280ca0ae116ec1efafdef9c2149 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Jun 12 2010 05:22:16 +0000 Subject: fix spec --- diff --git a/fresh-tooltips.patch b/fresh-tooltips.patch new file mode 100644 index 0000000..dfdfb88 --- /dev/null +++ b/fresh-tooltips.patch @@ -0,0 +1,339 @@ +diff -up gtk+-2.21.1/gtk/gtktooltip.c.fresh-tooltips gtk+-2.21.1/gtk/gtktooltip.c +--- gtk+-2.21.1/gtk/gtktooltip.c.fresh-tooltips 2010-05-30 02:52:44.000000000 -0400 ++++ gtk+-2.21.1/gtk/gtktooltip.c 2010-05-30 19:23:06.464923263 -0400 +@@ -33,6 +33,10 @@ + #include "gtkhbox.h" + #include "gtkalignment.h" + ++#ifdef GDK_WINDOWING_X11 ++#include "gdk/x11/gdkx.h" ++#endif ++ + #include "gtkalias.h" + + #undef DEBUG_TOOLTIP +@@ -97,6 +101,7 @@ static void gtk_tooltip_display_cl + GtkTooltip *tooltip); + static void gtk_tooltip_set_last_window (GtkTooltip *tooltip, + GdkWindow *window); ++static void update_shape (GtkTooltip *tooltip); + + + G_DEFINE_TYPE (GtkTooltip, gtk_tooltip, G_TYPE_OBJECT); +@@ -112,8 +117,43 @@ gtk_tooltip_class_init (GtkTooltipClass + } + + static void ++on_composited_changed (GtkWidget *window, ++ GtkTooltip *tooltip) ++{ ++ update_shape (tooltip); ++} ++ ++static void ++on_screen_changed (GtkWidget *window, ++ GdkScreen *previous, ++ GtkTooltip *tooltip) ++{ ++ GdkScreen *screen; ++ GdkColormap *cmap; ++ ++ screen = gtk_widget_get_screen (window); ++ ++ cmap = NULL; ++ if (gdk_screen_is_composited (screen)) ++ cmap = gdk_screen_get_rgba_colormap (screen); ++ if (cmap == NULL) ++ cmap = gdk_screen_get_rgb_colormap (screen); ++ ++ gtk_widget_set_colormap (window, cmap); ++} ++ ++static void ++on_realized (GtkWidget *window, ++ GtkTooltip *tooltip) ++{ ++ update_shape (tooltip); ++} ++ ++static void + gtk_tooltip_init (GtkTooltip *tooltip) + { ++ GdkScreen *screen; ++ + tooltip->timeout_id = 0; + tooltip->browse_mode_timeout_id = 0; + +@@ -129,8 +169,12 @@ gtk_tooltip_init (GtkTooltip *tooltip) + tooltip->last_window = NULL; + + tooltip->window = g_object_ref (gtk_window_new (GTK_WINDOW_POPUP)); ++ ++ on_screen_changed (tooltip->window, NULL, tooltip); ++ + gtk_window_set_type_hint (GTK_WINDOW (tooltip->window), + GDK_WINDOW_TYPE_HINT_TOOLTIP); ++ + gtk_widget_set_app_paintable (tooltip->window, TRUE); + gtk_window_set_resizable (GTK_WINDOW (tooltip->window), FALSE); + gtk_widget_set_name (tooltip->window, "gtk-tooltip"); +@@ -147,7 +191,7 @@ gtk_tooltip_init (GtkTooltip *tooltip) + gtk_widget_show (tooltip->alignment); + + g_signal_connect_swapped (tooltip->window, "style-set", +- G_CALLBACK (gtk_tooltip_window_style_set), tooltip); ++ G_CALLBACK (gtk_tooltip_window_style_set), tooltip); + g_signal_connect_swapped (tooltip->window, "expose-event", + G_CALLBACK (gtk_tooltip_paint_window), tooltip); + +@@ -164,6 +208,13 @@ gtk_tooltip_init (GtkTooltip *tooltip) + gtk_box_pack_start (GTK_BOX (tooltip->box), tooltip->label, + FALSE, FALSE, 0); + ++ g_signal_connect (tooltip->window, "composited-changed", ++ G_CALLBACK (on_composited_changed), tooltip); ++ g_signal_connect (tooltip->window, "screen-changed", ++ G_CALLBACK (on_screen_changed), tooltip); ++ g_signal_connect (tooltip->window, "realize", ++ G_CALLBACK (on_realized), tooltip); ++ + tooltip->custom_widget = NULL; + } + +@@ -510,19 +561,208 @@ gtk_tooltip_window_style_set (GtkTooltip + gtk_widget_queue_draw (tooltip->window); + } + ++static void ++draw_round_rect (cairo_t *cr, ++ gdouble aspect, ++ gdouble x, ++ gdouble y, ++ gdouble corner_radius, ++ gdouble width, ++ gdouble height) ++{ ++ gdouble radius = corner_radius / aspect; ++ ++ cairo_move_to (cr, x + radius, y); ++ ++ /* top-right, left of the corner */ ++ cairo_line_to (cr, x + width - radius, y); ++ ++ /* top-right, below the corner */ ++ cairo_arc (cr, ++ x + width - radius, y + radius, radius, ++ -90.0f * G_PI / 180.0f, 0.0f * G_PI / 180.0f); ++ ++ /* bottom-right, above the corner */ ++ cairo_line_to (cr, x + width, y + height - radius); ++ ++ /* bottom-right, left of the corner */ ++ cairo_arc (cr, ++ x + width - radius, y + height - radius, radius, ++ 0.0f * G_PI / 180.0f, 90.0f * G_PI / 180.0f); ++ ++ /* bottom-left, right of the corner */ ++ cairo_line_to (cr, x + radius, y + height); ++ ++ /* bottom-left, above the corner */ ++ cairo_arc (cr, ++ x + radius, y + height - radius, radius, ++ 90.0f * G_PI / 180.0f, 180.0f * G_PI / 180.0f); ++ ++ /* top-left, below the corner */ ++ cairo_line_to (cr, x, y + radius); ++ ++ /* top-left, right of the corner */ ++ cairo_arc (cr, ++ x + radius, y + radius, radius, ++ 180.0f * G_PI / 180.0f, 270.0f * G_PI / 180.0f); ++ ++ cairo_close_path (cr); ++} ++ ++static void ++fill_background (GtkWidget *widget, ++ cairo_t *cr) ++{ ++ GdkColor color; ++ gdouble r, g, b; ++ gint radius; ++ gdouble background_alpha; ++ ++ if (gdk_screen_is_composited (gtk_widget_get_screen (widget))) ++ background_alpha = 0.90; ++ else ++ background_alpha = 1.0; ++ ++ radius = MIN (widget->style->xthickness, widget->style->ythickness); ++ radius = MAX (radius, 1); ++ ++ cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR); ++ cairo_paint (cr); ++ cairo_set_operator (cr, CAIRO_OPERATOR_OVER); ++ ++ draw_round_rect (cr, ++ 1.0, 0.5, 0.5, radius, ++ widget->allocation.width - 1, ++ widget->allocation.height - 1); ++ ++ color = widget->style->bg [GTK_STATE_NORMAL]; ++ r = (float)color.red / 65535.0; ++ g = (float)color.green / 65535.0; ++ b = (float)color.blue / 65535.0; ++ cairo_set_source_rgba (cr, r, g, b, background_alpha); ++ cairo_fill_preserve (cr); ++ ++ color = widget->style->bg [GTK_STATE_SELECTED]; ++ r = (float) color.red / 65535.0; ++ g = (float) color.green / 65535.0; ++ b = (float) color.blue / 65535.0; ++ ++ cairo_set_source_rgba (cr, r, g, b, background_alpha); ++ cairo_set_line_width (cr, 1.0); ++ cairo_stroke (cr); ++} ++ ++static void ++update_shape (GtkTooltip *tooltip) ++{ ++ GdkScreen *screen; ++ GdkBitmap *mask; ++ cairo_t *cr; ++ gint width, height; ++ gboolean new_style; ++ gint radius; ++ ++ gtk_widget_style_get (tooltip->window, "new-tooltip-style", &new_style, NULL); ++ ++ if (!new_style) ++ { ++ gtk_widget_shape_combine_mask (tooltip->window, NULL, 0, 0); ++ return; ++ } ++ ++ screen = gtk_widget_get_screen (tooltip->window); ++ ++ gtk_window_get_size (GTK_WINDOW (tooltip->window), &width, &height); ++ ++ if (gdk_screen_is_composited (screen)) ++ { ++ GdkRectangle rect; ++ GdkRegion *region; ++ const char *wm; ++ ++ gtk_widget_shape_combine_mask (tooltip->window, NULL, 0, 0); ++#ifdef GDK_WINDOWING_X11 ++ /* This is a hack to keep the Metacity compositor from slapping a ++ * non-shaped shadow around the shaped tooltip ++ */ ++ if (!gtk_widget_get_mapped (tooltip->window)) ++ { ++ wm = gdk_x11_screen_get_window_manager_name (screen); ++ if (g_strcmp0 (wm, "Metacity") == 0) ++ gtk_window_set_type_hint (GTK_WINDOW (tooltip->window), ++ GDK_WINDOW_TYPE_HINT_DND); ++ } ++#endif ++ return; ++ } ++ ++ radius = MIN (tooltip->window->style->xthickness, ++ tooltip->window->style->ythickness); ++ radius = MAX (radius, 1); ++ mask = (GdkBitmap *) gdk_pixmap_new (NULL, width, height, 1); ++ cr = gdk_cairo_create (mask); ++ if (cairo_status (cr) == CAIRO_STATUS_SUCCESS) ++ { ++ cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR); ++ cairo_paint (cr); ++ ++ cairo_set_operator (cr, CAIRO_OPERATOR_OVER); ++ cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); ++ draw_round_rect (cr, 1.0, 0, 0, radius + 1, width, height); ++ cairo_fill (cr); ++ ++ gtk_widget_shape_combine_mask (tooltip->window, mask, 0, 0); ++ } ++ cairo_destroy (cr); ++ ++ g_object_unref (mask); ++} ++ + static gboolean + gtk_tooltip_paint_window (GtkTooltip *tooltip) + { +- gtk_paint_flat_box (tooltip->window->style, +- tooltip->window->window, +- GTK_STATE_NORMAL, +- GTK_SHADOW_OUT, +- NULL, +- tooltip->window, +- "tooltip", +- 0, 0, +- tooltip->window->allocation.width, +- tooltip->window->allocation.height); ++ gboolean new_style; ++ ++ gtk_widget_style_get (tooltip->window, "new-tooltip-style", &new_style, NULL); ++ ++ if (new_style) ++ { ++ cairo_t *context; ++ cairo_surface_t *surface; ++ cairo_t *cr; ++ ++ context = gdk_cairo_create (tooltip->window->window); ++ ++ cairo_set_operator (context, CAIRO_OPERATOR_SOURCE); ++ surface = cairo_surface_create_similar (cairo_get_target (context), ++ CAIRO_CONTENT_COLOR_ALPHA, ++ tooltip->window->allocation.width, ++ tooltip->window->allocation.height); ++ cr = cairo_create (surface); ++ ++ fill_background (tooltip->window, cr); ++ ++ cairo_destroy (cr); ++ cairo_set_source_surface (context, surface, 0, 0); ++ cairo_paint (context); ++ cairo_surface_destroy (surface); ++ cairo_destroy (context); ++ ++ update_shape (tooltip); ++ } ++ else ++ { ++ gtk_paint_flat_box (tooltip->window->style, ++ tooltip->window->window, ++ GTK_STATE_NORMAL, ++ GTK_SHADOW_OUT, ++ NULL, ++ tooltip->window, ++ "tooltip", ++ 0, 0, ++ tooltip->window->allocation.width, ++ tooltip->window->allocation.height); ++ } + + return FALSE; + } +diff -up gtk+-2.21.1/gtk/gtkwidget.c.fresh-tooltips gtk+-2.21.1/gtk/gtkwidget.c +--- gtk+-2.21.1/gtk/gtkwidget.c.fresh-tooltips 2010-05-30 02:52:44.000000000 -0400 ++++ gtk+-2.21.1/gtk/gtkwidget.c 2010-05-30 19:23:06.475923752 -0400 +@@ -2561,6 +2561,14 @@ gtk_widget_class_init (GtkWidgetClass *k + P_("The length of vertical scroll arrows"), + 1, G_MAXINT, 16, + GTK_PARAM_READABLE)); ++ ++ gtk_widget_class_install_style_property (klass, ++ g_param_spec_boolean ("new-tooltip-style", ++ NULL, ++ NULL, ++ FALSE, ++ GTK_PARAM_READABLE)); ++ + } + + static void diff --git a/gtk3.spec b/gtk3.spec index 9f8b21c..a9821b5 100644 --- a/gtk3.spec +++ b/gtk3.spec @@ -5,7 +5,6 @@ %global libpng_version 2:1.2.2-16 %global xrandr_version 1.2.99.4-2 %global gobject_introspection_version 0.6.7 -%global gir_repository_version 0.6.5-5 %global bin_version 3.0.0 @@ -50,7 +49,6 @@ BuildRequires: libXcomposite-devel BuildRequires: libXdamage-devel BuildRequires: libXi-devel BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version} -BuildRequires: gir-repository-devel >= %{gir_repository_version} # required for icon theme apis to work Requires: hicolor-icon-theme diff --git a/icon-padding.patch b/icon-padding.patch new file mode 100644 index 0000000..45083a6 --- /dev/null +++ b/icon-padding.patch @@ -0,0 +1,258 @@ +diff -up gtk+-2.19.7/gtk/gtkstatusicon.c.icon-padding gtk+-2.19.7/gtk/gtkstatusicon.c +--- gtk+-2.19.7/gtk/gtkstatusicon.c.icon-padding 2010-03-08 08:42:22.000000000 -0500 ++++ gtk+-2.19.7/gtk/gtkstatusicon.c 2010-03-10 00:40:11.165527903 -0500 +@@ -170,6 +170,7 @@ static void gtk_status_icon_screen_c + GdkScreen *old_screen); + static void gtk_status_icon_embedded_changed (GtkStatusIcon *status_icon); + static void gtk_status_icon_orientation_changed (GtkStatusIcon *status_icon); ++static void gtk_status_icon_padding_changed (GtkStatusIcon *status_icon); + static gboolean gtk_status_icon_scroll (GtkStatusIcon *status_icon, + GdkEventScroll *event); + static gboolean gtk_status_icon_query_tooltip (GtkStatusIcon *status_icon, +@@ -850,6 +851,8 @@ gtk_status_icon_init (GtkStatusIcon *sta + G_CALLBACK (gtk_status_icon_embedded_changed), status_icon); + g_signal_connect_swapped (priv->tray_icon, "notify::orientation", + G_CALLBACK (gtk_status_icon_orientation_changed), status_icon); ++ g_signal_connect_swapped (priv->tray_icon, "notify::padding", ++ G_CALLBACK (gtk_status_icon_padding_changed), status_icon); + g_signal_connect_swapped (priv->tray_icon, "button-press-event", + G_CALLBACK (gtk_status_icon_button_press), status_icon); + g_signal_connect_swapped (priv->tray_icon, "button-release-event", +@@ -975,6 +978,8 @@ gtk_status_icon_finalize (GObject *objec + g_signal_handlers_disconnect_by_func (priv->tray_icon, + gtk_status_icon_orientation_changed, status_icon); + g_signal_handlers_disconnect_by_func (priv->tray_icon, ++ gtk_status_icon_padding_changed, status_icon); ++ g_signal_handlers_disconnect_by_func (priv->tray_icon, + gtk_status_icon_button_press, status_icon); + g_signal_handlers_disconnect_by_func (priv->tray_icon, + gtk_status_icon_button_release, status_icon); +@@ -1679,14 +1684,32 @@ gtk_status_icon_screen_changed (GtkStatu + #ifdef GDK_WINDOWING_X11 + + static void ++gtk_status_icon_padding_changed (GtkStatusIcon *status_icon) ++{ ++ GtkStatusIconPrivate *priv = status_icon->priv; ++ GtkOrientation orientation; ++ gint padding; ++ ++ orientation = _gtk_tray_icon_get_orientation (GTK_TRAY_ICON (priv->tray_icon)); ++ padding = _gtk_tray_icon_get_padding (GTK_TRAY_ICON (priv->tray_icon)); ++ ++ if (orientation == GTK_ORIENTATION_HORIZONTAL) ++ gtk_misc_set_padding (GTK_MISC (priv->image), padding, 0); ++ else ++ gtk_misc_set_padding (GTK_MISC (priv->image), 0, padding); ++} ++ ++static void + gtk_status_icon_embedded_changed (GtkStatusIcon *status_icon) + { ++ gtk_status_icon_padding_changed (status_icon); + g_object_notify (G_OBJECT (status_icon), "embedded"); + } + + static void + gtk_status_icon_orientation_changed (GtkStatusIcon *status_icon) + { ++ gtk_status_icon_padding_changed (status_icon); + g_object_notify (G_OBJECT (status_icon), "orientation"); + } + +@@ -1804,7 +1827,7 @@ gtk_status_icon_reset_image_data (GtkSta + + g_object_notify (G_OBJECT (status_icon), "stock"); + break; +- ++ + case GTK_IMAGE_ICON_NAME: + g_free (priv->image_data.icon_name); + priv->image_data.icon_name = NULL; +diff -up gtk+-2.19.7/gtk/gtktrayicon.h.icon-padding gtk+-2.19.7/gtk/gtktrayicon.h +--- gtk+-2.19.7/gtk/gtktrayicon.h.icon-padding 2009-10-18 01:35:45.000000000 -0400 ++++ gtk+-2.19.7/gtk/gtktrayicon.h 2010-03-10 00:40:11.169528392 -0500 +@@ -69,7 +69,8 @@ void _gtk_tray_icon_cancel_mes + guint id); + + GtkOrientation _gtk_tray_icon_get_orientation (GtkTrayIcon *icon); +- ++gint _gtk_tray_icon_get_padding (GtkTrayIcon *icon); ++ + G_END_DECLS + + #endif /* __GTK_TRAY_ICON_H__ */ +diff -up gtk+-2.19.7/gtk/gtktrayicon-x11.c.icon-padding gtk+-2.19.7/gtk/gtktrayicon-x11.c +--- gtk+-2.19.7/gtk/gtktrayicon-x11.c.icon-padding 2010-03-08 21:01:28.000000000 -0500 ++++ gtk+-2.19.7/gtk/gtktrayicon-x11.c 2010-03-10 00:49:48.229509604 -0500 +@@ -43,23 +43,26 @@ + + enum { + PROP_0, +- PROP_ORIENTATION ++ PROP_ORIENTATION, ++ PROP_PADDING + }; + + struct _GtkTrayIconPrivate + { + guint stamp; +- ++ + Atom selection_atom; + Atom manager_atom; + Atom system_tray_opcode_atom; + Atom orientation_atom; + Atom visual_atom; ++ Atom padding_atom; + Window manager_window; + GdkVisual *manager_visual; + gboolean manager_visual_rgba; + + GtkOrientation orientation; ++ gint padding; + }; + + static void gtk_tray_icon_constructed (GObject *object); +@@ -113,6 +116,16 @@ gtk_tray_icon_class_init (GtkTrayIconCla + GTK_ORIENTATION_HORIZONTAL, + GTK_PARAM_READABLE)); + ++ g_object_class_install_property (gobject_class, ++ PROP_PADDING, ++ g_param_spec_int ("padding", ++ P_("Padding"), ++ P_("Padding that should be put around icons in the tray"), ++ 0, ++ G_MAXINT, ++ 0, ++ GTK_PARAM_READABLE)); ++ + g_type_class_add_private (class, sizeof (GtkTrayIconPrivate)); + } + +@@ -124,6 +137,7 @@ gtk_tray_icon_init (GtkTrayIcon *icon) + + icon->priv->stamp = 1; + icon->priv->orientation = GTK_ORIENTATION_HORIZONTAL; ++ icon->priv->padding = 0; + + gtk_widget_set_app_paintable (GTK_WIDGET (icon), TRUE); + gtk_widget_add_events (GTK_WIDGET (icon), GDK_PROPERTY_CHANGE_MASK); +@@ -161,6 +175,10 @@ gtk_tray_icon_constructed (GObject *obje + "_NET_SYSTEM_TRAY_VISUAL", + False); + ++ icon->priv->padding_atom = XInternAtom (xdisplay, ++ "_NET_SYSTEM_TRAY_PADDING", ++ False); ++ + /* Add a root window filter so that we get changes on MANAGER */ + gdk_window_add_filter (root_window, + gtk_tray_icon_manager_filter, icon); +@@ -212,6 +230,9 @@ gtk_tray_icon_get_property (GObject * + case PROP_ORIENTATION: + g_value_set_enum (value, icon->priv->orientation); + break; ++ case PROP_PADDING: ++ g_value_set_int (value, icon->priv->padding); ++ break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; +@@ -372,9 +393,58 @@ gtk_tray_icon_get_visual_property (GtkTr + XFree (prop.prop); + } + ++static void ++gtk_tray_icon_get_padding_property (GtkTrayIcon *icon) ++{ ++ GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (icon)); ++ GdkDisplay *display = gdk_screen_get_display (screen); ++ Display *xdisplay = GDK_DISPLAY_XDISPLAY (display); ++ ++ Atom type; ++ int format; ++ union { ++ gulong *prop; ++ guchar *prop_ch; ++ } prop = { NULL }; ++ gulong nitems; ++ gulong bytes_after; ++ int error, result; ++ ++ g_assert (icon->priv->manager_window != None); ++ ++ gdk_error_trap_push (); ++ type = None; ++ result = XGetWindowProperty (xdisplay, ++ icon->priv->manager_window, ++ icon->priv->padding_atom, ++ 0, G_MAXLONG, FALSE, ++ XA_CARDINAL, ++ &type, &format, &nitems, ++ &bytes_after, &(prop.prop_ch)); ++ error = gdk_error_trap_pop (); ++ ++ if (!error && result == Success && ++ type == XA_CARDINAL && nitems == 1 && format == 32) ++ { ++ gint padding; ++ ++ padding = prop.prop[0]; ++ ++ if (icon->priv->padding != padding) ++ { ++ icon->priv->padding = padding; ++ ++ g_object_notify (G_OBJECT (icon), "padding"); ++ } ++ } ++ ++ if (type != None) ++ XFree (prop.prop); ++} ++ + static GdkFilterReturn +-gtk_tray_icon_manager_filter (GdkXEvent *xevent, +- GdkEvent *event, ++gtk_tray_icon_manager_filter (GdkXEvent *xevent, ++ GdkEvent *event, + gpointer user_data) + { + GtkTrayIcon *icon = user_data; +@@ -399,6 +469,11 @@ gtk_tray_icon_manager_filter (GdkXEvent + + gtk_tray_icon_get_orientation_property (icon); + } ++ else if (xev->xany.type == PropertyNotify && ++ xev->xproperty.atom == icon->priv->padding_atom) ++ { ++ gtk_tray_icon_get_padding_property (icon); ++ } + else if (xev->xany.type == DestroyNotify) + { + GTK_NOTE (PLUGSOCKET, +@@ -504,6 +579,7 @@ gtk_tray_icon_update_manager_window (Gtk + + gtk_tray_icon_get_orientation_property (icon); + gtk_tray_icon_get_visual_property (icon); ++ gtk_tray_icon_get_padding_property (icon); + + if (gtk_widget_get_realized (GTK_WIDGET (icon))) + { +@@ -740,6 +816,14 @@ _gtk_tray_icon_get_orientation (GtkTrayI + return icon->priv->orientation; + } + ++gint ++_gtk_tray_icon_get_padding (GtkTrayIcon *icon) ++{ ++ g_return_val_if_fail (GTK_IS_TRAY_ICON (icon), 0); ++ ++ return icon->priv->padding; ++} ++ + + #define __GTK_TRAY_ICON_X11_C__ + #include "gtkaliasdef.c" diff --git a/remove-connecting-reason.patch b/remove-connecting-reason.patch new file mode 100644 index 0000000..30733e7 --- /dev/null +++ b/remove-connecting-reason.patch @@ -0,0 +1,18 @@ +--- gtk+-2.18.3/modules/printbackends/cups/gtkprintbackendcups.c 2009-10-09 07:00:45.000000000 +0200 ++++ gtk+-2.18.3/modules/printbackends/cups/gtkprintbackendcups.c 2009-11-02 11:45:39.000000000 +0100 +@@ -1628,7 +1628,6 @@ cups_request_printer_list_cb (GtkPrintBa + "media-low", + "media-empty", + "offline", +- "connecting-to-device", + "other" + }; + static const char * reasons_descs[] = +@@ -1648,7 +1647,6 @@ cups_request_printer_list_cb (GtkPrintBa + N_("Printer '%s' is low on paper."), + N_("Printer '%s' is out of paper."), + N_("Printer '%s' is currently off-line."), +- N_("Printer '%s' may not be connected."), + N_("There is a problem on printer '%s'.") + }; + gboolean is_paused = FALSE; diff --git a/window-dragging.patch b/window-dragging.patch new file mode 100644 index 0000000..bb8543c --- /dev/null +++ b/window-dragging.patch @@ -0,0 +1,124 @@ +diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c +index 4788590..cb94c64 100644 +--- a/gtk/gtkmenushell.c ++++ b/gtk/gtkmenushell.c +@@ -585,18 +585,45 @@ gtk_menu_shell_button_press (GtkWidget *widget, + + if (!menu_shell->active || !menu_shell->button) + { +- _gtk_menu_shell_activate (menu_shell); ++ gboolean initially_active = menu_shell->active; + + menu_shell->button = event->button; + +- if (menu_item && _gtk_menu_item_is_selectable (menu_item) && +- menu_item->parent == widget && +- menu_item != menu_shell->active_menu_item) ++ if (menu_item) + { +- if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement == GTK_TOP_BOTTOM) ++ if (_gtk_menu_item_is_selectable (menu_item) && ++ menu_item->parent == widget && ++ menu_item != menu_shell->active_menu_item) + { +- menu_shell->activate_time = event->time; +- gtk_menu_shell_select_item (menu_shell, menu_item); ++ _gtk_menu_shell_activate (menu_shell); ++ menu_shell->button = event->button; ++ ++ if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement == GTK_TOP_BOTTOM) ++ { ++ menu_shell->activate_time = event->time; ++ gtk_menu_shell_select_item (menu_shell, menu_item); ++ } ++ } ++ } ++ else ++ { ++ if (!initially_active) ++ { ++ gboolean window_drag = FALSE; ++ ++ gtk_widget_style_get (widget, ++ "window-dragging", &window_drag, ++ NULL); ++ ++ if (window_drag) ++ { ++ gtk_menu_shell_deactivate (menu_shell); ++ gtk_window_begin_move_drag (GTK_WINDOW (gtk_widget_get_toplevel (widget)), ++ event->button, ++ event->x_root, ++ event->y_root, ++ event->time); ++ } + } + } + } +diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c +index 8f065a7..c72a09f 100644 +--- a/gtk/gtktoolbar.c ++++ b/gtk/gtktoolbar.c +@@ -2699,17 +2699,41 @@ static gboolean + gtk_toolbar_button_press (GtkWidget *toolbar, + GdkEventButton *event) + { ++ GtkWidget *window; ++ + if (event->button == 3) + { + gboolean return_value; +- ++ + g_signal_emit (toolbar, toolbar_signals[POPUP_CONTEXT_MENU], 0, + (int)event->x_root, (int)event->y_root, event->button, + &return_value); +- ++ + return return_value; + } +- ++ ++ window = gtk_widget_get_toplevel (toolbar); ++ ++ if (window) ++ { ++ gboolean window_drag = FALSE; ++ ++ gtk_widget_style_get (toolbar, ++ "window-dragging", &window_drag, ++ NULL); ++ ++ if (window_drag) ++ { ++ gtk_window_begin_move_drag (GTK_WINDOW (window), ++ event->button, ++ event->x_root, ++ event->y_root, ++ event->time); ++ ++ return TRUE; ++ } ++ } ++ + return FALSE; + } + +diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c +index 58ce2db..921c22a 100644 +--- a/gtk/gtkwidget.c ++++ b/gtk/gtkwidget.c +@@ -2443,6 +2443,13 @@ gtk_widget_class_init (GtkWidgetClass *klass) + 0.0, 1.0, 0.04, + GTK_PARAM_READABLE)); + ++ gtk_widget_class_install_style_property (klass, ++ g_param_spec_boolean ("window-dragging", ++ P_("Window dragging"), ++ P_("Window dragging"), ++ FALSE, ++ GTK_PARAM_READWRITE)); ++ + /** + * GtkWidget:draw-border: + *