Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!vtserf!creatures!bloss.cs.vt.edu!ramakris From: ramakris@bloss.cs.vt.edu (S.Ramakrishnan) Newsgroups: comp.windows.x Subject: Trapping the ConfigureRequest Event. Message-ID: <552@creatures.cs.vt.edu> Date: 19 Aug 90 00:42:37 GMT Sender: usenet@creatures.cs.vt.edu Reply-To: ramakris@bloss.cs.vt.edu (S.Ramakrishnan) Distribution: na Organization: Virginia Tech Computer Science, Blacksburg, VA Lines: 53 ConfigureRequest , override_redirect , SubstructureRedirectMask, XSelectInput , XtAddEventHandler. I want to be able to position my window at byte boundaries. However, the window manager doesn't always comply with my request for XMoveWindow. Hence, I need to trap any ConfigRequest and if its a reposition request, I need to position the window at the nearest 8-bit boundary. However, I want to take over the window only when a reposition request is obtained. And leave it to the WM at other times. Am doing the following : 1. Select input with the SubstructureRedirectMask on the top level window of my application. 2. Turn the override_redirect flag False (thats what the Xlib manual says I shud do). 3. And then wait for the event. 4. After obtaining the event : i) Turn the overridde_redirect flag of the window True. ii) Configure the Window by XConfigureWindow(). iii) Turn the override_redirect flag False. Strangely, I never get the event. The window manager always gets the configure requests. Am I missing s.th ? Ps : In Widget domain can I not select the ConfigureRequest on the Window of a Widget by { XtEventHandler my_handler (); XSetWindowAttributes wa; wa.override_redirect = False ; XChangeWindowAttributes(XtDisplay(canvas),XtWindow(canvas),CWOverrideRedirect,&wa); XtAddEventHandler(root,SubstructureRedirectMask,False,my_handler); } Regards, S Ramakrishnan. -- -- S.Ramakrishnan, CS Dept, McBryde Hall, VaTech, Blacksburg, Virg. 24061-0106 (email : ramakris@bloss.cs.vt.edu, ramakris@vtcc1.cc.vt.edu)