From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Work around deprecation of gtk_style_context_get_background_color Date: Tue, 03 Oct 2017 13:02:09 +0000 Message-ID: References: <20170929215723.30791-1-phst@google.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114191680d833d055aa41acd" X-Trace: blaine.gmane.org 1507035830 8522 195.159.176.226 (3 Oct 2017 13:03:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 3 Oct 2017 13:03:50 +0000 (UTC) To: Philipp Stephani , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 03 15:03:42 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzMrI-0001GP-2Q for ged-emacs-devel@m.gmane.org; Tue, 03 Oct 2017 15:03:36 +0200 Original-Received: from localhost ([::1]:58499 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzMrP-0003D6-EA for ged-emacs-devel@m.gmane.org; Tue, 03 Oct 2017 09:03:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzMqF-0003Ac-TD for emacs-devel@gnu.org; Tue, 03 Oct 2017 09:02:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzMq9-0005eA-OW for emacs-devel@gnu.org; Tue, 03 Oct 2017 09:02:31 -0400 Original-Received: from mail-lf0-x22e.google.com ([2a00:1450:4010:c07::22e]:54520) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzMq9-0005aV-B6 for emacs-devel@gnu.org; Tue, 03 Oct 2017 09:02:25 -0400 Original-Received: by mail-lf0-x22e.google.com with SMTP id d10so7281591lfg.11 for ; Tue, 03 Oct 2017 06:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=fe0x2Qmnu9Qjc1Qt4G+f8MTc8Le5k+cNlcisbmBypsw=; b=RSeCIC6FoC+ynrexR8iRUXskDlTdRX277XHskM0VcReM44r46zWbtJalKgHKVTbF31 AWhYdnvCuHuy35WUr+xIJ8TfinX2nmmkslCdyYSHTS+5WUrKWO3gjcJ221Oqkb+2bNk+ llZfHm1qmuydfhgvMOXSJWPVC/oHcNOcVpyFFkkeJb92O4d1PR8kRA3y3GzHeRQgP5Dx /UNGqj3VzfwfUcwNmIvPlWZqRaE6Uts1oPgzNmiUT8OLcB/QoioLlDxpCXZRNmsRvfGp GzNfYQqj/xu+Rj1zsrBwgCo4d7bM+RKF2tpmLOf+9sswGjKtMiryTBFBGbg4isD0wWXY 4xuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=fe0x2Qmnu9Qjc1Qt4G+f8MTc8Le5k+cNlcisbmBypsw=; b=JTSXt8pO2VcOhFqd5ChqtPbm8DWKEuRNHMt6tyeyN8gGO4DbA17xIF899wdygB6UxP GHinsMcLmF57MH3vLjYlKRDxV+uZ0Pqyjysnp2FmJbh1p8zZXHCudcon+HgHC/iBHIMO c2PZ1lSPeE8bYMRsgTVe1O5O6KQJFYJzRyehtijV9e3bmzZodHDY29b/7W4W45fWSII3 foVivWH14jg0OQsORBApnVmci+9rby2wH5IBtBFD4YYu9ibSkLod9JC1QGMMisNrfcHF 0VKoL4WZpLe8nWU79gQ1N6NwW6iusnL6B+HnnCEBaV5RQ6n4pNXgvz57SFm9odz7OSW/ /WLA== X-Gm-Message-State: AMCzsaXLWx7qztBLWqV0vIB7arcRBmnQ8DjBVHcFKAkTFvisg2D5Aoym T3RDsgBkgVxFolASdm3ahc1bl8H1ZkQBtmnDhPkF5A== X-Google-Smtp-Source: AOwi7QBV15k8voL6LmV3ZNXg/rQ0JvkUZTaFRY369v6IVYtWubn2OZcvc+zqNsdyg6QbEuWCI81icfGDAmjFYke389Q= X-Received: by 10.25.77.208 with SMTP id a199mr1655915lfb.206.1507035741725; Tue, 03 Oct 2017 06:02:21 -0700 (PDT) In-Reply-To: <20170929215723.30791-1-phst@google.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219030 Archived-At: --001a114191680d833d055aa41acd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Philipp Stephani schrieb am Fr., 29. Sep. 2017 um 23:58 Uhr: > * src/gtkutil.c (xg_check_special_colors): Replace call to > gtk_style_context_get_background_color with its definition. > --- > src/gtkutil.c | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > > diff --git a/src/gtkutil.c b/src/gtkutil.c > index 9f05524738..015456cd81 100644 > --- a/src/gtkutil.c > +++ b/src/gtkutil.c > @@ -577,11 +577,18 @@ xg_check_special_colors (struct frame *f, > if (get_fg) > gtk_style_context_get_color (gsty, state, &col); > else > - /* FIXME: gtk_style_context_get_background_color is deprecated > - in GTK+ 3.16. New versions of GTK+ don=E2=80=99t use the conce= pt of > - a single background color any more, so we shouldn=E2=80=99t que= ry for > - it. */ > - gtk_style_context_get_background_color (gsty, state, &col); > + { > + GdkRGBA *c; > + /* FIXME: Retrieving the background color is deprecated in > + GTK+ 3.16. New versions of GTK+ don=E2=80=99t use the concep= t of a > + single background color any more, so we shouldn=E2=80=99t que= ry for > + it. */ > + gtk_style_context_get (gsty, state, > + GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &c, > + NULL); > + col =3D *c; > + gdk_rgba_free (c); > + } > > Pushed as 0fff900c18 to emacs-26. --=20 Google Germany GmbH Erika-Mann-Stra=C3=9Fe 33 80636 M=C3=BCnchen Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado If you received this communication by mistake, please don't forward it to anyone else (it may contain confidential or privileged information), please erase all copies of it, including all attachments, and please let the sender know it went to the wrong person. Thanks. --001a114191680d833d055aa41acd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Philip= p Stephani <p.stephani2@gmail.c= om> schrieb am Fr., 29. Sep. 2017 um 23:58=C2=A0Uhr:
* src/gtkutil.c (xg_check_special_colors): Replace= call to
gtk_style_context_get_background_color with its definition.
---
=C2=A0src/gtkutil.c | 17 ++++++++++++-----
=C2=A01 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/gtkutil.c b/src/gtkutil.c
index 9f05524738..015456cd81 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -577,11 +577,18 @@ xg_check_special_colors (struct frame *f,
=C2=A0 =C2=A0 =C2=A0if (get_fg)
=C2=A0 =C2=A0 =C2=A0 =C2=A0gtk_style_context_get_color (gsty, state, &c= ol);
=C2=A0 =C2=A0 =C2=A0else
-=C2=A0 =C2=A0 =C2=A0 /* FIXME: gtk_style_context_get_background_color is d= eprecated
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0in GTK+ 3.16.=C2=A0 New versions of GTK+= don=E2=80=99t use the concept of
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0a single background color any more, so w= e shouldn=E2=80=99t query for
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0it.=C2=A0 */
-=C2=A0 =C2=A0 =C2=A0 gtk_style_context_get_background_color (gsty, state, = &col);
+=C2=A0 =C2=A0 =C2=A0 {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 GdkRGBA *c;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* FIXME: Retrieving the background color is d= eprecated in
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0GTK+ 3.16.=C2=A0 New versions of = GTK+ don=E2=80=99t use the concept of a
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0single background color any more,= so we shouldn=E2=80=99t query for
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0it.=C2=A0 */
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 gtk_style_context_get (gsty, state,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0GTK_STYLE_PROPERTY_BACKGROUND_COLOR, = &c,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NULL);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 col =3D *c;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 gdk_rgba_free (c);
+=C2=A0 =C2=A0 =C2=A0 }


Pushed as=C2=A00fff900c18 to emacs-26.=
--

Goog= le Germany GmbH
Erika-Mann-Stra=C3=9Fe 33
80636 M=C3=BCnchen

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado

If you received this communication by mistake, please don= 9;t forward it to anyone else (it may contain confidential or privileged in= formation), please erase all copies of it, including all attachments, and p= lease let the sender know it went to the wrong person. Thanks.

--001a114191680d833d055aa41acd--