screen location and graphics configuration issues

Maria Papendieck <[email protected]>
Newsgroups gmane.comp.java.ikvm.devel
Message-ID <[email protected]>
Hello,
we noticed that the location returned by 
ikvm.awt.NetComponentPeer.getLocationOnScreen() is wrong (slightly to 
the right, and a bit down). When we subtract the window's insets from 
the location, the returned value is correct.
Furthermore, we had problems with opening a dialog on the second 
monitor, because our cross-compiled Java code used 
ikvm.awt.NetGraphicsDevice.getDefaultConfiguration(). However, this 
returns always the default configuration of the primary screen, no 
matter to which screen the NetGraphicsDevice relates to. Instead it 
should return the default configuration for the NetGraphicsDevice at 
hand. See the attached patch for how to fix both issues. Note: the 
attached patch applies to IKVM release 7.2.4630.5.

Best regards,
Maria

-- 
Maria Papendieck                Phone: (+49) 0391 544569-34
pure-systems GmbH               Fax:   (+49) 0391 544569-90
-- 
pure-systems GmbH
Geschäftsführung: Danilo Beuche, Holger Papajewski
Sitz der Gesellschaft: Magdeburg
Registergericht: Amtsgericht Stendal, HRB 113044

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk

_______________________________________________
Ikvm-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ikvm-developers
screenlocation.diff (text/plain, 1.3 KB)
### Eclipse Workspace Patch 1.0
#P IKVM
Index: awt/graphics.cs
===================================================================
RCS file: /cvsroot/ikvm/ikvm/awt/graphics.cs,v
retrieving revision 1.62
diff -u -r1.62 graphics.cs
--- awt/graphics.cs	10 Mar 2012 22:26:15 -0000	1.62
+++ awt/graphics.cs	14 Nov 2014 14:50:27 -0000
@@ -2030,7 +2030,7 @@
 
         public override java.awt.GraphicsConfiguration getDefaultConfiguration()
         {
-            return new NetGraphicsConfiguration(Screen.PrimaryScreen);
+            return new NetGraphicsConfiguration(screen);
         }
 
         public override string getIDstring()
Index: awt/toolkit-0.95.cs
===================================================================
RCS file: /cvsroot/ikvm/ikvm/awt/toolkit-0.95.cs,v
retrieving revision 1.101
diff -u -r1.101 toolkit-0.95.cs
--- awt/toolkit-0.95.cs	29 Aug 2012 21:19:36 -0000	1.101
+++ awt/toolkit-0.95.cs	14 Nov 2014 14:50:29 -0000
@@ -2638,7 +2638,7 @@
         {
             return NetToolkit.Invoke<java.awt.Point>(delegate
             {
-                Point p = new Point();
+                Point p = new Point(0 - getInsetsLeft(), 0 - getInsetsTop());
                 p = control.PointToScreen(p);
                 return new java.awt.Point(p.X, p.Y);
             });
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.