コード例 #1
0
        void ShapeWindow()
        {
            Layout();
            var bitmap = new Pixmap(GdkWindow,
                                    Allocation.Width,
                                    Allocation.Height, 1);

            Context g = CairoHelper.Create(bitmap);

            DrawShape(g, Allocation.Width, Allocation.Height);

            g.Dispose();

            if (use_shape_ext)
            {
                ShapeCombineMask(bitmap, 0, 0);
            }
            else
            {
                Context rgba = CairoHelper.Create(GdkWindow);
                DrawShape(rgba, Allocation.Width, Allocation.Height);
                rgba.Dispose();
                try {
                    CompositeUtils.InputShapeCombineMask(this, bitmap, 0, 0);
                } catch (EntryPointNotFoundException) {
                    Log.Warning("gtk+ version doesn't support input shapping");
                }
            }
            bitmap.Dispose();
        }
コード例 #2
0
        protected override void OnRealized()
        {
            use_shape_ext = !(CompositeUtils.IsComposited(Screen) && CompositeUtils.SetRgbaColormap(this));

            base.OnRealized();
            ShapeWindow();
        }
コード例 #3
0
ファイル: PreviewPopup.cs プロジェクト: f-spot/f-spot-xplat
        protected override void OnRealized()
        {
            bool composited = CompositeUtils.IsComposited(Screen) && CompositeUtils.SetRgbaColormap(this);

            AppPaintable = composited;
            base.OnRealized();
        }
コード例 #4
0
 public static void SetWinOpacity(Gtk.Window win, double opacity)
 {
     CompositeUtils.ChangeProperty(win.GdkWindow,
                                   Atom.Intern("_NET_WM_WINDOW_OPACITY", false),
                                   Atom.Intern("CARDINAL", false),
                                   PropMode.Replace,
                                   new uint [] { (uint)(0xffffffff * opacity) });
 }
コード例 #5
0
        public static bool IsComposited(Screen screen)
        {
            bool composited;

            try {
                composited = gdk_screen_is_composited(screen.Handle);
            } catch (EntryPointNotFoundException) {
                System.Console.WriteLine("query composite manager locally");
                Atom atom = Atom.Intern(String.Format("_NET_WM_CM_S{0}", screen.Number), false);
                composited = Gdk.Selection.OwnerGetForDisplay(screen.Display, atom) != null;
            }

            // FIXME check for WINDOW_OPACITY so that we support compositing on older composite manager
            // versions before they started supporting the real check given above
            if (!composited)
            {
                composited = CompositeUtils.SupportsHint(screen, "_NET_WM_WINDOW_OPACITY");
            }

            return(composited);
        }
コード例 #6
0
ファイル: Overlay.cs プロジェクト: swgshaw/f-spot
 protected override void OnRealized()
 {
     compositing = CompositeUtils.SetRgbaColormap(this);
 }