You've already forked linux-packaging-mono
Imported Upstream version 4.3.2.467
Former-commit-id: 9c2cb47f45fa221e661ab616387c9cda183f283d
This commit is contained in:
@@ -35,6 +35,7 @@ namespace System.Windows.Forms {
|
||||
public object [] Args;
|
||||
public AsyncMethodResult Result;
|
||||
public ExecutionContext Context;
|
||||
public SynchronizationContext SyncContext;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -98,7 +98,7 @@ namespace System.Windows.Forms
|
||||
items = new ObjectCollection (this);
|
||||
DropDownStyle = ComboBoxStyle.DropDown;
|
||||
item_height = FontHeight + 2;
|
||||
background_color = ThemeEngine.Current.ColorWindow;
|
||||
background_color = ThemeEngine.Current.ColorControl;
|
||||
border_style = BorderStyle.None;
|
||||
|
||||
drop_down_height = default_drop_down_height;
|
||||
|
@@ -102,7 +102,7 @@ namespace System.Windows.Forms
|
||||
|
||||
requested_height = bounds.Height;
|
||||
InternalBorderStyle = BorderStyle.Fixed3D;
|
||||
BackColor = ThemeEngine.Current.ColorWindow;
|
||||
BackColor = ThemeEngine.Current.ColorControl;
|
||||
|
||||
/* Vertical scrollbar */
|
||||
vscrollbar = new ImplicitVScrollBar ();
|
||||
|
@@ -69,8 +69,8 @@ namespace System.Windows.Forms {
|
||||
this.RightToLeftChanged += new EventHandler (TextBox_RightToLeftChanged);
|
||||
MouseWheel += new MouseEventHandler (TextBox_MouseWheel);
|
||||
|
||||
BackColor = SystemColors.Window;
|
||||
ForeColor = SystemColors.WindowText;
|
||||
BackColor = ThemeEngine.Current.ColorControl;
|
||||
ForeColor = ThemeEngine.Current.ColorControlText;
|
||||
backcolor_set = false;
|
||||
|
||||
SetStyle (ControlStyles.StandardClick | ControlStyles.StandardDoubleClick, false);
|
||||
|
@@ -1 +1 @@
|
||||
45cc115fe554b915cd5ae664ba7d1ee20eb3acb3
|
||||
1d090632a1ac178fa39c8d2a335a6c32534ba0f1
|
@@ -118,7 +118,7 @@ namespace System.Windows.Forms {
|
||||
return lqueue.Peek ();
|
||||
}
|
||||
}
|
||||
return xqueue.Peek();
|
||||
return xqueue.Peek ();
|
||||
}
|
||||
|
||||
public bool DispatchIdle {
|
||||
@@ -136,22 +136,30 @@ namespace System.Windows.Forms {
|
||||
private XEvent xevent;
|
||||
|
||||
public PaintQueue (int size) {
|
||||
hwnds = new ArrayList(size);
|
||||
xevent = new XEvent();
|
||||
hwnds = new ArrayList (size);
|
||||
xevent = new XEvent ();
|
||||
xevent.AnyEvent.type = XEventName.Expose;
|
||||
}
|
||||
|
||||
public int Count {
|
||||
get { return hwnds.Count; }
|
||||
get {
|
||||
lock (hwnds) {
|
||||
return hwnds.Count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Enqueue (Hwnd hwnd) {
|
||||
hwnds.Add(hwnd);
|
||||
lock (hwnds) {
|
||||
hwnds.Add (hwnd);
|
||||
}
|
||||
}
|
||||
|
||||
public void Remove(Hwnd hwnd) {
|
||||
if (!hwnd.expose_pending && !hwnd.nc_expose_pending) {
|
||||
hwnds.Remove(hwnd);
|
||||
lock (hwnds) {
|
||||
hwnds.Remove (hwnd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,36 +167,38 @@ namespace System.Windows.Forms {
|
||||
Hwnd hwnd;
|
||||
IEnumerator next;
|
||||
|
||||
if (hwnds.Count == 0) {
|
||||
xevent.ExposeEvent.window = IntPtr.Zero;
|
||||
return xevent;
|
||||
}
|
||||
lock (hwnds) {
|
||||
if (hwnds.Count == 0) {
|
||||
xevent.ExposeEvent.window = IntPtr.Zero;
|
||||
return xevent;
|
||||
}
|
||||
|
||||
next = hwnds.GetEnumerator();
|
||||
next.MoveNext();
|
||||
hwnd = (Hwnd)next.Current;
|
||||
next = hwnds.GetEnumerator ();
|
||||
next.MoveNext ();
|
||||
hwnd = (Hwnd)next.Current;
|
||||
|
||||
// We only remove the event from the queue if we have one expose left since
|
||||
// a single 'entry in our queue may be for both NC and Client exposed
|
||||
if ( !(hwnd.nc_expose_pending && hwnd.expose_pending)) {
|
||||
hwnds.Remove(hwnd);
|
||||
}
|
||||
if (hwnd.expose_pending) {
|
||||
xevent.ExposeEvent.window = hwnd.client_window;
|
||||
// We only remove the event from the queue if we have one expose left since
|
||||
// a single 'entry in our queue may be for both NC and Client exposed
|
||||
if (!(hwnd.nc_expose_pending && hwnd.expose_pending)) {
|
||||
hwnds.Remove (hwnd);
|
||||
}
|
||||
if (hwnd.expose_pending) {
|
||||
xevent.ExposeEvent.window = hwnd.client_window;
|
||||
#if not
|
||||
xevent.ExposeEvent.x = hwnd.invalid.X;
|
||||
xevent.ExposeEvent.y = hwnd.invalid.Y;
|
||||
xevent.ExposeEvent.width = hwnd.invalid.Width;
|
||||
xevent.ExposeEvent.height = hwnd.invalid.Height;
|
||||
xevent.ExposeEvent.x = hwnd.invalid.X;
|
||||
xevent.ExposeEvent.y = hwnd.invalid.Y;
|
||||
xevent.ExposeEvent.width = hwnd.invalid.Width;
|
||||
xevent.ExposeEvent.height = hwnd.invalid.Height;
|
||||
#endif
|
||||
return xevent;
|
||||
} else {
|
||||
xevent.ExposeEvent.window = hwnd.whole_window;
|
||||
xevent.ExposeEvent.x = hwnd.nc_invalid.X;
|
||||
xevent.ExposeEvent.y = hwnd.nc_invalid.Y;
|
||||
xevent.ExposeEvent.width = hwnd.nc_invalid.Width;
|
||||
xevent.ExposeEvent.height = hwnd.nc_invalid.Height;
|
||||
return xevent;
|
||||
return xevent;
|
||||
} else {
|
||||
xevent.ExposeEvent.window = hwnd.whole_window;
|
||||
xevent.ExposeEvent.x = hwnd.nc_invalid.X;
|
||||
xevent.ExposeEvent.y = hwnd.nc_invalid.Y;
|
||||
xevent.ExposeEvent.width = hwnd.nc_invalid.Width;
|
||||
xevent.ExposeEvent.height = hwnd.nc_invalid.Height;
|
||||
return xevent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -202,6 +202,9 @@ namespace System.Windows.Forms {
|
||||
}
|
||||
|
||||
internal void Initialize () {
|
||||
if (Marshal.SizeOf<IntPtr> () == 8){
|
||||
Console.Error.WriteLine ("WARNING: The Carbon driver has not been ported to 64bits, and very few parts of Windows.Forms will work properly, or at all");
|
||||
}
|
||||
// Initialize the event handlers
|
||||
Carbon.EventHandler.Driver = this;
|
||||
ApplicationHandler = new Carbon.ApplicationHandler (this);
|
||||
|
@@ -468,11 +468,10 @@ namespace System.Windows.Forms {
|
||||
#endregion // XplatUI Driver Methods
|
||||
}
|
||||
|
||||
internal class XplatUIDriverSupport {
|
||||
static class XplatUIDriverSupport {
|
||||
#region XplatUI Driver Support Methods
|
||||
internal static void ExecutionCallback (object state)
|
||||
internal static void ExecutionCallback (AsyncMethodData data)
|
||||
{
|
||||
AsyncMethodData data = (AsyncMethodData) state;
|
||||
AsyncMethodResult result = data.Result;
|
||||
|
||||
object ret;
|
||||
@@ -492,6 +491,25 @@ namespace System.Windows.Forms {
|
||||
}
|
||||
}
|
||||
|
||||
static void ExecutionCallbackInContext (object state)
|
||||
{
|
||||
AsyncMethodData data = (AsyncMethodData) state;
|
||||
|
||||
if (data.SyncContext == null) {
|
||||
ExecutionCallback (data);
|
||||
return;
|
||||
}
|
||||
|
||||
var oldContext = SynchronizationContext.Current;
|
||||
SynchronizationContext.SetSynchronizationContext (data.SyncContext);
|
||||
|
||||
try {
|
||||
ExecutionCallback (data);
|
||||
} finally {
|
||||
SynchronizationContext.SetSynchronizationContext (oldContext);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void ExecuteClientMessage (GCHandle gchandle)
|
||||
{
|
||||
AsyncMethodData data = (AsyncMethodData) gchandle.Target;
|
||||
@@ -499,7 +517,8 @@ namespace System.Windows.Forms {
|
||||
if (data.Context == null) {
|
||||
ExecutionCallback (data);
|
||||
} else {
|
||||
ExecutionContext.Run (data.Context, new ContextCallback (ExecutionCallback), data);
|
||||
data.SyncContext = SynchronizationContext.Current;
|
||||
ExecutionContext.Run (data.Context, new ContextCallback (ExecutionCallbackInContext), data);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
|
@@ -1 +1 @@
|
||||
b0777b560268ec6dbb925063e650ee3dbb95d610
|
||||
913fb8a57fb721c4148d43e6f575333e943842a6
|
@@ -206,7 +206,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
[Test]
|
||||
public void BackColorTest ()
|
||||
{
|
||||
Assert.AreEqual (SystemColors.Window, textBox.BackColor, "#A1");
|
||||
Assert.AreEqual (SystemColors.Control, textBox.BackColor, "#A1");
|
||||
textBox.BackColor = Color.Red;
|
||||
Assert.AreEqual (Color.Red, textBox.BackColor, "#A2");
|
||||
textBox.BackColor = Color.White;
|
||||
|
@@ -108,7 +108,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual (SystemColors.Control, tsi.BackColor, "B4");
|
||||
|
||||
tsi = new ToolStripControlHost (new TextBox ());
|
||||
Assert.AreEqual (SystemColors.Window, tsi.BackColor, "B5");
|
||||
Assert.AreEqual (SystemColors.Control, tsi.BackColor, "B5");
|
||||
|
||||
tsi = new ToolStripControlHost (new ProgressBar ());
|
||||
Assert.AreEqual (SystemColors.Control, tsi.BackColor, "B6");
|
||||
@@ -239,7 +239,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.AreEqual (SystemColors.ControlText, tsi.ForeColor, "B4");
|
||||
|
||||
tsi = new ToolStripControlHost (new TextBox ());
|
||||
Assert.AreEqual (SystemColors.WindowText, tsi.ForeColor, "B5");
|
||||
Assert.AreEqual (SystemColors.ControlText, tsi.ForeColor, "B5");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@@ -145,7 +145,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
myTrackBar.Height = 250;
|
||||
myTrackBar.Orientation = Orientation.Vertical;
|
||||
Assert.AreEqual(200, myTrackBar.Width, "#SIZE03");
|
||||
AreEqual(default_height, default_height2, myTrackBar.Height, "#SIZE04");
|
||||
Assert.AreEqual(250, myTrackBar.Height, "#SIZE04");
|
||||
}
|
||||
|
||||
using (TrackBar myTrackBar = new TrackBar()) {
|
||||
@@ -163,7 +163,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
myTrackBar.AutoSize = false;
|
||||
myTrackBar.Orientation = Orientation.Vertical;
|
||||
Assert.AreEqual(200, myTrackBar.Width, "#SIZE11");
|
||||
AreEqual(default_height, default_height2, myTrackBar.Height, "#SIZE12");
|
||||
Assert.AreEqual(250, myTrackBar.Height, "#SIZE12");
|
||||
}
|
||||
|
||||
using (TrackBar myTrackBar = new TrackBar()) {
|
||||
@@ -175,7 +175,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
handle = myTrackBar.Handle;
|
||||
|
||||
AreEqual(default_height, default_height2, myTrackBar.Width, "#SIZE17");
|
||||
AreEqual(default_height, default_height2, myTrackBar.Height, "#SIZE18");
|
||||
Assert.AreEqual(250, myTrackBar.Height, "#SIZE18");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
handle = myTrackBar.Handle;
|
||||
|
||||
AreEqual(default_height, default_height2, myTrackBar.Width, "#SIZE19");
|
||||
AreEqual(default_height, default_height2, myTrackBar.Height, "#SIZE20");
|
||||
Assert.AreEqual(250, myTrackBar.Height, "#SIZE20");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
|
||||
myTrackBar.Orientation = Orientation.Horizontal;
|
||||
|
||||
AreEqual(default_height, default_height2, myTrackBar.Width, "#SIZE23");
|
||||
Assert.AreEqual(250, myTrackBar.Width, "#SIZE23");
|
||||
AreEqual(default_height, default_height2, myTrackBar.Height, "#SIZE24");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user