Author: gnorton
Date: 2008-01-15 19:34:01 -0500 (Tue, 15 Jan 2008)
New Revision: 93008
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.CarbonInternal/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.CarbonInternal/ControlHandler.cs
Log:
In .:
* ControlHandler.cs: Only mark the dirty area as dirty when we are
told to expose by the subsystem.
2008-01-15 Geoff Norton <[EMAIL PROTECTED]>
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.CarbonInternal/ChangeLog
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.CarbonInternal/ChangeLog
2008-01-16 00:21:09 UTC (rev 93007)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.CarbonInternal/ChangeLog
2008-01-16 00:34:01 UTC (rev 93008)
@@ -1,5 +1,10 @@
2008-01-15 Geoff Norton <[EMAIL PROTECTED]>
+ * ControlHandler.cs: Only mark the dirty area as dirty when we are
+ told to expose by the subsystem.
+
+2008-01-15 Geoff Norton <[EMAIL PROTECTED]>
+
* MouseHandler.cs: Avoid a NRE if we dont know the window the event
came in on.
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.CarbonInternal/ControlHandler.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.CarbonInternal/ControlHandler.cs
2008-01-16 00:21:09 UTC (rev 93007)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.CarbonInternal/ControlHandler.cs
2008-01-16 00:34:01 UTC (rev 93008)
@@ -87,9 +87,11 @@
internal const uint kEventParamDirectObject = 757935405;
internal const uint kEventParamControlPart = 1668313716;
internal const uint kEventParamControlLikesDrag = 1668047975;
+ internal const uint kEventParamRgnHandle = 1919381096;
internal const uint typeControlRef = 1668575852;
internal const uint typeCGContextRef = 1668183160;
internal const uint typeQDPoint = 1363439732;
+ internal const uint typeQDRgnHandle = 1919381096;
internal const uint typeControlPartCode = 1668313716;
internal const uint typeBoolean = 1651470188;
@@ -110,8 +112,24 @@
switch (kind) {
case kEventControlDraw: {
+ IntPtr rgn = IntPtr.Zero;
HIRect bounds = new HIRect ();
- HIViewGetBounds (handle, ref bounds);
+
+ GetEventParameter (eventref,
kEventParamRgnHandle, typeQDRgnHandle, IntPtr.Zero, (uint) Marshal.SizeOf
(typeof (IntPtr)), IntPtr.Zero, ref rgn);
+
+ if (rgn != IntPtr.Zero) {
+ Rect rbounds = new Rect ();
+
+ GetRegionBounds (rgn, ref
rbounds);
+
+ bounds.origin.x = rbounds.left;
+ bounds.origin.y = rbounds.top;
+ bounds.size.width =
rbounds.right - rbounds.left;
+ bounds.size.height =
rbounds.bottom - rbounds.top;
+ } else {
+ HIViewGetBounds (handle, ref
bounds);
+ }
+
Driver.AddExpose (hwnd, client, bounds);
if (!hwnd.visible) {
@@ -144,10 +162,6 @@
return true;
}
case kEventControlVisibilityChanged: {
- HIRect bounds = new HIRect ();
-
- HIViewGetBounds (handle, ref bounds);
- Driver.AddExpose (hwnd, client, bounds);
if (client) {
msg.message = Msg.WM_SHOWWINDOW;
msg.lParam = (IntPtr) 0;
@@ -225,6 +239,8 @@
}
[DllImport
("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+ static extern int GetRegionBounds (IntPtr rgnhandle, ref Rect
region);
+ [DllImport
("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
static extern int GetEventParameter (IntPtr eventref, uint
name, uint type, IntPtr outtype, uint size, IntPtr outsize, ref IntPtr data);
[DllImport
("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
static extern int SetEventParameter (IntPtr eventref, uint
name, uint type, uint size, ref short data);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches