From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlZqK-0004KZ-Iv for qemu-devel@nongnu.org; Tue, 04 Nov 2014 03:52:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlZqE-000746-Dc for qemu-devel@nongnu.org; Tue, 04 Nov 2014 03:52:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57057) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlZqE-000742-5X for qemu-devel@nongnu.org; Tue, 04 Nov 2014 03:51:54 -0500 Date: Tue, 4 Nov 2014 09:51:48 +0100 From: Kevin Wolf Message-ID: <20141104085148.GA4119@noname.redhat.com> References: <20141103140649.2826515c.cornelia.huck@de.ibm.com> <20141103131135.GA22901@noname.str.redhat.com> <20141103133214.GB31724@redhat.com> <5458015B.6080902@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5458015B.6080902@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] ui/gtk.c vs old gtk versions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cole Robinson Cc: Cornelia Huck , qemu-devel@nongnu.org, Gerd Hoffmann Am 03.11.2014 um 23:27 hat Cole Robinson geschrieben: > On 11/03/2014 08:32 AM, Daniel P. Berrange wrote: > >On Mon, Nov 03, 2014 at 02:11:35PM +0100, Kevin Wolf wrote: > >>Am 03.11.2014 um 14:06 hat Cornelia Huck geschrieben: > >>>After the latest gtk updates, master fails to build for me on a > >>>SLES11SP3 machine: > >>> > >>>/home/cohuck/git/qemu/ui/gtk.c: In function =E2=80=98gd_key_event=E2= =80=99: > >>>/home/cohuck/git/qemu/ui/gtk.c:943: error: =E2=80=98GDK_KEY_Pause=E2= =80=99 undeclared (first use in this function) > >>>/home/cohuck/git/qemu/ui/gtk.c:943: error: (Each undeclared identifi= er is reported only once > >>>/home/cohuck/git/qemu/ui/gtk.c:943: error: for each function it appe= ars in.) > >>> > >>>Of course, the gtk version is not the freshest: > >>> > >>>pkg-config --modversion "gtk+-2.0" > >>>2.18.9 > >>> > >>>On machines with less-ancient gtk (say 2.24) everything builds fine. > >>> > >>>I don't really care about gtk support on the SLES11 machine (it's s3= 90 > >>>anyway), but we should probably either fence the pause key support o= r > >>>have configure require a more recent version. > >> > >>I think I saw the same thing on RHEL 6 (and hacked around it because = I > >>didn't have time to investigate it). > > > >In older versions of GDK, the constants were lacking the 'KEY_' part, > >so it would have just been GDK_Pause. > > > >In GTK-VNC I worked around this by adding this kind of thing to our > >source > > > > #ifndef GDK_Return > > #define GDK_Return GDK_KEY_Return > > #endif > > > >Since there was a fairly small set of key constants that we needed to > >care about. > > >=20 > Indeed ui/gtk.c already has a number of similar workarounds. >=20 > Untested fix below. Cornelia or Kevin, can you confirm? That seems to fix it for me. Tested-by: Kevin Wolf > diff --git a/ui/gtk.c b/ui/gtk.c > index de564cc..38bf463 100644 > --- a/ui/gtk.c > +++ b/ui/gtk.c > @@ -128,6 +128,7 @@ static inline void > gdk_drawable_get_size(GdkWindow *w, gint *ww, gint *wh) > #define GDK_KEY_q GDK_q > #define GDK_KEY_plus GDK_plus > #define GDK_KEY_minus GDK_minus > +#define GDK_KEY_Pause GDK_Pause > #endif >=20 > #define HOTKEY_MODIFIERS (GDK_CONTROL_MASK | GDK_MOD1_MASK) >=20