Example #1
0
        // Disassociate this widget instance and all of its children
        // from their X window handles, as the mirror copy in the X
        // server has been lost.
        internal override void Disassociate()
        {
            // Perform the basic disassociation tasks first.
            base.Disassociate();

            // Send a close message and destroy the application group.
            try
            {
                IntPtr d = dpy.Lock();
                if (child != XWindow.Zero && !closeEventSent)
                {
                    closeEventSent = true;
                    Xlib.XSharpSendClose(d, child);
                    Xlib.XFlush(d);
                }
                if (group != XAppGroup.Zero)
                {
                    Xlib.XagDestroyApplicationGroup(d, group);
                    group = XAppGroup.Zero;
                }
            }
            finally
            {
                dpy.Unlock();
            }

            // Clean up the child process.
            ChildDestroyed();
        }
Example #2
0
 // Constructor.
 public AppGroupWidget(Display dpy, Screen screen, XAppGroup group,
                       EmbeddedApplication parent)
     : base(dpy, screen, DrawableKind.Widget, null)
 {
     embedParent = parent;
     handle      = (XDrawable)group;
     dpy.handleMap[(XWindow)handle] = this;
 }
Example #3
0
        // Called when the child window is destroyed.
        private void ChildDestroyed()
        {
            // Clear the child window and destroy the application group.
            child = XWindow.Zero;
            try
            {
                IntPtr d = dpy.Lock();
                if (group != XAppGroup.Zero)
                {
                    Xlib.XagDestroyApplicationGroup(d, group);
                    group = XAppGroup.Zero;
                }
            }
            finally
            {
                dpy.Unlock();
            }

            // Wait for the child process to exit properly.
            if (process != null && !(process.HasExited))
            {
                if (!process.WaitForExit(5000))
                {
                    // Process is still alive!  Kill it the hard way.
                    process.Kill();
                    process = null;
                }
            }

            // Delete the authority file, which we no longer require.
            if (authorityFile != null)
            {
                File.Delete(authorityFile);
                authorityFile = null;
            }

            // Notify subclasses that the child was destroyed.
            if (!closeNotifySent)
            {
                closeNotifySent = true;
                OnClose();
            }
        }
		// Constructor.
		public AppGroupWidget(Display dpy, Screen screen, XAppGroup group,
							  EmbeddedApplication parent)
				: base(dpy, screen, DrawableKind.Widget, null)
				{
					embedParent = parent;
					handle = (XDrawable)group;
					dpy.handleMap[(XWindow)handle] = this;
				}
	// Disassociate this widget instance and all of its children
	// from their X window handles, as the mirror copy in the X
	// server has been lost.
	internal override void Disassociate()
			{
				// Perform the basic disassociation tasks first.
				base.Disassociate();

				// Send a close message and destroy the application group.
				try
				{
					IntPtr d = dpy.Lock();
					if(child != XWindow.Zero && !closeEventSent)
					{
						closeEventSent = true;
						Xlib.XSharpSendClose(d, child);
						Xlib.XFlush(d);
					}
					if(group != XAppGroup.Zero)
					{
						Xlib.XagDestroyApplicationGroup(d, group);
						group = XAppGroup.Zero;
					}
				}
				finally
				{
					dpy.Unlock();
				}

				// Clean up the child process.
				ChildDestroyed();
			}
	// Called when the child window is destroyed.
	private void ChildDestroyed()
			{
				// Clear the child window and destroy the application group.
				child = XWindow.Zero;
				try
				{
					IntPtr d = dpy.Lock();
					if(group != XAppGroup.Zero)
					{
						Xlib.XagDestroyApplicationGroup(d, group);
						group = XAppGroup.Zero;
					}
				}
				finally
				{
					dpy.Unlock();
				}

				// Wait for the child process to exit properly.
				if(process != null && !(process.HasExited))
				{
					if(!process.WaitForExit(5000))
					{
						// Process is still alive!  Kill it the hard way.
						process.Kill();
						process = null;
					}
				}

				// Delete the authority file, which we no longer require.
				if(authorityFile != null)
				{
					File.Delete(authorityFile);
					authorityFile = null;
				}

				// Notify subclasses that the child was destroyed.
				if(!closeNotifySent)
				{
					closeNotifySent = true;
					OnClose();
				}
			}
Example #7
0
	extern public static XStatus XagDestroyApplicationGroup
			(IntPtr display, XAppGroup app_group);
Example #8
0
	extern public static XStatus XagCreateEmbeddedApplicationGroup
			(IntPtr display, XVisualID root_visual, XColormap default_colormap,
			 XPixel black_pixel, XPixel white_pixel, out XAppGroup app_group);