Writing a Window Manager: Handling MapRequest Events?


#1

Okay, so I’ve started writing a tracktion-themed window manager for linux (screenshot w/faked xterm). This is the first time I’ve done anything like this, but I think I’ve got a handle on how to do it. The thing I’m stuck with though (and hopefully someone here is knowledgable enough about XWindows to be able to help me…) is handling MapRequest events whenever a window is opened, so I can place and size it where I want it to be (there’ll be a TabbedComponent in the main part of the screen, to letting you select the currently-displayed window from the tabs).

I’ve called XChangeWindowAttributes with SubstructureRedirectMask on the root window, so any windows that open will let me handle the mapping, but JUCE discards all the MappingRequest and ConfigureRequest events in it’s event queue, so I’ve no way of getting them. Am I right in thinking the only way for me to handle this is to modify JUCE somehow to pass on these kind of events to a currently-running Component (/MessageListener?), or is there a better way of doing it? (it would be nice if I could get away with not having to modify JUCE)

  • Niall.

#2

Sounds terrifying! I’m afraid I’m not enough of a linux-head to be able to help much, but keep me posted if there are any useful mods I could add to juce that’d help you…


#3

:smiley:

I think what I’m going to do is add a method to the MessageManager to call a callback function (defined in my main window Component) whenever one of the relevant events appears in the event queue. I’ll have to distribute my modified version of JUCE (I think three files are altered) along with the window manager, but I don’t think it’s really worth putting the changes I’m making into JUCE itself - I don’t know how you’d implement them on platforms other than linux, or even why you’d want to…

  • Niall.

#4