System.Windows.Forms.XplatUIX11.GetTotalVisibleArea C# (CSharp) Method

GetTotalVisibleArea() private method

private GetTotalVisibleArea ( IntPtr handle ) : Rectangle
handle IntPtr
return Rectangle
		Rectangle GetTotalVisibleArea (IntPtr handle)
		{
			Control c = Control.FromHandle (handle);

			Rectangle visible_area = c.ClientRectangle;
			visible_area.Location = c.PointToScreen (Point.Empty);

			for (Control parent = c.Parent; parent != null; parent = parent.Parent) {
				if (!parent.IsHandleCreated || !parent.Visible)
					return visible_area; // Non visible, not need to finish computations

				Rectangle r = parent.ClientRectangle;
				r.Location = parent.PointToScreen (Point.Empty);

				visible_area.Intersect (r);
			}

			visible_area.Location = c.PointToClient (visible_area.Location);
			return visible_area;
		}
XplatUIX11