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: [PATCH] Work around deprecation of gtk_style_context_get_background_color Date: Fri, 29 Sep 2017 23:57:23 +0200 Message-ID: <20170929215723.30791-1-phst@google.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1506722316 22676 195.159.176.226 (29 Sep 2017 21:58:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 29 Sep 2017 21:58:36 +0000 (UTC) Cc: Philipp Stephani To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 29 23:58:32 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 1dy3Im-0005eq-Ci for ged-emacs-devel@m.gmane.org; Fri, 29 Sep 2017 23:58:32 +0200 Original-Received: from localhost ([::1]:37203 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dy3It-0007v7-NC for ged-emacs-devel@m.gmane.org; Fri, 29 Sep 2017 17:58:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dy3II-0007v2-U6 for emacs-devel@gnu.org; Fri, 29 Sep 2017 17:58:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dy3II-0006CQ-AT for emacs-devel@gnu.org; Fri, 29 Sep 2017 17:58:02 -0400 Original-Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:48580) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dy3II-0006CG-3C for emacs-devel@gnu.org; Fri, 29 Sep 2017 17:58:02 -0400 Original-Received: by mail-wm0-x243.google.com with SMTP id m127so1762724wmm.3 for ; Fri, 29 Sep 2017 14:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0D76GvqCsbF0kL9wwhKAd7FjrSemPURStaKMzkpM43U=; b=DTOlECHtC/U4w1AR1p77B0MUD0fWZUC0LUxFxR3HPks+lM3JrigW1LYSIprvrFilor u2+X5Jqz4X3QdQvcSEkqHJII0h3QNGde2ANUu8fnKJj7BBPJNFnXaFQs6H2H+s1xA1pL Bkqzzlu+zcxutCo9lBXxzaj3e41mPV/xIM+R1+FEC4E13eonLNUNk2wRerrG6GujlAw6 Yq+nENLuzQEs3WxBcYUVyxnpZ4KEFUuCplUo7NPEnma27OexSLu+iNeMmqMcSV/ev5lV YB6bde1Hsk+lQWRt/TzNZ8Km6cNAeiaWl9C2B5pdFaBzuX3KYEdIqkUM1nv1fbSms1y8 0K7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0D76GvqCsbF0kL9wwhKAd7FjrSemPURStaKMzkpM43U=; b=AN+j8sUh1Tm5Mkacrbruo49UVzpMxzT5tqymTXxazBEjpQ14SwaoPdNveD5eheH1FV pESthEn+Cn1fGkQUs5PuC9DrSEM4cUqhybWJqWG3e3SYx6N/3NhLiKX45hAVOKyXsYDV xjSKMZz/stTMk/r+eiMV2zi97Nc75H/ND4lw5niVhNVXiAscTEWPZf5jkhpIIaXNe1kX 7VKNvkAwKzY6ydEUhCosm3f/fiZwr2sWQnTyiBLsEqhMXyFtdu3ptca/q94AHF4lw95L 6MGDuq6TyU4skBmpy2DVAWmsQav7Dzf5ThbyR1ATAYHZPtC3q+xomBAzaG/JHoCFih1l H1AQ== X-Gm-Message-State: AMCzsaXApOVWEFSb1hu3LbCWtz7sjtN/d0jfeIyKPmvF81Ngi/vHaEhP 8y8+t83tRwHXwbwEAjDC9c2eEW/l X-Google-Smtp-Source: AOwi7QAjQTL4fEO1iURLVTprKSg2DVdo9/T045BuxKE1q1iH1IuMI7wnE8MsPngf1uwQXDWeIjjMQA== X-Received: by 10.28.154.19 with SMTP id c19mr4102599wme.59.1506722280580; Fri, 29 Sep 2017 14:58:00 -0700 (PDT) Original-Received: from a.muc.corp.google.com ([2a00:79e0:15:4:bfda:710c:4a38:a674]) by smtp.gmail.com with ESMTPSA id 9sm4414365wml.24.2017.09.29.14.57.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Sep 2017 14:58:00 -0700 (PDT) X-Google-Original-From: Philipp Stephani X-Mailer: git-send-email 2.14.2.822.g60be5d43e6-goog In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 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:218954 Archived-At: * 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’t use the concept of - a single background color any more, so we shouldn’t query 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’t use the concept of a + single background color any more, so we shouldn’t query for + it. */ + gtk_style_context_get (gsty, state, + GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &c, + NULL); + col = *c; + gdk_rgba_free (c); + } unsigned short r = col.red * 65535, -- 2.14.2.822.g60be5d43e6-goog