[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] pnetlib/Xsharp Screen.cs, 1.3, 1.4 Xlib.cs.in, 1.
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] pnetlib/Xsharp Screen.cs, 1.3, 1.4 Xlib.cs.in, 1.16, 1.17 XsharpSupport.c, 1.20, 1.21 |
Date: |
Tue, 25 Nov 2003 22:24:47 +0000 |
Update of /cvsroot/dotgnu-pnet/pnetlib/Xsharp
In directory subversions:/tmp/cvs-serv28226/Xsharp
Modified Files:
Screen.cs Xlib.cs.in XsharpSupport.c
Log Message:
Implement the "wakeup" signal for Xsharp.
Index: Screen.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/Xsharp/Screen.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Screen.cs 24 Jun 2003 02:18:56 -0000 1.3
--- Screen.cs 25 Nov 2003 22:24:45 -0000 1.4
***************
*** 238,241 ****
--- 238,265 ----
}
+ /// <summary>
+ /// <para>Send a wakeup message to the event queue for this
screen.</para>
+ /// </summary>
+ ///
+ /// <remarks>
+ /// <para>Wakeup messages are sent from one thread to the event queue
+ /// thread, to cause the event queue to stop blocking and return back to
+ /// the caller. The wakeup message involves a round trip to the
+ /// X server, so it should be used sparingly.</para>
+ /// </remarks>
+ public void Wakeup()
+ {
+ try
+ {
+ IntPtr display = dpy.Lock();
+ Xlib.XSharpSendWakeup
+ (display,
placeholder.GetWidgetHandle());
+ }
+ finally
+ {
+ dpy.Unlock();
+ }
+ }
+
// Get the default visual for this screen. We currently only
// support screens with one visual.
Index: XsharpSupport.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/Xsharp/XsharpSupport.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** XsharpSupport.c 25 Nov 2003 07:05:40 -0000 1.20
--- XsharpSupport.c 25 Nov 2003 22:24:45 -0000 1.21
***************
*** 1242,1245 ****
--- 1242,1260 ----
}
+ /*
+ * Send a wakeup message to a window.
+ */
+ void XSharpSendWakeup(Display *dpy, Window window)
+ {
+ Atom wakeupAtom = XInternAtom(dpy, "_XSHARP_WAKEUP", False);
+ XEvent msg;
+ memset(&msg, 0, sizeof(msg));
+ msg.xclient.type = ClientMessage;
+ msg.xclient.window = window;
+ msg.xclient.message_type = wakeupAtom;
+ msg.xclient.format = 32;
+ XSendEvent(dpy, window, False, NoEventMask, &msg);
+ }
+
#else /* X_DISPLAY_MISSING || !HAVE_SELECT */
***************
*** 1326,1329 ****
--- 1341,1349 ----
void XSharpSendClose(Display *dpy, Window window)
+ {
+ /* Nothing to do here */
+ }
+
+ void XSharpSendWakeup(Display *dpy, Window window)
{
/* Nothing to do here */
Index: Xlib.cs.in
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/Xsharp/Xlib.cs.in,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Xlib.cs.in 23 Nov 2003 03:37:51 -0000 1.16
--- Xlib.cs.in 25 Nov 2003 22:24:45 -0000 1.17
***************
*** 587,590 ****
--- 587,594 ----
(IntPtr display, Xlib.Window window);
+ [DllImport("XsharpSupport")]
+ extern public static void XSharpSendWakeup
+ (IntPtr display, Xlib.Window window);
+
// Helper functions for creating and managing application groups.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] pnetlib/Xsharp Screen.cs, 1.3, 1.4 Xlib.cs.in, 1.16, 1.17 XsharpSupport.c, 1.20, 1.21,
Rhys Weatherley <address@hidden> <=