Ejemplo n.º 1
0
        void OnConfigureRequest(X11.XConfigureRequestEvent ev)
        {
            var changes = new X11.XWindowChanges
            {
                x            = ev.x,
                y            = ev.y,
                width        = ev.width,
                height       = ev.height,
                border_width = ev.border_width,
                sibling      = ev.above,
                stack_mode   = ev.detail
            };

            if (this.WindowIndexByClient.ContainsKey(ev.window))
            {
                // Resize the frame
                Xlib.XConfigureWindow(this.display, this.WindowIndexByClient[ev.window].frame, ev.value_mask, ref changes);
            }
            // Resize the window
            Xlib.XConfigureWindow(this.display, ev.window, ev.value_mask, ref changes);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// <para>Lower this widget to the bottom of its layer.</para>
        /// </summary>
        public override void Lower()
        {
            if (IsMapped)
            {
                GetGrabWindow().LowerPopup(this);
            }

            try
            {
                IntPtr         display = dpy.Lock();
                XWindowChanges changes = new XWindowChanges();
                changes.stack_mode = 0;                                 /* Above */

                Xlib.XConfigureWindow
                    (display, GetWidgetHandle(),
                    (uint)(ConfigureWindowMask.CWStackMode),
                    ref changes);
            }
            finally
            {
                dpy.Unlock();
            }
        }
Ejemplo n.º 3
0
            // Dispatch an event to this widget.
            internal override void DispatchEvent(ref XEvent xevent)
            {
                IntPtr  display;
                XWindow child;

                if (xevent.type == Xsharp.Events.EventType.MapRequest)
                {
                    // This may be notification of a new window
                    // that we need to take control of.
                    try
                    {
                        display = dpy.Lock();
                        child   = xevent.xmaprequest.window;
                        if (WantThisWindow(display, child))
                        {
                            // This is the top-level child window that
                            // we have been waiting for.
                            XWindowChanges wc = new XWindowChanges();
                            wc.width        = embedParent.Width;
                            wc.height       = embedParent.Height;
                            wc.border_width = 0;
                            Xlib.XConfigureWindow
                                (display, child,
                                (int)(ConfigureWindowMask.CWWidth |
                                      ConfigureWindowMask.CWHeight |
                                      ConfigureWindowMask.CWBorderWidth),
                                ref wc);
                            Xlib.XReparentWindow
                                (display, child,
                                embedParent.GetWidgetHandle(), 0, 0);
                            Xlib.XMapWindow(display, child);
                            embedParent.child = child;
                        }
                        else
                        {
                            // We don't want this window, or we already
                            // know about it, so replay the map request.
                            Xlib.XMapWindow(display, child);
                        }
                    }
                    finally
                    {
                        dpy.Unlock();
                    }
                }
                else if (xevent.type == Xsharp.Events.EventType.ConfigureRequest)
                {
                    // Replay the configure event direct to the X server.
                    XWindowChanges wc = new XWindowChanges();
                    wc.x            = xevent.xconfigurerequest.x;
                    wc.y            = xevent.xconfigurerequest.y;
                    wc.width        = xevent.xconfigurerequest.width;
                    wc.height       = xevent.xconfigurerequest.height;
                    wc.border_width = xevent.xconfigurerequest.border_width;
                    wc.sibling      = xevent.xconfigurerequest.above;
                    wc.stack_mode   = xevent.xconfigurerequest.detail;
                    try
                    {
                        display = dpy.Lock();
                        Xlib.XConfigureWindow
                            (display,
                            xevent.xconfigurerequest.window,
                            xevent.xconfigurerequest.value_mask, ref wc);
                    }
                    finally
                    {
                        dpy.Unlock();
                    }
                }
                base.DispatchEvent(ref xevent);
            }