public override void SetCapture(XwtImpl xwt, Widget widget) { if (widget != null) { var backend = widget.GetBackend(); var w = backend.GetType().GetPropertyValue(backend, "Widget"); w.GetType().Invoke(w, "CaptureMouse"); } }
public override void SetCapture(XwtImpl xwt, Widget widget) { var gtkwin = widget.GetBackend().NativeWidget; // Gtk.gtk_grab.InvokeStatic("Add", gtkwin); // var gtk = widget.GetBackend().NativeWidget; var gdkwin = gtkwin.GetType().GetPropertyValue(gtkwin, "GdkWindow"); // var h = (IntPtr)gdk.GetType().GetPropertyValue(gdk, "Handle"); // int r = x11_gdk_pointer_grab(h, true, , IntPtr.Zero, IntPtr.Zero, 0); var et = Platform.GetType("Gdk.EventMask"); var em = Enum.ToObject(et, 0x3f0 /*0x33fb*/); var r = Platform.GetType("Gdk.Pointer").InvokeStatic("Grab", new object[] { gdkwin, true, em, null, null, (uint)0 }); Console.WriteLine($"gdk_grab={r}"); }
public override void SetCapture(XwtImpl xwt, Widget widget) { Debug.Assert(this.captured == 0 ? this.captureitem == null : object.ReferenceEquals(this.captureitem, widget)); Debug.Assert(this.captured == 0); if (this.captured++ == 0) { this.captureitem = widget; } if (this.captureitemeventdoeventcnt == 0) { xwt.QueueOnUI(() => { if (this.captureitemeventdoeventcnt != 0) { return; } while (captured > 0) { DoEvents(() => true); } }); } }
public override void SetCapture(XwtImpl xwt, Widget widget) { var gtkwin = widget.GetBackend().NativeWidget; Gtk.gtk_grab.InvokeStatic("Add", gtkwin); }
public abstract void SetCapture(XwtImpl xwt, Widget widget);