public static Visual GetRgbaVisual(Screen screen)
 {
     try {
         var raw_ret = gdk_screen_get_rgba_visual(screen.Handle);
         var ret     = GLib.Object.GetObject(raw_ret) as Gdk.Visual;
         return(ret);
     } catch {
         Gdk.Visual visual = Gdk.Visual.GetBestWithDepth(32);
         if (visual != null)
         {
             return(visual);
         }
     }
     return(null);
 }
 public static Colormap GetRgbaColormap(Screen screen)
 {
     try {
         var raw_ret = gdk_screen_get_rgba_colormap(screen.Handle);
         var ret     = GLib.Object.GetObject(raw_ret) as Gdk.Colormap;
         return(ret);
     } catch {
         Gdk.Visual visual = Gdk.Visual.GetBestWithDepth(32);
         if (visual != null)
         {
             var cmap = new Gdk.Colormap(visual, false);
             Log.Debug("fallback");
             return(cmap);
         }
     }
     return(null);
 }
Exemple #3
0
 public static Colormap GetRgbaColormap(Screen screen)
 {
     try {
         IntPtr       raw_ret = gdk_screen_get_rgba_colormap(screen.Handle);
         Gdk.Colormap ret     = GLib.Object.GetObject(raw_ret) as Gdk.Colormap;
         return(ret);
     } catch {
         Gdk.Visual visual = Gdk.Visual.GetBestWithDepth(32);
         if (visual != null)
         {
             Gdk.Colormap cmap = new Gdk.Colormap(visual, false);
             System.Console.WriteLine("fallback");
             return(cmap);
         }
     }
     return(null);
 }