Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!ames!sun-barr!newstop!sun!turnpike!argv From: argv%turnpike@Sun.COM (Dan Heller) Newsgroups: comp.windows.x Subject: Re: Using Xt to create an override shell Message-ID: <134360@sun.Eng.Sun.COM> Date: 12 Apr 90 08:53:44 GMT References: <134170@sun.Eng.Sun.COM> <9004111939.AA01109@expo.lcs.mit.edu> Sender: news@sun.Eng.Sun.COM Reply-To: argv@sun.UUCP (Dan Heller) Organization: Sun Microsystems, Mountain View Lines: 77 In article <9004111939.AA01109@expo.lcs.mit.edu> converse@EXPO.LCS.MIT.EDU (Donna Converse) writes: > > I know I can create an override-redirect shell using Xt, but what > > if I want that to be my main window? > ICCCM issues aside, set XtNoverrideRedirect to be True on the top > level shell. Nope -- didn't work. That is, I tried using a topLevelShellwidgetClass and set XtNoverrideRedirect to True and it made no difference. In looking thru code and doc to see why, I learned that that attribute is not intended to be set by the programmer or via resources -- it is an attribute that is set automatically by the internals to the shell widget code. Sorry, I don't remember the specifics for how I determined that... But, I didn't pay too much attention because at just about the same time I found XtAppCreateShell() and the shell class: overrideShellwidgetClass worked with the worked just fine. Now, to have my application consist entirely of a single override shell with a plain core widget underneith it, I simply ignore the toplevel shell returned by XtInitialize() and just use the new override shell as my toplevel shell. In order for that shell to get keyboard input, I must call XSetInputFocus() (or related call). Simply specifying in my translation table: : function() didn't accept keyboard input for my simple core widget as it would for any other widget. (I tried setting XtNinput to both True and Flase on the override shell and false and neither worked.) Several other things I noticed... * There is no XtVa (varargs) version for XtAppCreateShell(). * "App" has nothing to do with this function call -- you don't specify any application context in its parameter list. Am I missing something? * There doesn't seem to be any way to specify shell-specific resources via XtInitialize(). Yes, you can use the "options" parameter, but this isn't quite the same thing as the Arg lists used in the other XtCreateWidget-style calls. Why not have the "args" and "nargs" parameters to XtInitialize (et al.) routines? Other related problems... Since this is a "lockscreen" program, there are clearly some nonstandard issue to consider. Thus, the reason for using an override-redirect shell. I do not want the window manager to know about this window (which means that the user should have no way of bringing up other windows over it). However, if an application underneith somehow does an XRaiseWindow(), I want to know about this an raise my lockscreen application back to the top again... To do this, I wanted to set VisibilityNotify in my translation table. Well, I noticed that I actually get the event at the first time the widget is mapped to the screen, but it is never called again regardless of the visibility events that may or may not get generated... If visibility events are not generated, I've found that the reason is that the override shell has save-under turned on and the server is repainitng any damaged window areas without notifying the application of a repaint or visibility event. I tried turning it off by setting XtNsaveUnder to False, but (like XtNoverrideRedirect) it had no effect. So, what other ways are there to turn off the save under? I not only want to, but (due to the nature of the activity in the window) I *have* to redraw the damaged areas of the window myself. This isn't working quite right... I have not been able to get visibility events to get generated at all and I'm not sure if it has anything to do with the save-unders (it doesn't sound like it should). The application consists of an override-redirect shell and a simple core widget. I set up a simple translation table that traps keypress, mouse, expose, and visibility events. that's just about it. dan ----------------------------------------------------------- O'Reilly && Associates argv@sun.com / argv@ora.com 632 Petaluma Ave, Sebastopol, CA 95472 800-338-NUTS, in CA: 800-533-NUTS, FAX 707-829-0104 Opinions expressed reflect those of the author only.