Skip to contentSkip to conversation

ui/gtk.c vs old gtk versions

Qemu-devel Cornelia Huck 4 participants 6 messages Nov 3, 2014 – Nov 4, 2014

lore
Share & tools
lore
#0 lore raw

After the latest gtk updates, master fails to build for me on a SLES11SP3 machine:

/home/cohuck/git/qemu/ui/gtk.c: In function ‘gd_key_event’:
/home/cohuck/git/qemu/ui/gtk.c:943: error: ‘GDK_KEY_Pause’ undeclared (first use in this function) /home/cohuck/git/qemu/ui/gtk.c:943: error: (Each undeclared identifier is reported only once /home/cohuck/git/qemu/ui/gtk.c:943: error: for each function it appears 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 s390 anyway), but we should probably either fence the pause key support or have configure require a more recent version.

#1 lore raw

Am 03.11.2014 um 14:06 hat Cornelia Huck geschrieben:

Quoted 10 lines

After the latest gtk updates, master fails to build for me on a SLES11SP3 machine:

/home/cohuck/git/qemu/ui/gtk.c: In function ‘gd_key_event’:
/home/cohuck/git/qemu/ui/gtk.c:943: error: ‘GDK_KEY_Pause’ undeclared (first use in this function) /home/cohuck/git/qemu/ui/gtk.c:943: error: (Each undeclared identifier is reported only once /home/cohuck/git/qemu/ui/gtk.c:943: error: for each function it appears in.)

Of course, the gtk version is not the freshest:

Quoted 8 lines

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 s390 anyway), but we should probably either fence the pause key support or 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).

Kevin

#2 lore raw
Quoted 14 lines · Kevin Wolf

Am 03.11.2014 um 14:06 hat Cornelia Huck geschrieben:

Quoted 13 lines

After the latest gtk updates, master fails to build for me on a SLES11SP3 machine:

/home/cohuck/git/qemu/ui/gtk.c: In function ‘gd_key_event’:
/home/cohuck/git/qemu/ui/gtk.c:943: error: ‘GDK_KEY_Pause’ undeclared (first use in this function) /home/cohuck/git/qemu/ui/gtk.c:943: error: (Each undeclared identifier is reported only once /home/cohuck/git/qemu/ui/gtk.c:943: error: for each function it appears in.)

Of course, the gtk version is not the freshest:

pkg-config --modversion "gtk+-2.0"
2.18.9

Quoted 8 lines
Quoted 5 lines

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 s390 anyway), but we should probably either fence the pause key support or 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.

Regards,
Daniel

Signature · 4 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|
#3 lore raw
Quoted 30 lines · Daniel P. Berrange
Quoted 14 lines · Kevin Wolf

Am 03.11.2014 um 14:06 hat Cornelia Huck geschrieben:

Quoted 13 lines

After the latest gtk updates, master fails to build for me on a SLES11SP3 machine:

/home/cohuck/git/qemu/ui/gtk.c: In function ‘gd_key_event’:
/home/cohuck/git/qemu/ui/gtk.c:943: error: ‘GDK_KEY_Pause’ undeclared (first use in this function) /home/cohuck/git/qemu/ui/gtk.c:943: error: (Each undeclared identifier is reported only once /home/cohuck/git/qemu/ui/gtk.c:943: error: for each function it appears in.)

Of course, the gtk version is not the freshest:

pkg-config --modversion "gtk+-2.0"
2.18.9

Quoted 8 lines
Quoted 5 lines

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 s390 anyway), but we should probably either fence the pause key support or 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

Quoted 7 lines
   #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.

Indeed ui/gtk.c already has a number of similar workarounds.

Untested fix below. Cornelia or Kevin, can you confirm?

- Cole

ui/gtk.c +1 -0
index de564cc..38bf463 100644
@@ -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
 
 #define HOTKEY_MODIFIERS        (GDK_CONTROL_MASK | GDK_MOD1_MASK)
#4 lore raw
Quoted 18 lines · On Mon, 03 Nov 2014 17:27:39 -0500 Cole Robinson <[email protected]> wrote:

Indeed ui/gtk.c already has a number of similar workarounds.

Untested fix below. Cornelia or Kevin, can you confirm?

- Cole

ui/gtk.c +1 -0
index de564cc..38bf463 100644
@@ -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
 
Quoted 2 lines
  #define HOTKEY_MODIFIERS        (GDK_CONTROL_MASK | GDK_MOD1_MASK)

With this change, master builds for me again.

Tested-by
#5 lore raw
In reply to Cole Robinson

Am 03.11.2014 um 23:27 hat Cole Robinson geschrieben:

Quoted 35 lines · Daniel P. Berrange
Quoted 34 lines · Kevin Wolf
Quoted 14 lines

Am 03.11.2014 um 14:06 hat Cornelia Huck geschrieben:

Quoted 13 lines

After the latest gtk updates, master fails to build for me on a SLES11SP3 machine:

/home/cohuck/git/qemu/ui/gtk.c: In function ‘gd_key_event’:
/home/cohuck/git/qemu/ui/gtk.c:943: error: ‘GDK_KEY_Pause’ undeclared (first use in this function) /home/cohuck/git/qemu/ui/gtk.c:943: error: (Each undeclared identifier is reported only once /home/cohuck/git/qemu/ui/gtk.c:943: error: for each function it appears in.)

Of course, the gtk version is not the freshest:

pkg-config --modversion "gtk+-2.0"
2.18.9

Quoted 8 lines
Quoted 5 lines

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 s390 anyway), but we should probably either fence the pause key support or 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
Quoted 7 lines
Quoted 3 lines

Since there was a fairly small set of key constants that we needed to care about.

Indeed ui/gtk.c already has a number of similar workarounds.

Untested fix below. Cornelia or Kevin, can you confirm?

That seems to fix it for me.

Quoted 14 lines
ui/gtk.c +1 -0
index de564cc..38bf463 100644
@@ -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
 

#define HOTKEY_MODIFIERS (GDK_CONTROL_MASK | GDK_MOD1_MASK)