In System.Windows.Forms:
authorChris Toshok <toshok@novell.com>
Thu, 15 Mar 2007 18:46:23 +0000 (18:46 -0000)
committerChris Toshok <toshok@novell.com>
Thu, 15 Mar 2007 18:46:23 +0000 (18:46 -0000)
[ Fixes bug #81144 ]

* XplatUIX11.cs: implement VirtualScreen independently of
WorkingArea, by querying the _NET_DESKTOP_GEOMETRY root window
property.

2007-03-15  Chris Toshok  <toshok@ximian.com>

In System.Windows.Forms.X11Internal:
2007-03-15  Chris Toshok  <toshok@ximian.com>

* XplatUIX11-new.cs: implement VirtualScreen by getting
X11Display.VirtualScreen instead of using WorkingArea.

* X11Display.cs: implement VirtualScreen.

svn path=/trunk/mcs/; revision=74412

mcs/class/Managed.Windows.Forms/System.Windows.Forms.X11Internal/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms.X11Internal/X11Display.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms.X11Internal/XplatUIX11-new.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs

index a87349a3a315802499ae34d6e14491ecb445261f..2bb8021a131848023e92989f4b1a43b50429ca87 100644 (file)
@@ -1,3 +1,10 @@
+2007-03-15  Chris Toshok  <toshok@ximian.com>
+
+       * XplatUIX11-new.cs: implement VirtualScreen by getting
+       X11Display.VirtualScreen instead of using WorkingArea.
+
+       * X11Display.cs: implement VirtualScreen.
+
 2007-03-15  Ivan N. Zlatev <contact@i-nz.net>
 
        * X11Display.cs: Replaces all uses of the custom 
index 0251ab370ac9570333f4c0865c167c1f8c792643..c6aecc50c67e0107cbd56f098f5dfa723f4b6d6c 100644 (file)
@@ -1713,6 +1713,38 @@ namespace System.Windows.Forms.X11Internal {
                        get { return HoverState.Interval; }
                }
 
+               public Rectangle VirtualScreen {
+                       get {
+                               IntPtr actual_atom;
+                               int actual_format;
+                               IntPtr nitems;
+                               IntPtr bytes_after;
+                               IntPtr prop = IntPtr.Zero;
+                               int width;
+                               int height;
+
+                               Xlib.XGetWindowProperty (display, RootWindow.Handle,
+                                                        Atoms._NET_DESKTOP_GEOMETRY, IntPtr.Zero, new IntPtr (256), false, Atoms.XA_CARDINAL,
+                                                        out actual_atom, out actual_format, out nitems, out bytes_after, ref prop);
+
+                               if ((long)nitems < 2)
+                                       goto failsafe;
+
+                               width = Marshal.ReadIntPtr(prop, 0).ToInt32();
+                               height = Marshal.ReadIntPtr(prop, IntPtr.Size).ToInt32();
+                               Xlib.XFree(prop);
+
+                               return new Rectangle(0, 0, width, height);
+
+                       failsafe:
+                               XWindowAttributes attributes = new XWindowAttributes();
+
+                               Xlib.XGetWindowAttributes (display, RootWindow.Handle, ref attributes);
+
+                               return new Rectangle(0, 0, attributes.width, attributes.height);
+                       }
+               }
+
                public Rectangle WorkingArea {
                        get {
                                IntPtr actual_atom;
index d40a555bb64a386daec4d885189de7cd84ac69b0..8e6291f8e28a7eaf534c36bb18dc611800ca087a 100644 (file)
@@ -231,7 +231,7 @@ namespace System.Windows.Forms.X11Internal {
                } 
 
                internal override Rectangle VirtualScreen {
-                       get { return WorkingArea; }
+                       get { return display.VirtualScreen; }
                } 
 
                internal override Rectangle WorkingArea {
index 29065dd8b121b19563df502a8d55581b51bef743..d79d50438fa2321e9b4e06db708118a31fc60f2f 100644 (file)
@@ -1,3 +1,11 @@
+2007-03-15  Chris Toshok  <toshok@ximian.com>
+
+       [ Fixes bug #81144 ]
+       
+       * XplatUIX11.cs: implement VirtualScreen independently of
+       WorkingArea, by querying the _NET_DESKTOP_GEOMETRY root window
+       property.
+
 2007-03-15  Chris Toshok  <toshok@ximian.com>
 
        * Hwnd.cs: add an internal field for the cached_window_state.
index 11efd9e3e2e8b2112655e1d54986fb05b530d847..3fc9410e72989231c81684bdd6134daa1d568ba4 100644 (file)
@@ -136,7 +136,7 @@ namespace System.Windows.Forms {
                //private static IntPtr _NET_SUPPORTED;
                //private static IntPtr _NET_CLIENT_LIST;
                //private static IntPtr _NET_NUMBER_OF_DESKTOPS;
-               //private static IntPtr _NET_DESKTOP_GEOMETRY;
+               private static IntPtr _NET_DESKTOP_GEOMETRY;
                //private static IntPtr _NET_DESKTOP_VIEWPORT;
                private static IntPtr _NET_CURRENT_DESKTOP;
                //private static IntPtr _NET_DESKTOP_NAMES;
@@ -524,7 +524,7 @@ namespace System.Windows.Forms {
                                //"_NET_SUPPORTED",
                                //"_NET_CLIENT_LIST",
                                //"_NET_NUMBER_OF_DESKTOPS",
-                               //"_NET_DESKTOP_GEOMETRY",
+                               "_NET_DESKTOP_GEOMETRY",
                                //"_NET_DESKTOP_VIEWPORT",
                                "_NET_CURRENT_DESKTOP",
                                //"_NET_DESKTOP_NAMES",
@@ -598,7 +598,7 @@ namespace System.Windows.Forms {
                        //_NET_SUPPORTED = atoms [off++];
                        //_NET_CLIENT_LIST = atoms [off++];
                        //_NET_NUMBER_OF_DESKTOPS = atoms [off++];
-                       //_NET_DESKTOP_GEOMETRY = atoms [off++];
+                       _NET_DESKTOP_GEOMETRY = atoms [off++];
                        //_NET_DESKTOP_VIEWPORT = atoms [off++];
                        _NET_CURRENT_DESKTOP = atoms [off++];
                        //_NET_DESKTOP_NAMES = atoms [off++];
@@ -2059,7 +2059,33 @@ namespace System.Windows.Forms {
 
                internal override  Rectangle VirtualScreen {
                        get {
-                               return WorkingArea;
+                               IntPtr                  actual_atom;
+                               int                     actual_format;
+                               IntPtr                  nitems;
+                               IntPtr                  bytes_after;
+                               IntPtr                  prop = IntPtr.Zero;
+                               int                     width;
+                               int                     height;
+
+                               XGetWindowProperty(DisplayHandle, RootWindow, _NET_DESKTOP_GEOMETRY, IntPtr.Zero, new IntPtr (256), false, (IntPtr)Atom.XA_CARDINAL, out actual_atom, out actual_format, out nitems, out bytes_after, ref prop);
+                               if ((long)nitems < 2)
+                                       goto failsafe;
+
+                               width = Marshal.ReadIntPtr(prop, 0).ToInt32();
+                               height = Marshal.ReadIntPtr(prop, IntPtr.Size).ToInt32();
+
+                               XFree(prop);
+
+                               return new Rectangle(0, 0, width, height);
+
+                       failsafe:
+                               XWindowAttributes       attributes=new XWindowAttributes();
+
+                               lock (XlibLock) {
+                                       XGetWindowAttributes(DisplayHandle, XRootWindow(DisplayHandle, 0), ref attributes);
+                               }
+
+                               return new Rectangle(0, 0, attributes.width, attributes.height);
                        }
                }