Re: [gtk-list] gdk.c suggestion.



On Sun, 31 May 1998, Asbjoern Pettersen wrote:

> 
> Hello.
> I'm the author of the OS/2 port of GIMP and i have some stange problems
> when starting some plug-ins. The error occour in gdk.c
> 
> To solve it i add some tests in gdk.c
> The __EMX__ is a build in define for the emx compiler.
> The code will only effect the OS/2 version.

hm, is there an OS/2 specific define also (__OS_2__ or something the like)?

> Suggestion:
> 
> gdk.c
> 
> #ifdef __EMX__
>   if (gdk_display_name == NULL)
>    {
>     	gdk_display_name= getenv("DISPLAY");
>     	if (gdk_display_name == NULL)	/* very strange ! */
>     	   gdk_display_name="127.0.0.1:0.0";
>    	g_print ("gdk_display_name=%s\n",gdk_display_name);
>    }
> #endif

so we can do
#ifdef __OS_2__
  if (!gdk_display_name)
    {
      gdk_display_name = getenv("DISPLAY");
      if (!gdk_display_name)
        gdk_display_name="127.0.0.1:0.0";
      GDK_NOTE (MISC,
        g_print ("Gdk: OS/2 display fallback: %s\n", gdk_display_name));
    }
#endif /* __OS_2__ */
      
>   gdk_display = XOpenDisplay (gdk_display_name);
>   if (!gdk_display)
>     {
>       g_warning ("cannot open display: %s", XDisplayName (gdk_display_name));
>       exit(1);
>     }

> 
> Can somebody add this test ?

since __EMX__ is not only defined for OS/2, and if this fix is
only required for OS/2, we should test for OS/2.

> 
> Asbjoern P.
> 

---
ciaoTJ



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]