gdk_get_default_root_window [was: (no subject)]

Joe Marcus Clarke marcus at freebsd.org
Thu Dec 1 07:54:19 UTC 2011


On 11/30/11 11:35 AM, John Hein wrote:
> Rene Ladan wrote at 21:56 +0100 on Nov 28, 2011:
>  > Hi,
>  > 
>  > if I compile the attached program with 'gcc -o testgdk `pkg-config
>  > gtk+-2.0 --libs --cflags` testgdk.c' it fails with this assertion:
>  > 
>  > (process:55495): Gdk-CRITICAL **: IA__gdk_screen_get_root_window:
>  > assertion `GDK_IS_SCREEN (screen)' failed
>  > 
>  > This is on an amd64-10 system with clang kernel/world and gcc ports.
>  > All ports are at their current version except the X.org ports for which
>  > I defined WITHOUT_NOUVEAU to let the binary NVidia driver work.
>  > 
>  > It also fails with the xorg-dev ports.
>  > 
>  > Is this a bug?
>  > 
>  > Regards,
>  > René
>  > -- 
>  > http://www.rene-ladan.nl:8080/
>  > 
>  > GPG fingerprint = ADBC ECCD EB5F A6B4 549F  600D 8C9E 647A E564 2BFC
>  > (subkeys.pgp.net)
>  > #include <stdio.h>
>  > #include <gdk/gdk.h>
>  > 
>  > int main(void)
>  > {
>  >        gdk_get_default_root_window();
>  >        return 0;
>  > }
> 
> Don't you need to call gtk_init first?

Not gtk_init() but gdk_init() (both will work, though):

int
main(int argc, char **argv) {
    gdk_init(&argc, &argv);

    gdk_get_default_root_window();
    return 0;
}

Joe

-- 
Joe Marcus Clarke
FreeBSD GNOME Team	::	gnome at FreeBSD.org
FreeNode / #freebsd-gnome
http://www.FreeBSD.org/gnome


More information about the freebsd-gnome mailing list