-<<<<<<< .mine
+2004-12-18 Peter Bartok <pbartok@novell.com>
+
+ * XplatUIX11.cs (SetModal): Applied patch from Ashwin Bharambe,
+ implementing SetModal() method
+
2004-12-18 Peter Bartok <pbartok@novell.com>
* X11Structs.cs (XGCValues): Fixed type of function element
* XplatUIX11.cs: Implemented ScrollWindow() method
* XplatUIOSX.cs: Stubbed out ScrollWindow() method
-=======
2004-12-17 Geoff Norton <gnorton@customerdna.com>
* XplatUIOSX.cs: Fix cursor to use an Invert instead of drawing it
Some more keyboard support (INCOMPLETE)
->>>>>>> .r37924
2004-12-17 Peter Bartok <pbartok@novell.com>
* TextControl.cs:
private static int wm_no_taskbar; // X Atom
private static int wm_state_above; // X Atom
private static int atom; // X Atom
+ private static int wm_state_modal; // X Atom
private static int net_wm_state; // X Atom
private static int async_method;
private static int post_message;
net_wm_state=XInternAtom(display_handle, "_NET_WM_STATE", false);
wm_no_taskbar=XInternAtom(display_handle, "_NET_WM_STATE_NO_TASKBAR", false);
wm_state_above=XInternAtom(display_handle, "_NET_WM_STATE_ABOVE", false);
+ wm_state_modal = XInternAtom(display_handle, "_NET_WM_STATE_MODAL", false);
+
atom=XInternAtom(display_handle, "ATOM", false);
async_method = XInternAtom(display_handle, "_SWF_AsyncAtom", false);
post_message = XInternAtom (display_handle, "_SWF_PostMessageAtom", false);
}
internal override void SetModal(IntPtr handle, bool Modal) {
- // We need to use the Motif window manager hints to build modal stuff; see freedesktop.org
- throw new NotImplementedException("Finish me");
+ XEvent xevent = new XEvent();\r
+\r
+ xevent.ClientMessageEvent.type = XEventName.ClientMessage;\r
+ xevent.ClientMessageEvent.serial = 0;\r
+ xevent.ClientMessageEvent.send_event = true;\r
+ xevent.ClientMessageEvent.window = handle;\r
+ xevent.ClientMessageEvent.message_type = (IntPtr) net_wm_state;\r
+ xevent.ClientMessageEvent.format = 32;\r
+ xevent.ClientMessageEvent.ptr1 = (IntPtr) (Modal ? NetWindowManagerState.Add : NetWindowManagerState.Remove);\r
+ xevent.ClientMessageEvent.ptr2 = (IntPtr) wm_state_modal;\r
+\r
+ XSendEvent(DisplayHandle, root_window, false, EventMask.SubstructureRedirectMask | EventMask.SubstructureNotifyMask, ref xevent);\r
}
internal override void Invalidate (IntPtr handle, Rectangle rc, bool clear) {