Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Apr 2004 03:48:39 -0400
From:      Joe Marcus Clarke <marcus@marcuscom.com>
To:        Alexander Kabaev <kan@freebsd.org>
Cc:        FreeBSD GNOME Users <gnome@freebsd.org>
Subject:   Re: Unbreak GTK12 look under GNOME2 and KDE3
Message-ID:  <1082188118.58902.12.camel@shumai.marcuscom.com>
In-Reply-To: <20040416045304.GA1417@freefall.freebsd.org>
References:  <20040416045304.GA1417@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-BewIA3OjBgYYtgDa4baK
Content-Type: multipart/mixed; boundary="=-MNysVZbiwLy3EKiT5aJw"


--=-MNysVZbiwLy3EKiT5aJw
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Fri, 2004-04-16 at 00:53, Alexander Kabaev wrote:
> Newest Gnome and KDE session managers find it fashionable to set
> $GTK_RC_FILES to partially bogus values, which make gtk12 default font
> horribly huge by default. For example, KDE sets the variable to
> /etc/gtk/gtkrc:$HOME/.gtkrc:$HOME/.kde/share/config/gtkrc, where the
> first path is clearly bogus. gnome-session is not far behind there too.
>=20
> Attached patch-gtk::gtkrc.c file replaces existing patch-ad file in
> gtk12/files directory. In addition to patch-ad changes, this file makes
> gtk to _always_ prepend default gtk config file to the list of files,
> supplied by environment.  /usr/X11R6/share/themes/Default/gtk/gtkrc
> provides sane defaults and makes gtk12 default font to be of normal size
> again.
>=20
> Consider committing it to the port, please.

What about something slightly different.  What if we test for the
existence of each file in $GTK_RC_FILES, and only add the default paths
if that none of the files listed in that variable exist (or rather can
be stat'd).  See the attached (runtime untested) patch.

I think this might be more true to the spirit of original code.

Joe

> --
> Alexander Kabaev
>=20
>=20
>=20
> ______________________________________________________________________
> --- gtk/gtkrc.c.orig	Thu Mar 15 13:41:40 2001
> +++ gtk/gtkrc.c	Fri Apr 16 00:24:54 2004
> @@ -260,9 +260,9 @@
> =20
>    var =3D getenv("GTK_DATA_PREFIX");
>    if (var)
> -    path =3D g_strdup_printf("%s%s", var, "/share/gtk/themes");
> +    path =3D g_strdup_printf("%s%s", var, "/share/themes");
>    else
> -    path =3D g_strdup_printf("%s%s", GTK_DATA_PREFIX, "/share/gtk/themes=
");
> +    path =3D g_strdup_printf("%s%s", GTK_DATA_PREFIX, "/share/themes");
>   =20
>    for (n =3D 0; pixmap_path[n]; n++) ;
>    if (n >=3D GTK_RC_MAX_PIXMAP_PATHS - 1)
> @@ -294,7 +294,7 @@
> =20
>    var =3D g_get_home_dir ();
>    if (var)
> -    module_path[n++] =3D g_strdup_printf("%s%s", var, "/.gtk/lib/themes/=
engines");
> +    module_path[n++] =3D g_strdup_printf("%s%s", var, "/.gtk/themes/engi=
nes");
>    module_path[n] =3D NULL;
>  }
> =20
> @@ -312,6 +312,10 @@
>    gtk_rc_default_files[0] =3D NULL;
>    init =3D TRUE;
> =20
> +  str =3D g_strdup_printf ("%s%s", GTK_SYSCONFDIR, "/gtkrc");
> +  gtk_rc_add_default_file (str);
> +  g_free (str);
> +
>    var =3D getenv("GTK_RC_FILES");
>    if (var)
>      {
> @@ -326,10 +330,6 @@
>      }
>    else
>      {
> -      str =3D g_strdup_printf ("%s%s", GTK_SYSCONFDIR, "/gtk/gtkrc");
> -      gtk_rc_add_default_file (str);
> -      g_free (str);
> -
>        var =3D g_get_home_dir ();
>        if (var)
>  	{
>=20
> ______________________________________________________________________
> _______________________________________________
> freebsd-gnome@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-gnome
> To unsubscribe, send any mail to "freebsd-gnome-unsubscribe@freebsd.org"
--=20
PGP Key : http://www.marcuscom.com/pgp.asc

--=-MNysVZbiwLy3EKiT5aJw
Content-Disposition: attachment; filename=patch-ad
Content-Transfer-Encoding: base64
Content-Type: text/plain; name=patch-ad; charset=iso-8859-1

LS0tIGd0ay9ndGtyYy5jLm9yaWcJVGh1IE1hciAxNSAxMzo0MTo0MCAyMDAxDQorKysgZ3RrL2d0
a3JjLmMJU2F0IEFwciAxNy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y3Qgc3RhdCBzYjsNCiANCiAgIGlmIChpbml0KQ0KICAgICByZXR1
cm47DQpAQCAtMzE5LDE0ICszMjAsMTUgQEANCiAgICAgICBpPTA7DQogICAgICAgd2hpbGUgKGZp
bGVzW2ldKQ0KIAl7DQotCSAgZ3RrX3JjX2FkZF9kZWZhdWx0X2ZpbGUgKGZpbGVzW2ldKTsNCisJ
ICBpZiAoc3RhdCAoZmlsZXNbaV0sICZzYikgPT0gMCkNCisJICAgICBndGtfcmNfYWRkX2RlZmF1
bHRfZmlsZSAoZmlsZXNbaV0pOw0KIAkgIGkrKzsNCiAJfQ0KICAgICAgIGdfc3RyZnJlZXYgKGZp
bGVzKTsNCiAgICAgfQ0KLSAgZWxzZQ0KKyAgaWYgKGd0a19yY19kZWZhdWx0X2ZpbGVzWzBdID09
IE5VTEwpDQogICAgIHsNCi0gICAgICBzdHIgPSBnX3N0cmR1cF9wcmludGYgKCIlcyVzIiwgR1RL
X1NZU0NPTkZESVIsICIvZ3RrL2d0a3JjIik7DQorICAgICAgc3RyID0gZ19zdHJkdXBfcHJpbnRm
ICgiJXMlcyIsIEdUS19TWVNDT05GRElSLCAiL2d0a3JjIik7DQogICAgICAgZ3RrX3JjX2FkZF9k
ZWZhdWx0X2ZpbGUgKHN0cik7DQogICAgICAgZ19mcmVlIChzdHIpOw0KIA0K

--=-MNysVZbiwLy3EKiT5aJw--

--=-BewIA3OjBgYYtgDa4baK
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQBAgOFWb2iPiv4Uz4cRAoM5AKCs7qjhdBEQTDvJPdaS63weerNejACfR82X
jTm9jgXKKn4ydLx+uvukBd0=
=tZqb
-----END PGP SIGNATURE-----

--=-BewIA3OjBgYYtgDa4baK--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1082188118.58902.12.camel>