Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=36665b8f6605727e7e430d4ade9a3fca732e8cfe

commit 36665b8f6605727e7e430d4ade9a3fca732e8cfe
Author: Devil505 <devil505li...@gmail.com>
Date:   Sat Oct 15 11:22:23 2011 +0200

gtk+2-2.24.5-3-i686
* added patch: 100_overlay_scrollbar_loading.patch

diff --git a/source/xlib/gtk+2/100_overlay_scrollbar_loading.patch 
b/source/xlib/gtk+2/100_overlay_scrollbar_loading.patch
new file mode 100644
index 0000000..064c34a
--- /dev/null
+++ b/source/xlib/gtk+2/100_overlay_scrollbar_loading.patch
@@ -0,0 +1,252 @@
+## Description: add some description
+## Origin/Author: add some origin or author
+## Bug: bug URL
+=== modified file 'gtk/gtkmain.c'
+Index: gtk+2.0-2.24.3/gtk/gtkmain.c
+===================================================================
+--- gtk+2.0-2.24.3.orig/gtk/gtkmain.c  2011-03-29 15:48:57.165895636 +0200
++++ gtk+2.0-2.24.3/gtk/gtkmain.c       2011-03-29 15:53:32.063258778 +0200
+@@ -752,6 +752,7 @@
+
+   _gtk_accel_map_init ();
+   _gtk_rc_init ();
++  ubuntu_gtk_scrolled_window_init ();
+
+   /* Set the 'initialized' flag.
+    */
+Index: gtk+2.0-2.24.3/gtk/gtkscrolledwindow.c
+===================================================================
+--- gtk+2.0-2.24.3.orig/gtk/gtkscrolledwindow.c        2011-03-23 
16:21:04.677924068 +0100
++++ gtk+2.0-2.24.3/gtk/gtkscrolledwindow.c     2011-03-29 15:53:13.203165248 
+0200
+@@ -144,6 +144,9 @@
+
+ static guint signals[LAST_SIGNAL] = {0};
+
++static GtkWidget* (*os_scrollbar_new) (GtkOrientation, GtkAdjustment*) = NULL;
++static gboolean use_overlay_scrollbar = FALSE;
++
+ G_DEFINE_TYPE (GtkScrolledWindow, gtk_scrolled_window, GTK_TYPE_BIN)
+
+ static void
+@@ -434,7 +437,12 @@
+   if (!scrolled_window->hscrollbar)
+     {
+       gtk_widget_push_composite_child ();
+-      scrolled_window->hscrollbar = gtk_hscrollbar_new (hadjustment);
++
++      if (use_overlay_scrollbar == FALSE)
++        scrolled_window->hscrollbar = gtk_hscrollbar_new (hadjustment);
++      else
++        scrolled_window->hscrollbar = os_scrollbar_new 
(GTK_ORIENTATION_HORIZONTAL, hadjustment);
++
+       gtk_widget_set_composite_name (scrolled_window->hscrollbar, 
"hscrollbar");
+       gtk_widget_pop_composite_child ();
+
+@@ -495,7 +503,12 @@
+   if (!scrolled_window->vscrollbar)
+     {
+       gtk_widget_push_composite_child ();
+-      scrolled_window->vscrollbar = gtk_vscrollbar_new (vadjustment);
++
++      if (use_overlay_scrollbar == FALSE)
++        scrolled_window->vscrollbar = gtk_vscrollbar_new (vadjustment);
++      else
++        scrolled_window->vscrollbar = os_scrollbar_new 
(GTK_ORIENTATION_VERTICAL, vadjustment);
++
+       gtk_widget_set_composite_name (scrolled_window->vscrollbar, 
"vscrollbar");
+       gtk_widget_pop_composite_child ();
+
+@@ -1030,7 +1043,7 @@
+
+       gtk_widget_style_get (widget, "scrollbars-within-bevel", 
&scrollbars_within_bevel, NULL);
+
+-      if (!scrollbars_within_bevel)
++      if (!scrollbars_within_bevel && use_overlay_scrollbar == FALSE)
+         {
+           gtk_scrolled_window_relative_allocation (widget, 
&relative_allocation);
+
+@@ -1350,35 +1363,46 @@
+
+   if (scrolled_window->vscrollbar_visible)
+     {
+-      GtkRequisition vscrollbar_requisition;
+-      gboolean is_rtl;
++      if (use_overlay_scrollbar == FALSE)
++        {
++          GtkRequisition vscrollbar_requisition;
++          gboolean is_rtl;
+
+-      gtk_widget_get_child_requisition (scrolled_window->vscrollbar,
+-                                      &vscrollbar_requisition);
+-      is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
+-
+-      if ((!is_rtl &&
+-         (priv->real_window_placement == GTK_CORNER_TOP_RIGHT ||
+-          priv->real_window_placement == GTK_CORNER_BOTTOM_RIGHT)) ||
+-        (is_rtl &&
+-         (priv->real_window_placement == GTK_CORNER_TOP_LEFT ||
+-          priv->real_window_placement == GTK_CORNER_BOTTOM_LEFT)))
+-      allocation->x += (vscrollbar_requisition.width +  scrollbar_spacing);
++          gtk_widget_get_child_requisition (scrolled_window->vscrollbar,
++                                          &vscrollbar_requisition);
++          is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
++
++          if ((!is_rtl &&
++             (priv->real_window_placement == GTK_CORNER_TOP_RIGHT ||
++              priv->real_window_placement == GTK_CORNER_BOTTOM_RIGHT)) ||
++            (is_rtl &&
++             (priv->real_window_placement == GTK_CORNER_TOP_LEFT ||
++              priv->real_window_placement == GTK_CORNER_BOTTOM_LEFT)))
++          allocation->x += (vscrollbar_requisition.width +  
scrollbar_spacing);
+
+-      allocation->width = MAX (1, allocation->width - 
(vscrollbar_requisition.width + scrollbar_spacing));
++          allocation->width = MAX (1, allocation->width - 
(vscrollbar_requisition.width + scrollbar_spacing));
++        }
++      else
++        allocation->width = MAX (1, allocation->width);
+     }
+   if (scrolled_window->hscrollbar_visible)
+     {
+-      GtkRequisition hscrollbar_requisition;
+-      gtk_widget_get_child_requisition (scrolled_window->hscrollbar,
+-                                      &hscrollbar_requisition);
+-
+-      if (priv->real_window_placement == GTK_CORNER_BOTTOM_LEFT ||
+-        priv->real_window_placement == GTK_CORNER_BOTTOM_RIGHT)
+-      allocation->y += (hscrollbar_requisition.height + scrollbar_spacing);
++      if (use_overlay_scrollbar == FALSE)
++        {
++          GtkRequisition hscrollbar_requisition;
++          gtk_widget_get_child_requisition (scrolled_window->hscrollbar,
++                                          &hscrollbar_requisition);
++
++          if (priv->real_window_placement == GTK_CORNER_BOTTOM_LEFT ||
++            priv->real_window_placement == GTK_CORNER_BOTTOM_RIGHT)
++          allocation->y += (hscrollbar_requisition.height + 
scrollbar_spacing);
+
+-      allocation->height = MAX (1, allocation->height - 
(hscrollbar_requisition.height + scrollbar_spacing));
++          allocation->height = MAX (1, allocation->height - 
(hscrollbar_requisition.height + scrollbar_spacing));
++        }
++      else
++        allocation->height = MAX (1, allocation->height);
+     }
++
+ }
+
+ static void
+@@ -1490,7 +1514,7 @@
+
+       if (scrolled_window->shadow_type != GTK_SHADOW_NONE)
+       {
+-          if (!scrollbars_within_bevel)
++          if (!scrollbars_within_bevel && use_overlay_scrollbar == FALSE)
+             {
+               child_allocation.x -= widget->style->xthickness;
+               child_allocation.width += 2 * widget->style->xthickness;
+@@ -1542,7 +1566,7 @@
+
+       if (scrolled_window->shadow_type != GTK_SHADOW_NONE)
+       {
+-          if (!scrollbars_within_bevel)
++          if (!scrollbars_within_bevel && use_overlay_scrollbar == FALSE)
+             {
+               child_allocation.y -= widget->style->ythickness;
+             child_allocation.height += 2 * widget->style->ythickness;
+@@ -1763,6 +1787,75 @@
+ }
+
+ /*
++ * ubuntu_gtk_scrolled_window_init:
++ *
++ * Initialize local use of the overlay-scrollbar module.
++ *
++ * If the module is installed, this code checks both a whitelist
++ * and a blacklist to decide whether to activate the remplacement
++ * scrollbars.
++ *
++ * It is possible to force the feature to be disabled by setting
++ * the LIBOVERLAY_SCROLLBAR environment variable to either '0' or an
++ * empty value.
++ */
++void
++ubuntu_gtk_scrolled_window_init (void)
++{
++  static gboolean init_once = FALSE;
++
++  if (init_once == FALSE)
++    {
++      GModule *module = NULL;
++      gpointer symbol = NULL;
++
++      gchar *flag = (gchar*) g_getenv ("LIBOVERLAY_SCROLLBAR");
++
++      /* check if LIBOVERLAY_SCROLLBAR is set to 0 or an empty value
++         and disable the feature in this case */
++      if (flag != NULL && (*flag == '\0' || *flag == '0'))
++        goto skip_loading;
++
++      /* default extension library to use for this release */
++      gchar *path = "/usr/lib/liboverlay-scrollbar-0.1.so.0";
++
++      module = g_module_open (path, G_MODULE_BIND_LOCAL);
++      if (module == NULL)
++        goto skip_loading;
++
++      /* check the blacklist, in all cases */
++      if (g_module_symbol (module, "os_utils_is_blacklisted", &symbol))
++        {
++          gboolean (*os_utils_is_blacklisted) (const gchar*) = symbol;
++          if (os_utils_is_blacklisted (g_get_prgname ()) == TRUE)
++            goto skip_loading;
++        }
++
++      /* if the feature was not explicitely activated by the env.
++         variable, check the whitelist before loading */
++      if (g_getenv ("LIBOVERLAY_SCROLLBAR") == NULL)
++        {
++           if (g_module_symbol (module, "os_utils_is_whitelisted", &symbol))
++             {
++               gboolean (*os_utils_is_whitelisted) (const gchar*) = symbol;
++               if (os_utils_is_whitelisted (g_get_prgname ()) == FALSE)
++                 goto skip_loading;
++             }
++        }
++
++      /* all controls are positive: the feature can be activated now */
++      if (g_module_symbol (module, "os_scrollbar_new", &symbol))
++        {
++          os_scrollbar_new = symbol;
++          use_overlay_scrollbar = TRUE;
++        }
++
++skip_loading:
++      init_once = TRUE;
++    }
++}
++
++/*
+  * _gtk_scrolled_window_get_spacing:
+  * @scrolled_window: a scrolled window
+  *
+@@ -1780,6 +1873,9 @@
+
+   class = GTK_SCROLLED_WINDOW_GET_CLASS (scrolled_window);
+
++  if (use_overlay_scrollbar == TRUE)
++    return 0;
++
+   if (class->scrollbar_spacing >= 0)
+     return class->scrollbar_spacing;
+   else
+Index: gtk+2.0-2.24.3/gtk/gtkscrolledwindow.h
+===================================================================
+--- gtk+2.0-2.24.3.orig/gtk/gtkscrolledwindow.h        2011-03-23 
16:21:04.637923867 +0100
++++ gtk+2.0-2.24.3/gtk/gtkscrolledwindow.h     2011-03-29 15:53:21.519206487 
+0200
+@@ -127,6 +127,7 @@
+ void         gtk_scrolled_window_add_with_viewport (GtkScrolledWindow 
*scrolled_window,
+                                                     GtkWidget         *child);
+
++void ubuntu_gtk_scrolled_window_init            (void);
+ gint _gtk_scrolled_window_get_scrollbar_spacing (GtkScrolledWindow 
*scrolled_window);
+
+
diff --git a/source/xlib/gtk+2/FrugalBuild b/source/xlib/gtk+2/FrugalBuild
index 4ab05c6..4f21ec3 100644
--- a/source/xlib/gtk+2/FrugalBuild
+++ b/source/xlib/gtk+2/FrugalBuild
@@ -4,7 +4,7 @@
pkgname=gtk+2
_F_gnome_name=gtk+
pkgver=2.24.5
-pkgrel=1
+pkgrel=3
pkgdesc="The GTK+ Toolkit (2.x series)"
depends=('libxext' 'libxfixes' 'cairo>=1.8.10-2' 'libgcc' 'libjpeg>=8a' 
'libtiff' 'libcups>=1.3.11-4' 'gdk-pixbuf2>=2.23.0-5')
rodepends=('gnome-icon-theme' 'shared-mime-info')
@@ -24,7 +24,8 @@ source=($source \
044_grips.patch \
065_gir_set_packages.patch \
072_indicator_menu_update.patch \
-        091_bugzilla_tooltip_refresh.patch)
+        091_bugzilla_tooltip_refresh.patch \
+        100_overlay_scrollbar_loading.patch)
sha1sums=('ddae2c87f6edfae7ed944419ae7f47017af07eec' \
'75c461740e18696a792739cd1f9a20327dbb23bb' \
'b4a6b53cd07a63f0df59fe80be597910e8db90c5' \
@@ -32,7 +33,8 @@ sha1sums=('ddae2c87f6edfae7ed944419ae7f47017af07eec' \
'32750305c024b8690820f7260a8622c76aa06854' \
'b48134a8c2a81e24539904e7ddf780ced75d4d93' \
'7a6606c8cf3cecba86c5f264208eb9c7cc405072' \
-          'd8d23cead06029d8f3bfe59b63a629bb38c3d3c6')
+          'd8d23cead06029d8f3bfe59b63a629bb38c3d3c6' \
+          '3b9320052e4171589a227e3259483ef8fc877e5b')

subpkgs=("${subpkgs[@]}" "$pkgname-libs")
subdescs=("${subdescs[@]}" "GTK+2 core libraries.")
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to